text:
# Vectrexy

Vectrexy is a [Vectrex](https://en.wikipedia.org/wiki/Vectrex) emulator programmed in C++.

This project is open source and available on GitHub: https://github.com/amaiorano/vectrexy

## Download Latest Build

### Build status ![master branch status](https://github.com/amaiorano/vectrexy/actions/workflows/ci.yml/badge.svg?branch=master)

* [Vectrexy for Windows 64-bit](https://dl.cloudsmith.io/public/vectrexy/vectrexy/raw/files/vectrexy-windows-x64.zip)

* [Vectrexy for Windows 32-bit](https://dl.cloudsmith.io/public/vectrexy/vectrexy/raw/files/vectrexy-windows-x86.zip)

* [Vectrexy for Linux 64-bit](https://dl.cloudsmith.io/public/vectrexy/vectrexy/raw/files/vectrexy-ubuntu-x64.zip)

\
[![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=flat-square)](https://cloudsmith.com)

Package repository hosting is graciously provided by  [Cloudsmith](https://cloudsmith.com).
Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that
enables your organization to create, store and share packages in any format, to any place, with total
confidence.

## Twitch Development

I regularly stream part of the development on Twitch [right here](https://www.twitch.tv/daroou2). Follow me to know when I'm streaming!

## Compatibility

See the [Vectrexy Compatibility List](docs/vectrexy-compatilibity-list.md) for the list of games that Vectrexy can run.

## Controls

| Devices     | Player 1  | Player 2  |
| ----------- | --------- | --------- |
| No gamepads | Keyboard  | N/A       |
| 1 gamepad   | Gamepad 1 | Keyboard  |
| 2 gamepads  | Gamepad 1 | Gamepad 2 |

Keyboard key bindings: ASDF + Arrow keys

## Overlays

The Vectrex display is black & white, so to add color, each game cartridge came with a transparent colored overlay that would be slotted in front of the screen. For emulation purposes, you should be able to find png files for these overlays. If you place these png file in the `data/overlays` folder, Vectrexy will attempt to match the rom's file name to the overlay name using "fuzzy" string matching (in other words, the file names do not need to match exactly).

## What's a Vectrex and why did you write this emulator?

The Vectrex is a really cool and unique video game console that was released in 1982. What made it unique was that it came with its own screen and displayed vector-based graphics, rather than the typical sprite/raster based graphics of most game consoles. My uncle had gotten me a Vectrex when I was only 8 years old, and I still have it, and it's still awesome.

## Credits

Although the emulator core is written by me, Antonio Maiorano (Daroou2), it makes use of third party libraries, and is packaged with overlays created by other people. I hope I've got everyone covered here; if not, please let me know and I'll be happy to correct this list.

- Overlays: THK-Hyperspin, Gigapig-Hyperspin, Nosh01-GitHub, and other unknown authors.
- FastBoot and SkipBoot bios roms: Franck Chevassu, author of the exellent Vectrex emulator, [ParaJVE](http://www.vectrex.fr/ParaJVE/)
- SDL2: [SDL2 Credits](https://www.libsdl.org/credits.php)
- GLEW: [GLEW authors](https://github.com/nigels-com/glew#authors)
- GLM: [G-Truc Creations](http://www.g-truc.net/)
- stb: [Sean Barrett (Nothings)](http://nothings.org/)
- Dear ImGui: [omar (ocornut)](http://www.miracleworld.net/)
- linenoise: [Salvatore Sanfilippo (antirez)](http://invece.org/)
- noc: [Guillaume Chereau](https://blog.noctua-software.com/)

## Building the code

### Windows

Install:
* [CMake](https://cmake.org/)
* [Visual Studio](https://www.visualstudio.com/downloads/)

Clone and build vectrexy using CMake:
```bash
git clone --recursive https://github.com/amaiorano/vectrexy.git
cd vectrexy
mkdir build && cd build
cmake ..
cmake --build .
```

### Ubuntu

Install:
* [CMake](https://cmake.org/)
* gcc 8 or higher

Install a compiler and some Linux-specific libs we depend on:
```bash
sudo apt-get install g++-8 libgtk2.0-dev
```

SDL2 has many dependencies, some of which you may need to install:
```
# SDL static lib dependencies (see https://hg.libsdl.org/SDL/file/default/docs/README-linux.md)
# Alternatively, you can just 'apt-get libsdl2-dev' to build against the dynamic library

sudo apt-get install build-essential mercurial make cmake autoconf automake libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev libsndio-dev
```

Clone and build vectrexy using CMake:
```bash
git clone --recursive https://github.com/amaiorano/vectrexy.git
cd vectrexy
mkdir build && cd build
cmake ..
cmake --build .
```

### Extra CMake Build Args

Use ```-D<VAR_NAME>=<VALUE>``` from the CMake CLI, or use cmake-gui to set these.

#### BUILD_SHARED_LIBS=on|off (Default: off)

If enabled, builds a DLL/.so version.

**NOTE**: On Windows, vcpkg's "static" triplets (e.g. x64-windows-static) create static libs that link against the static CRT (/MT), while CMake generates shared library builds that link against the dynamic CRT (/MD). Thus, when building, the linker will emit: `LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library`. You can ignore this for the most part; however, you can fix this warning by creating a custom vcpkg triplet, e.g. x64-windows-static-md.cmake, that is a copy of x64-windows-static.cmake, except with `set(VCPKG_CRT_LINKAGE dynamic)`. If you use this triplet to build dependencies with vcpkg, and specify it as CMake's `VCPKG_TARGET_TRIPLET`, all libraries will use the dynamic CRT, and no warning will be emitted by the linker.

#### DEBUG_UI=on|off (Default: on)

If enabled, the in-game debug UI can be displayed. Mostly useful for development.

#### ENGINE_TYPE=null|sdl (Default: sdl)

The type of engine to use. By default, SDL is used. If "null" is specified, the emulator will execute without any audio or visuals; however, the debugger will work, which can be useful for testing the emulator, or as a starting point for a new engine type.

## Contributing

As the emulator is still in early stages of development, I generally won't be looking at or accepting pull requests. Once the project has matured enough, this will likely change. If you wish, [follow my stream](https://www.twitch.tv/daroou2) and make suggestions in chat instead.

repository: amaiorano/vectrexy

repo_name: amaiorano/vectrexy


text:
---
title: "MySQL Cheat Sheet"
slug: "mysql-cheat-sheet"
date: "2006-05-18T19:15:00-06:00"
author: "fak3r"
categories:
- linux
tags:
- howto
---

Here’s a page that’s just too useful not to mirror, some cat named Neal Parikh has a page he calls a [MySQL Cheat Sheet](http://nparikh.freeshell.org/unix/mysql.php); click that link for the latest revision, or read more for my mirrored copy for reference.  When I have to do DB work outside of what I usually do day-to-day I hit Google for some tutorials, so having this as a reference will be helpful in the future.

**Selecting a database:**

    mysql> USE database db_name;

**Listing databases:**

    mysql> SHOW DATABASES;

**Listing tables in a db:**

    mysql> SHOW TABLES;

**Describing the format of a table:**

    mysql> DESCRIBE table;

**Creating a database:**

    mysql> CREATE DATABASE db_name;

**Creating a table:**

    mysql> CREATE TABLE table_name (field1_name TYPE(SIZE), field2_name TYPE(SIZE));

Ex: mysql> CREATE TABLE pet (name VARCHAR(20), sex CHAR(1), birth DATE);

**Load tab-delimited data into a table:**

    mysql> LOAD DATA LOCAL INFILE "infile.txt" INTO TABLE table_name;

(Use \n for NULL)

**Inserting one row at a time:**

    mysql> INSERT INTO table_name VALUES ('MyName', 'MyOwner', '2002-08-31');

(Use NULL for NULL)

**Retrieving information (general):**

    mysql> SELECT from_columns FROM table WHERE conditions;
    All values: SELECT * FROM table;
    Some values: SELECT * FROM table WHERE rec_name = "value";
    Multiple critera: SELECT * FROM TABLE WHERE rec1 = "value1" AND rec2 = "value2";

**Reloading a new data set into existing table:**

    mysql> SET AUTOCOMMIT=1; # used for quick recreation of table
    mysql> DELETE FROM pet;
    mysql> LOAD DATA LOCAL INFILE "infile.txt" INTO TABLE table;

**Fixing just one record:**

    mysql> UPDATE table SET value = "new_value" WHERE record_name = "value";

**Selecting specific columns:**

    mysql> SELECT column_name FROM table;

**Retrieving unique output records:**

    mysql> SELECT DISTINCT column_name FROM table;

**Sorting:**

    mysql> SELECT col1, col2 FROM table ORDER BY col2;
    Backwards: SELECT col1, col2 FROM table ORDER BY col2 DESC;

**Date calculations:**

    mysql> SELECT CURRENT_DATE, (YEAR(CURRENT_DATE)-YEAR(date_col)) AS time_diff [FROM table];
    MONTH(some_date) extracts the month value and DAYOFMONTH() extracts day.

**Pattern Matching:**

    mysql> SELECT * FROM table WHERE rec LIKE "blah%";

(% is wildcard - arbitrary # of chars)
Find 5-char values: SELECT * FROM table WHERE rec like ”**_**”;
(_ is any single character)

**Extended Regular Expression Matching:**

    mysql> SELECT * FROM table WHERE rec RLIKE "^b$";

(. for char, […] for char class, * for 0 or more instances
^ for beginning, {n} for repeat n times, and $ for end)
(RLIKE or REGEXP)
To force case-sensitivity, use “REGEXP BINARY”

**Counting Rows:**

    mysql> SELECT COUNT(*) FROM table;

**Grouping with Counting:**

    mysql> SELECT owner, COUNT(*) FROM table GROUP BY owner;

(GROUP BY groups together all records for each ‘owner’)

**Selecting from multiple tables:**

    mysql> SELECT pet.name, comment FROM pet, event WHERE pet.name = event.name;

(You can join a table to itself to compare by using ‘AS’)

**Currently selected database:**

    mysql> SELECT DATABASE();

**Maximum value:**

    mysql> SELECT MAX(col_name) AS label FROM table;

**Auto-incrementing rows:**

    mysql> CREATE TABLE table (number INT NOT NULL AUTO_INCREMENT, name CHAR(10) NOT NULL);
    mysql> INSERT INTO table (name) VALUES ("tom"),("dick"),("harry");

**Adding a column to an already-created table:**

    mysql> ALTER TABLE tbl ADD COLUMN [column_create syntax] AFTER col_name;

**Removing a column:**

    mysql> ALTER TABLE tbl DROP COLUMN col;

(Full [ALTER TABLE](http://www.mysql.com/doc/en/ALTER_TABLE.html) syntax available at mysql.com.)

**Batch mode (feeding in a script):**

    # mysql -u user -p < batch_file

(Use -t for nice table layout and -vvv for command echoing.)
Alternatively:

    mysql> source batch_file;

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# drag

Some little squres to drag around.

- **drag** to move a square

> Try this example in two browser windows at once!

The Drag2 example only allows one square to be dragged at once. This limits the functionality, but prevents the conflict found in the drag1 example.

license: MIT

gha_language: JavaScript

gha_license_id: MIT


text:
---
layout: post
title: Week 12
---

## Open Source Meetup

This week I attended the OSI open source meetup and my first BUGS meeting. The meetup was focused around careers in open source which included everything from engineering to legal. I learned a lot about open source in the real world and all the different parts involved. I also got to hear a lot of different points of view on open source software and working in open source companies. Finally, I got to meet a lot of different people in a lot of different roles and have some interesting conversations about careers in open source.

branch_name: refs/heads/gh-pages

gha_language: CSS


text:
# Cryptofolio

A program to display your cryptocurrency balances in fiat currency - best for HODLers

## Requirements
If building from source, ensure [Golang](https://golang.org/dl/) is installed on your system

## Caveats
Currently...

This program leverages the [Coincap API](https://docs.coincap.io/#ee30bea9-bb6b-469d-958a-d3e35d442d7a) for markets data reference.

Only USD fiat currency is supported.

All input data is sourced from a user supplied manifest file in JSON format (e.g. `YOURFILENAME.json`) via the `-manifest` argument.

## Configuration
Edit your JSON manifest file with your asset data. The manifest must include an array of objects. Object properties include:

* `id (string, required)`: [Coincap API](https://docs.coincap.io/#ee30bea9-bb6b-469d-958a-d3e35d442d7a) asset identifier
* `quantity (float, required)`: quantity of the asset you currently hold

Example: `manifest.json`

```json
[
  {
    "id": "bitcoin",
    "quantity": 10.0
  },
  {
    "id": "bitcoin-cash",
    "quantity": 10.0
  },
  {
    "id": "ethereum",
    "quantity": 10.0
  },
  {
    "id": "cardano",
    "quantity": 10.0
  },
  {
    "id": "xrp",
    "quantity": 10.0
  }
]
```

## Usage
You can either compile the program from source, or download a pre-compiled binary specific to your operating system

### Build
From the repository root directory, run the following shell command:

```go
go build
```

### Execute
Invoke the binary relative to your operating system via shell:

### Linux/MacOS
```sh
./cryptofolio -manifest=/path/to/your/manifest.json
```

### Windows
```sh
.\cryptofolio.exe -manifest=C:\path\to\your\manifest.json
```

repository: jeebster/cryptofolio

repo_name: jeebster/cryptofolio


text:
---
layout: default
permalink: /guide
title: Page Guide
published: false
---

# A guide for myself, or for you

I hope I am an expert on web development, but I am not unfortunately. However, I still want to build a pretty personal page --- this page is the one I have achieved so far.

The problem is: I am so poor in remembering all those necessary details to maintain this page as pretty as always. So I write this guide for myself, or for you, in case that you are interested in referring to or forking [the source of this page](https://github.com/ryushinn/ryushinn.github.io/tree/master) to make your own site (under MIT license).

> This guide might be regularly updated if I have new ideas or touch new knowledge about the front-end development.

## Foundation: Jekyll and al-folio

Basically, [Jekyll](https://jekyllrb.com/docs/) is an awesome generator for static sites. It **compiles** your content and styles which are provided in formats of Markdown, CSS, or HTML, into deployable HTML sites.

Most importantly, Publishing content by Jekyll is a perfect workflow for academic pages: you only need to focus on the content itself and the rest of trifles could be settled by your predefined styles and the Jekyll engine.

Jekyll owns a set of rules to generate sites, same as many other compilers, which however are not more than so-called templates (and their grammars), layouts, and configurations. Check following documents to get familiar with these rules:

- [Jekyll Doc](https://jekyllrb.com/docs/)
- [Liquid](https://jekyllrb.com/docs/step-by-step/02-liquid/)
- [Jekyll directory structure](https://jekyllrb.com/docs/structure/)

Moreover, this site is built with [al-folio](https://github.com/alshedivat/al-folio) Jekyll theme which provides great layouts and features to start, but has been modified a lot to fit my needs.
Look at [Appendix](#appendix) to gain a rough idea about core components.

## Goal

Some good examples of scholar webpages:

- [Prof. Ling-Qi Yan](https://sites.cs.ucsb.edu/~lingqi/#)
- [Prof. Wenzel Jakob](https://rgl.epfl.ch/)
- [Prof. Shuang Zhao](https://shuangz.com/)

Essentially, I want to keep my site informative, compact, and good-looking. So I aim for three features, which are listed and elaborated below.

## Feature 1: About in one page

## Feature 2: Publications

## Feature 3: Blogs

## Appendix

### Layouts

### Styles

- Bootstrap & MDB
  - [ ] the Grid system!
- Fonts & Icons
  - Awesomefonts
  - Academicons
- main.css: local styles used for this page
  - Libertinus: fonts
- dark mode and theme

### Collections

### Data

### Why we need to brand our research?

gha_language: HTML


text:
# Welcome to Padwoman

Padwoman allows to organise Etherpad Lite groups in a simple and beautiful user interface.
By creating the cookies for the etherpad instance it also serves as an authentication service for its pads.

## Features

* Organise Pads into Groups
* Restrict Access to Pads and only allow certain Users or Usergroups to see them
* Make Pads public to allow everyone to edit them if they have the link to the pad
* Enforce or suggest Padnames based on the date for specified groups
* Fill new Pads with a template upon creation
* Make use of caching to speed up the etherpad API requests

## Screenshots

![Login](images/screen-0.png)
*Login to Padwoman*. Besides LDAP, other [authentication backends](config.md#auth) are supported.

![List of Pads](images/screen-1.png)
*List of Pads*. Pads are listed per Group and sorted by Modification date. For each Group, a list of users and user groups that are able to access it can be configured. As much of this as possible is cached to allow for faster loadtimes. The icon on the left hand side allows to switch pads between private and public access.

![New Pad](images/screen-2.png)
*New Pad*. Upon Pad-creation you can specify if you want to use the Group-specific template for the new pad. Padwoman can be configured to always enforce this option. The same applies to the name of the pad.

repository: HackHerz/padwoman

branch_name: refs/heads/development

gha_language: Python

gha_license_id: NOASSERTION

repo_name: HackHerz/padwoman


text:
# Drum Kit: Development Strategy

Building this site one step at a time

---

## 0. README

* Write the `README.md`, including the final screen shot
* Include a License
* Include this `development.md` file

---

## 1. Setup

* Create boilerplate index.html

---

## 2. User Story: Display Keyboard

__A user can see which sound each key will make__

### DOM:

* Create one element per key in the drumset, with child elements to display the key name and sound it will make
* Create a container for all of the key elements

---

## 3. User Story: Play Sounds

__A user can press the displayed keys and hear the sound__

### Assets:

* Create a `/sounds` folder containing all of the .wav files

### DOM:

* Create audio tags with paths to the sound assets
* Create script tags for the Handler & Listener
* Create `data-key` attributes to link the key elements with the audio elements

### Listeners:

* Attach a `keyup` event to the window object.

### Handlers:

* Create a `playSound` event handler that checks to see if the pressed key has a linked audio sound. If it does, play the sound!

---

## 4. User Story: See Beauty

__A user can use a well-styled page__

### Assets:

* Add the background image to  `/images`

### Styles:

* Require and apply the background image
* Create styles for the keys

### DOM:

* Create a link tag to require the styles
* Add classes to styled elements

---

## 5. User Story: Animate Keys

__A user can know which keys are currently pressed__

### Styles:

* Create a class for keys that are currently pressed

### Handlers:

* Create a `removeTransition` handler to remove the `.playing` class when a key is released
* Update the `playHandler` to add the `.playing` class when a key is pressed

### Listeners:

* Add a `transitionend` listener to each element with the `.key` class, with the `removeTransition` handler.

repository: HackYourFutureBelgium/drum-kit

repo_name: HackYourFutureBelgium/drum-kit


text:
# Fluid - A Fluent Java API for Cascading

## Overview

Fluid is an API library exposing the [Cascading](http://cascading.org/) library as a
[Fluent API](http://en.wikipedia.org/wiki/Fluent_interface).

```java
    // Fluid has factories for all Operations (Functions, Filters, Aggregators, and Buffers)
    Function splitter = Fluid.function()
      .RegexSplitter()
      .fieldDeclaration( fields( "num", "char" ) )
      .patternString( " " )
      .end();

    // Use Fluid to start an assembly builder for chaining Pipes into complex assemblies
    AssemblyBuilder.Start assembly = Fluid.assembly();

    Pipe pipeLower = assembly
      .startBranch( "lower" )
      .each( fields( "line" ) ).function( splitter ).outgoing( Fields.RESULTS )
      .completeBranch();

    Pipe pipeUpper = assembly
      .startBranch( "upper" )
      .each( fields( "line" ) ).function( splitter ).outgoing( Fields.RESULTS )
      .completeBranch();

    Pipe coGroup = assembly
      .startCoGroup()
      .lhs( pipeLower ).lhsGroupFields( fields( "num" ) )
      .rhs( pipeUpper ).rhsGroupFields( fields( "num" ) )
      .declaredFields( fields( "num1", "char1", "num2", "char2" ) )
      .joiner( new OuterJoin() )
      .createCoGroup();

    assembly
      .continueBranch( "result", coGroup )
      .retain( fields( "num1", "char1" ) )
      .rename( Fields.ALL, fields( "num", "char" ) )
      .completeBranch();

    // Capture all the unattached tail pipes
    Pipe[] tails = assembly.completeAssembly();

    FlowDef flowDef = flowDef()
      .addSource( "lower", sourceLower )
      .addSource( "upper", sourceUpper )
      .addSink( "result", sink )
      .addTails( tails );
```

The Fluid API is generated directly from Cascading compiled libraries.

Code generation dramatically reduces the amount of maintenance required, and will ultimately allow any third-party
classes to also have Fluent APIs generated through the build process.

To use Fluid, there is no installation. All Fluid libraries are available through the [Conjars.org](http://conjars.org)
Maven repository.

## Learning the API

Current release Java docs can be found here:

  * http://docs.cascading.org/fluid/1.0/javadoc/fluid-api/

Note that there is only one entry point, the `Fluid` class.

Your IDE should offer auto complete suggestions after calling the initial factory methods. And for the most part,
only methods will be suggested that would logically be next in the chain. Fluid strives to not add any new concepts
to its API and to only mirror Cascading concepts, so familiarity with Cascading should be sufficient, but is at
least required.

Also [Cascading for the Impatient](http://docs.cascading.org/impatient/) has been ported to Fluid.

This is [part 6](http://docs.cascading.org/impatient/impatient6.html) using the Fluid API:

  * https://github.com/Cascading/Impatient/blob/fluid/part6/src/main/java/impatient/Main.java

The source to the complete ported Impatient series:

  * https://github.com/Cascading/Impatient/tree/fluid

## Using with Maven/Ivy/Gradle

It is strongly recommended developers pull Fluid from our Maven compatible jar repository
[Conjars.org](http://conjars.org).

You can find the latest public releases here:

*  http://conjars.org/cascading/fluid-api
*  http://conjars.org/cascading/fluid-cascading25
*  http://conjars.org/cascading/fluid-cascading26
*  http://conjars.org/cascading/fluid-cascading27
*  http://conjars.org/cascading/fluid-cascading30

Three dependencies must be added to the project settings.

First, the `fluid-api` which contains the root `Fluid` class.

Second, the dependency that corresponds to the version of Cascading you wish to use. This artifact already has a
dependency on a particular version of Cascading. You can override this in your project to get a later maintenance
release. But do not mix/match major/minor releases this way.

Source and Javadoc artifacts (using the appropriate classifier) are also available through Conjars.

All Fluid artifacts are built with JDK 1.7 (though they are likely JDK 1.6 source compatible).

Third, Fluid depends on [Flapi](https://github.com/UnquietCode/Flapi). If you are using Maven/Ivy/Gradle or similar
then you may need to add the Maven repository at http://www.unquietcode.com/maven/releases
to your build definition and the necessary Flapi jars will be included in your project.

Flapi is also hosted on Conjars, so the above typically isn't necessary.

## Design Notes

Please comment on the mail list for suggestions, or prototype them in tests and pull requests.

The primary goal of Fluid is:

    To allow not only hard things to be possible, but to keep simple things simple

Thus our design goals are:

 * Easy entry and exit from the fluent API with existing Cascading objects
 * Mirror the existing Cascading library as much as possible to minimize the number of concepts to be learned
 * Allow custom Cascading classes to have fluent APIs generated within any Cascading based project
 * Provide tools to allow for (more productive) higher order
 [internal DSLs](http://martinfowler.com/bliki/InternalDslStyle.html) to be created and distributed

The last point is important. Fluid is not meant to compete with [Scalding](http://www.cascading.org/projects/scalding/)
and [Cascalog](http://www.cascading.org/projects/cascalog/), but should allow users
who wish to stay in Java-land the opportunity to use a self guiding API and/or craft special purpose APIs for
particular needs.

Code generation is possible because Cascading has a clear uniform convention to how Pipe and Operation classes are
defined, and through the Java `ConstructorProperties` Annotation set on every core object constructors. This
includes `SubAssemblies` which are treated as regular Pipes, and thus are chained.

In the near term, we hope to have a gradle plugin for generating APIs from existing code to be released with those
libraries.

In time we hope Fluid will provide a base for incorporating Java 8 lambdas.

## Reporting Issues

The best way to report an issue is to mail the
[mailing list](https://groups.google.com/forum/?fromgroups#!forum/cascading-user) with a clear description.

If verified as a potential issues, add a new test along with the expected result set and submit a pull request
on GitHub.

Failing that, feel free to open an [issue](https://github.com/Cascading/fluid/issues) on the
[Cascading/Fluid](https://github.com/Cascading/fluid) project site.

## Developing

Fluid currently requires Gradle 1.11 to build.

Running:

    > gradle idea

from the root of the project will create all IntelliJ project and module files, and retrieve all dependencies.

Fluid is based on the open-source project [UnquietCode/Flapi](https://github.com/UnquietCode/Flapi).

## WIP Releases

Work in progress (WIP) code can be found on [GitHub](https://github.com/Cascading/fluid), under a branch named
`wip-x.y`. Final releases will be branches named `x.y`, for a given release version.

WIP builds, if available, can generally be found on conjars.org, see above, or:

  * http://www.cascading.org/wip/

Current wip Java docs can be found here:

  * http://docs.concurrentinc.com/fluid/1.0/javadoc/fluid-api/

## Notes

  * There currently are no builders for Tap or Scheme types
  * We plan to provide a gradle plugin for API generation in a future release
  * [Driven](http://www.cascading.org/driven/) does support applications built in Fluid

repository: Cascading/fluid

gha_language: Java

repo_name: Cascading/fluid


text:
# PimpleConsoleApplication

Extendable Pimple Console Application.

```bash
composer require glen/pimple-console-application
```

```php
# bin/console.php
<?php

use glen\PimpleConsoleApplication\PimpleConsoleApplication;

$app = new PimpleConsoleApplication();
$app->run();
```

repository: glensc/PimpleConsoleApplication

gha_language: PHP

repo_name: glensc/PimpleConsoleApplication


text:
# Frontend Mentor - Social media dashboard with theme switcher

This is a solution to the [Social media dashboard with theme switcher challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/social-media-dashboard-with-theme-switcher-6oY8ozp_H).

## Table of contents

- [Overview](#overview)
  - [The challenge](#the-challenge)
  - [Screenshot](#screenshot)
  - [Links](#links)
- [My process](#my-process)
  - [Built with](#built-with)
  - [What I learned](#what-i-learned)
  - [Useful resources](#useful-resources)
- [Author](#author)

## Overview

### The challenge

Users should be able to:

- See hover states for interactive elements
- toggle between dark and light modes

### Screenshot

![screenshot](./src/images/screenshot.png)

### Links

- Solution URL: [github repo](https://github.com/raffaellavinzio/social-media-dashboard-with-theme-switcher)
- Live Site URL: [Netlify](https://social-media-dashboard-with-dark-light-themes.netlify.app/)

## My process

### Built with

- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- [React](https://reactjs.org/) - JS library
- [Gatsby](https://gatsbyjs.org/) - React framework
- [Styled Components](https://styled-components.com/)
- [rc-switch npm package](https://www.npmjs.com/package/rc-switch) - accessible UI switch component with easily customizable styles

### What I learned

To implement dark mode / light mode theme toggle with styled components, CSS variables and Context API in Gatbsy. I also discovered the rc-switch component.

### Useful resources

- [CSS for JavaScript Developers](https://css-for-js.dev/) - This course is just awesome!
- [A Complete Guide to Dark Mode on the Web](https://css-tricks.com/a-complete-guide-to-dark-mode-on-the-web/) - everything there is to know about dark mode
- [Turn Off the Lights With React Context API](https://www.codewithlinda.com/blog/dark-mode-with-react-context/) - simple approach using Context API.
- [Gradient Borders in CSS](https://css-tricks.com/gradient-borders-in-css/)

## Author

- Frontend Mentor - [@raffaellavinzio](https://www.frontendmentor.io/profile/raffaellavinzio)

branch_name: refs/heads/main


text:
# Kidnapped Vehicle project
## GitHub Repo
[CarND-Kidnapped-Vehicle-Project](https://github.com/QuantumCoherence/CarND-Kidnapped-Vehicle-Project)

This project was completed on Ubuntu 16.04.

For both github repo links, the ecbuild subfolder contains all ECLIPSE project files, including compiled binary.

The build subfolder contains all the binaries and the makefile for compiling the project at the prompt with no formal IDE.

**Compiling on your system: CMakelists.txt**

Use the CMakeLists.txt in the repo root folder to create the make file and compile on your system.

## Particle Filter Coding Notes

*Parameters and Performance*

Besides the need for a best guess initial state, the only tunable paramters are the number of particles used, which is set at 50 (below 40, the accuracy perfomance is negatively affected) and  the noise density for position and yaw angle.

The Resample algoirthm makes use of the discrete distribution random generator that comes standard with C++11. It simplifes the resampling algoirhtm, quite signficantly, but aslo might be a cause for lowered performance. The resample wheel algorithm discussed during Sebastian's class, is not exaclty uniformly distirbuted, , which seem to henance performace.
The noise simulation parameters for the yaw angle was increased to 0.04, those for X and Y to 0.32, for a better performance.
The filter achieves the goal within ~97 secs. The initial random distribution of the particles seems to have quite a significant impact.  In one occasion it failed by 0.06 seconds, and in one occasion ended by 81 seconds. System CPU time might be playing are role in these assymetric variations.

**Video**
Download in ziped form, gunzip and play.
[Kidnapped Vehicle](https://github.com/QuantumCoherence/CarND-Kidnapped-Vehicle-Project/blob/master/vokoscreen-2018-05-10_21-48-25.mkv.gz)


text:
# css-bingo
Every byte counts when creating good user experiences for mobile devices and slow networks. Don't let the browser do unnecessary work. css-bingo finds all extraneous rules and selectors in your CSS, not used in your html, and removes them.

[![Build Status](https://travis-ci.org/jonatanpedersen/css-bingo.svg?branch=master)](https://travis-ci.org/jonatanpedersen/css-bingo)
[![NPM Version](https://img.shields.io/npm/v/css-bingo.svg)](https://www.npmjs.com/package/css-bingo)
[![Coverage Status](https://coveralls.io/repos/github/jonatanpedersen/css-bingo/badge.svg)](https://coveralls.io/github/jonatanpedersen/css-bingo)

## Install
``` bash
$ npm install css-bingo
```

## Usage

``` javascript
const cssBingo = require('css-bingo');

const css = '.foo{color:#fff;}.bar{color:#000;}#baz{color:777}';
const html = '<br class="foo" />';

console.log(cssBingo(css, html));
// .foo{color:#fff;}
```

There are no options.

## Selectors

### Supported
Rules with supported selectors will be removed when the selector is not found in the provided html.

| Selector | Example |
| --- | --- |
| [*](http://www.w3schools.com/cssref/sel_all.asp) | * |
| [.class](http://www.w3schools.com/cssref/sel_class.asp) | .foo |
| [.class.class](http://www.w3schools.com/cssref/sel_class.asp) | .foo.bar |
| [#id](http://www.w3schools.com/cssref/sel_id.asp) | #baz |
| [#id.class](http://www.w3schools.com/cssref/sel_id.asp) | #baz.foo |
| [element](http://www.w3schools.com/cssref/sel_element.asp) | p |
| [element.class](http://www.w3schools.com/cssref/sel_element.asp) | p.foo |
| [element,element](http://www.w3schools.com/cssref/sel_element_comma.asp) | div, p |
| [element element](http://www.w3schools.com/cssref/sel_element_element.asp) | div p |
| [element>element](http://www.w3schools.com/cssref/sel_element_gt.asp) | div > p |
| [element+element](http://www.w3schools.com/cssref/sel_element_pluss.asp) | div + p |
| [element~element](http://www.w3schools.com/cssref/sel_gen_sibling.asp) | p ~ ul |

class names in both the class and the data-class attribute of html elements will be used.

``` html
<html>
    <body>
        <h1 class="foo" data-class="bar">Heading 1</h1>
    </body>
</html>
```

### Unsupported
Element attributes, pseudo classes and pseudo elements of selectors are ignored when matching elements to selectors.

| Selector | Example |
| --- | --- |
| [[attribute]](http://www.w3schools.com/cssref/sel_attribute.asp) | [target] |
| [[attribute=value]](http://www.w3schools.com/cssref/sel_attribute_value.asp) | [target=_blank] |
| [[attribute~=value]](http://www.w3schools.com/cssref/sel_attribute_value_contains.asp) | [title~=flower] |
| [[attribute\|=value]](http://www.w3schools.com/cssref/sel_attribute_value_lang.asp) | [lang|=en] |
| [[attribute^=value]](http://www.w3schools.com/cssref/sel_attr_begin.asp) | a[href^="https"] |
| [[attribute$=value]](http://www.w3schools.com/cssref/sel_attr_end.asp) | a[href$=".pdf"] |
| [[attribute*=value]](http://www.w3schools.com/cssref/sel_attr_contain.asp) | a[href*="w3schools"] |
| [:active](http://www.w3schools.com/cssref/sel_active.asp) | a:active |
| [::after](http://www.w3schools.com/cssref/sel_after.asp) | p::after |
| [::before](http://www.w3schools.com/cssref/sel_before.asp) | p::before |
| [:checked](http://www.w3schools.com/cssref/sel_checked.asp) | input:checked |
| [:disabled](http://www.w3schools.com/cssref/sel_disabled.asp) | input:disabled |
| [:empty](http://www.w3schools.com/cssref/sel_empty.asp) | p:empty |
| [:enabled](http://www.w3schools.com/cssref/sel_enabled.asp) | input:enabled |
| [:first-child](http://www.w3schools.com/cssref/sel_firstchild.asp) | p:first-child |
| [::first-letter](http://www.w3schools.com/cssref/sel_firstletter.asp) | p::first-letter |
| [::first-line](http://www.w3schools.com/cssref/sel_firstline.asp) | p::first-line |
| [:first-of-type](http://www.w3schools.com/cssref/sel_first-of-type.asp) | p:first-of-type |
| [:focus](http://www.w3schools.com/cssref/sel_focus.asp) | input:focus |
| [:hover](http://www.w3schools.com/cssref/sel_hover.asp) | a:hover |
| [:in-range](http://www.w3schools.com/cssref/sel_in-range.asp) | input:in-range |
| [:invalid](http://www.w3schools.com/cssref/sel_invalid.asp) | input:invalid |
| [:lang(language)](http://www.w3schools.com/cssref/sel_lang.asp) | p:lang(it) |
| [:last-child](http://www.w3schools.com/cssref/sel_last-child.asp) | p:last-child |
| [:last-of-type](http://www.w3schools.com/cssref/sel_last-of-type.asp) | p:last-of-type |
| [:link](http://www.w3schools.com/cssref/sel_link.asp) | a:link |
| [:not(selector)](http://www.w3schools.com/cssref/sel_not.asp) | :not(p) |
| [:nth-child(n)](http://www.w3schools.com/cssref/sel_nth-child.asp) | p:nth-child(2) |
| [:nth-last-child(n)](http://www.w3schools.com/cssref/sel_nth-last-child.asp) | p:nth-last-child(2) |
| [:nth-last-of-type(n)](http://www.w3schools.com/cssref/sel_nth-last-of-type.asp) | p:nth-last-of-type(2) |
| [:nth-of-type(n)](http://www.w3schools.com/cssref/sel_nth-of-type.asp) | p:nth-of-type(2) |
| [:only-of-type](http://www.w3schools.com/cssref/sel_only-of-type.asp) | p:only-of-type |
| [:only-child](http://www.w3schools.com/cssref/sel_only-child.asp) | p:only-child |
| [:optional](http://www.w3schools.com/cssref/sel_optional.asp) | input:optional |
| [:out-of-range](http://www.w3schools.com/cssref/sel_out-of-range.asp) | input:out-of-range |
| [:read-only](http://www.w3schools.com/cssref/sel_read-only.asp) | input:read-only |
| [:read-write](http://www.w3schools.com/cssref/sel_read-write.asp) | input:read-write |
| [:required](http://www.w3schools.com/cssref/sel_required.asp) | input:required |
| [:root](http://www.w3schools.com/cssref/sel_root.asp) | :root |
| [::selection](http://www.w3schools.com/cssref/sel_selection.asp) | ::selection |
| [:target](http://www.w3schools.com/cssref/sel_target.asp) | #news:target |
| [:valid](http://www.w3schools.com/cssref/sel_valid.asp) | input:valid |
| [:visited](http://www.w3schools.com/cssref/sel_visited.asp) | a:visited |

#### element-attributes
Element Attributes are ignored.

| css | html | output |
|---|---|---|
| `input[type=text]{color:#c00;}` | `<input type="text"/>` | `input[type=text]{color:#c00;}` |
| `input[type=text]{color:#c00;}` | `<input type="password"/>` | `input[type=text]{color:#c00;}` |
| `input[type=text]{color:#c00;}` | `<button></button>` | |

#### pseudo-classes
Pseudo Classes are ignored.

| css | html | output |
|---|---|---|
| `button:hover{color:#c00;}` | `<button></button>` | `button:hover{color:#c00;}` |
| `button:hover{color:#c00;}` | `<input />` |  |

#### pseudo-elements
Pseudo Elements are ignored.

| css | html | output |
|---|---|---|
| `p::first-letter{color:#c00;}` | `<p>foo bar</p>` | `p::first-letter{color:#c00;}` |
| `p::first-letter{color:#c00;}` | `<p></p>` | `p::first-letter{color:#c00;}` |
| `p::first-letter{color:#c00;}` | `<ul><li>foo></li><li>bar</li></ul>` |  |

## Performance
1000 test runs on a 2.7 GHz Intel Core i5 MacBook Pro (early 2015) using unprocessed css and html from [debitoor](https://debitoor.com/).

| Library | Duration |
| --- | --- |
| css-bingo | 65s |
| [purify-css](https://github.com/purifycss/purifycss) | 118s |

## Background
We are using css-bingo in [nocms](https://github.com/debitoor/nocms) that we use to build our static websites [@debitoor](https://debitoor.com).

There are 5-10 people working on our websites at any given time during the work day and each of them submit pull-requests that are then built by our build agents. While pull requests can be built in parallel, merges to master can not. It is therefore important that we have a fast and stable build process.

I built css-bingo because none of the existing libraries that I could find had the accuracy and performance that we needed.

## Contributing
Pull-requests are welcome. Check the issue list for something to do, or submit your own ideas. Performance improvements and bugfixes are always welcome.

Clone repository:

``` bash
$ git clone git@github.com:jonatanpedersen/css-bingo.git
```

Install dependencies:

``` bash
$ npm install
```

### Test
[mocha](https://github.com/mochajs/mocha) is used to describe and run tests.

Run tests:
``` bash
$ npm test
```

Functional tests are described in `./test/tests.json`.

### Debugging
[debug](https://github.com/visionmedia/debug) is used with the namespace `css-bingo`. Enable debugging by setting the DEBUG environment variable `DEBUG=css-bingo`.

``` bash
Sat, 04 Feb 2017 22:24:42 GMT css-bingo removed rule: { type: 'rule', selectors: [], declarations: [ { type: 'declaration', property: 'color', value: 'red', position: Position { start: { line: 1, column: 22 }, end: { line: 1, column: 31 }, source: undefined } } ], position: Position { start: { line: 1, column: 17 }, end: { line: 1, column: 33 }, source: undefined } }
```

### Coverage
[istanbul](https://github.com/gotwarlost/istanbul) and [mocha](https://github.com/mochajs/mocha) are used to capture coverage data.

Run coverage:
``` bash
$ npm run cover
```

Coverage data is written to `./coverage/` and a html report is written to `./coverage/lcov-report/index.html`.

### Continuous Integration
All pull requests and commits are built for the latest versions of node 4, 5, 6 and 7 by [travis-ci](https://travis-ci.org/), and coverage is reported to [coveralls.io](https://travis-ci.org/).

## Licence
The MIT License (MIT)

Copyright (c) 2017 [Jonatan Pedersen](https://www.jonatanpedersen.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

repository: jonatanpedersen/css-bingo

repo_name: jonatanpedersen/css-bingo


text:
# Just an NBDEV tutorial

> capability demo

```python
%load_ext autoreload
%autoreload 2
```

This file will become your README and also the index of your documentation.

### Install

`pip install nbdev_tmp`

### say hi func

Fill me in please! Don't forget code examples:

```python
say_hi('Avi')
```

    'Hello Avi :)'

gha_language: Jupyter Notebook


text:
music fiddle
============

_The jsfiddle for music_

An open source way to share music online in a simple and quick way, being able to record with multitracks at the same time and share it without even being logged in.

The key here is the HTML5 Audio API.

####Proof of concept (STILL IN PROGRESS)

* You will be able to record untill 5 mins., and that will be recorded in the cloud with the link available for anyone to listen to it.
* The server will have a limited space so we will delete the unseenests tracks in the db.
* After you share it, the other person is able to EDIT your track, so this app needs to support multitracking.

####What do we use?

The UI is hosted on GitHub pages. AngularJS, AngularUI (BootstrapUI and UIRoute), less, grunt, ...

The API is hosted on ???. NodeJS (or Scala?)

Under the MIT Liscence.

repository: farolfo/music-fiddle

repo_name: farolfo/music-fiddle


text:
# happiness-scss

![npm](https://img.shields.io/badge/node-6.3.1-yellow.svg)
[![license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/dutchenkoOleg/gulp-happiness/blob/master/LICENSE)
[![Dependencies](https://www.versioneye.com/user/projects/592e84d1c0295d003a53fce3/badge.svg?style=flat)](https://www.versioneye.com/user/projects/592e84d1c0295d003a53fce3?child=summary)
[![Build Status](https://travis-ci.org/dutchenkoOleg/happiness-scss.svg?branch=master)](https://travis-ci.org/dutchenkoOleg/gulp-happiness)

> ___One Style You Might Like___
> ___It is already here ;)___

[![js happiness style](https://cdn.rawgit.com/JedWatson/happiness/master/badge.svg)](https://github.com/JedWatson/happiness)
[![Happiness SCSS Style](https://cdn.rawgit.com/dutchenkoOleg/happiness-scss/master/badge.svg)](https://github.com/dutchenkoOleg/happiness-scss)

> It is called _happiness_, because we hope that it brings you joy, love and ends strife among your fellow developers.
>
> **Reminder:** Happiness is not for everyone. Some people will choose to be sad, normal and some might even say ~~"standard"~~ "[Sass Guidelines](https://sass-guidelin.es/)". That is alright. A happy person is comfortable with being them and fine to let others be who they want to be. "_You do you_"
>
> _© [happiness](https://github.com/JedWatson/happiness)_

Don't worry about that it's called SCSS
Since this works on [Sass Lint](https://www.npmjs.com/package/sass-lint), it will also work well with your `*.sass` files ;)
_It's has filename extension-based syntax detection._

---

## CLI install and usage

The easiest way to use Happiness SCSS Style to check your code is to install it globally as a Node command line program. To do so, simply run the following command in your terminal (flag -g installs `happiness-scss` globally on your system, omit it if you want to install in the current working directory):

```shell
npm i -g happiness-scss
# or using yarn cli
yarn global add happiness-scss
```

After you've done that you should be able to use the `happiness-scss` program. The simplest use case would be checking the style of all files in the current working directory and inner (`./**/*.s+(a|c)ss`),
_**NOTE!** it's always ignore `./node_modules/**`:_

```shell
happiness-scss

./test/fixtures/function-name-format.scss
  5:11  error  Function 'camelCase' should be written in lowercase with hyphens  function-name-format

✖ 1 problem (1 error, 0 warnings)

```

Or you can say where it should lint

```shell
happiness-scss "./test/**/*.scss"

# look for .scss and .sass files
happiness-scss "./test/**/*.s+(a|c)ss"
```

### CLI Options

##### `-h, --help`

Outputs usage information for the CLI

##### `-f, --format [format]`

Default formatter `stylish`

Your also can choose one of the available [Eslint formats](https://github.com/eslint/eslint/tree/master/lib/formatters) to format the output of sass-lint results

```shell
happiness-scss -f table
```

##### `-i, --ignore [pattern]`

Default ignore path `./node_modules/**`

A pattern that should be ignored from linting. Multiple patterns can be used by separating each pattern by `,`. Patterns should be wrapped in double quotes (will be merged with other ignore options)

```shell
happiness-scss -i "./test/fixtures/function-name-format.scss"
```

```shell
# more than one path
happiness-scss -i "./test/**, ./dev/wip/**"
```

##### `-o, --output [output]`

The path plus file name relative to where `happiness-scss` is being run from where the output should be written to.

```shell
# json
happiness-scss -f json -o "./tmp/lint-results.json"

# html
happiness-scss -f html -o "./tmp/lint-results.html"
```

##### `-m, --show-max-stack [number]`

This will be useful for a huge list of errors when they do not even fit in the console. It will print max errors in console.
See example [`Nodejs Api → happinessScss.lintFileText() → config.showMaxStack`](#configshowmaxstack).

```shell
# max 100 errors will be printed, `-q` not to fall
happiness-scss -m 100 -q
```

##### `-q, --no-exit`

Prevents the CLI from throwing an error if there is one (useful for development work)

##### `-d, --no-disabling`

[Disabling linters via source](#disabling-linters-via-source) will not work.
Yeah, only hard core!

##### `-V, --version`

Outputs the version number of Happiness SCSS

---

## Nodejs API

Install `happiness-scss` in your project

```shell
npm i --save happiness-scss
# or using yarn cli
yarn add happiness-scss
```

#### ~~happinessScss.lintText(file, config, cb)~~

***removed!***, doing same as `.lintFileText()`

#### happinessScss.lintFileText(file, config, cb)

Handles ignored files for plugins such as the gulp plugin. Checks every file passed to it against the ignores as specified in users config or passed in default config.

_Parameters:_

Name | Data type | Attributes | Description
 --- | --- | --- | ---
 `file` | `Object` |  | object, see example below
 `config` | `Object` | \<optional> | little configuration, see example below
 `cb` | `function` | \<optional> | see description below

##### `file`

This must be an object with following properties:

- text (string) - content for checking
- format (string) - syntax definition
- filename (string) - name of checking file with relative path

_Example:_

```js
let testFilePath = './fixtures/hex-notation.scss';
let testFile = {
	text: fs.readFileSync(testFilePath).toString(),
	format: path.extname(testFilePath).replace('.', ''), // scss
	filename: testFilePath
};

happinessScss.lintFileText(testFile);
```

##### `config`

Here you can set few parameters
```js
const myConfig = {
	formatter: 'stylish',
	showMaxStack: 50, // if 0 is unlimited, see description below
	outputFile: './path/to/output.file',
	noDisabling: false // if true -> "Disabling linters via source" will not work
	ignore: [ // must be an Array
		'./sass/vendor/**/*.scss',
		'./sass/test/**/*.scss'
		// Note! './node_modules/**' is always in ignore
	]
};
```

###### `config.showMaxStack`

Default value `0`.

This parameter will be useful for a huge list of errors when they do not even fit in the console. It will print max errors in console.

_Example if set `showMaxStack: 10`_

```shell
C:/Wezom/NodeModules/happiness-scss/tmp/huge.scss
  1:0   error  line 1 exceeds the maximum line length of 120  max-line-length
  1:1   error  Single line statements are not allowed         brace-style
  1:1   error  Space expected between blocks                  empty-line-between-blocks
  1:9   error  Commas should be followed by a space           space-after-comma
  1:10  error  Selectors must be placed on new lines          single-line-per-selector
  1:20  error  Commas should be followed by a space           space-after-comma
  1:21  error  Selectors must be placed on new lines          single-line-per-selector
  1:31  error  Combinators are not allowed                    no-combinators
  1:40  error  Whitespace required before {                   space-before-brace
  1:48  error  Space expected after `:`                       space-after-colon

✖ 10 problems (10 errors, 0 warnings)

        NOTE! Showed maximum 10 errors for each result
        and 8123 errors was not printed in console

```

_**Note!** This option is available only for `.format()` method in nodejs API_

##### `cb(err, data)`

Callback for handing errors or resulting data.
_Example_

```js
const fs = require('fs');
const path = require('path');
const happinessScss = require('happiness-scss');

const testFile = fs.readFileSync(path.join(__dirname, './fixtures/no-ids.scss'));

happinessScss.lintText(testFile, null, function(err, data) {
	if (err) {
		// handle errors
	}
	// handle data
});
```

#### happinessScss.lintFiles(files, config, cb)

Takes a glob pattern or target string and creates an array of files as targets for linting taking into account any user specified

_Parameters:_

Name | Data type | Attributes | Description
 --- | --- | --- | ---
 `files` | `string` |  | a glob pattern or single file path as a lint target
 `config` | `Object` | \<optional> | little configuration, see example in [happinessScss.lintFileText() → config](#config)
 `cb` | `function` | \<optional> | see description in [happinessScss.lintFileText() → cb(err, data)](#cberr-data)

###### Live example of usage

```js
const path = require('path');
const happinessScss = require('happiness-scss');

function pathTo (glob) {
	return path.join(__dirname, glob);
}

happinessScss.lintFiles(pathTo('./fixtures/**.scss'),  {
	ignore: [
		pathTo('./fixtures/hex-notation.scss')
	]
}, function(err, data) {
	if (err) {
		throw new Error(err);
	}

	if (data.errorCount.count) {
		let formatted = happinessScss.format(data.results, {
			formatter: 'table',
			showMaxStack: 50
		});

		console.log(formatted);

		happinessScss.outputResults(data.results, {
			formatter: 'html',
			outputFile: pathTo('../tmp/lint-files-output.html')
		});
	}
});
```

#### errorCount(results)

Parses results object to count errors and return paths to files with detected errors.
_Returns errors object containing the error count and paths for files incl. errors_

#### warningCount(results)

Parses results object to count warnings and return paths to files with detected warnings.
_Returns warnings object containing the error count and paths for files incl. warnings_

#### resultCount(results)

Parses results object to count warnings and errors and return a cumulative count of both
_Returns the cumulative count (`number`) of errors and warnings detected_

#### format (results, config)

Handles formatting of results using EsLint formatters

- see [Live example of usage](#live-example-of-usage)
- see [happinessScss.lintText → config](#config)

_Returns results in the specified format as string. Use console.log(formattedResult) for showing in console_

#### outputResults (results, config)

Handles outputting results whether this be straight to the console/stdout or to a file. Passes results to the format function to ensure results are output in the chosen format

- see [Live example of usage](#live-example-of-usage)
- see [happinessScss.lintText → config](#config)

#### failOnError (results, config)

Throws an error if there are any errors detected. The error includes a count of all errors and a list of all files that include errors.

_No returns value. Just scream if has errors ;)_

---

## Rules

Please read [docs / Rules](https://github.com/dutchenkoOleg/happiness-scss/blob/master/docs/Rules.md)

## I disagree with rule X, can you change it?

No. The whole point of `happiness-scss` is to save you time by avoiding [bikeshedding](https://www.freebsd.org/doc/en/books/faq/misc.html#bikeshed-painting) about code style. There are lots of debates online about tabs vs. spaces, etc. that will never be resolved. These debates just distract from getting stuff done. At the end of the day you have to 'just pick something', and that's the whole philosophy of `happiness-scss` - its a bunch of sensible 'just pick something' opinions. Hopefully, users see the value in that over defending their own opinions.

> **Pro tip:** Just use `happiness-scss` and move on.
> There are actual real problems that you could spend your time solving! ;)

---

## Why should I use Happiness SCSS Style?

> If you do not want to, do not use it. And be happy without it ;)

In defense of `happiness-scss` it is better to quote part of the description from the [standardjs.com](https://standardjs.com/index.html#why-should-i-use-javascript-standard-style)

> The beauty of ~~JavaScript Standard~~ Happiness SCSS is that it's simple. No one wants to maintain multiple hundred-line style configuration files for every module/project they work on. Enough of this madness!

\- no `.sass-lint.yml` and other config files
\- no sasslint configs in `package.json`
\- no `.sassignore.rc` files
\- forget about tone of configs

Only rock-n-roll and _happiness-scss_

---

## Disabling Linters via Source

Happiness SCSS works on [Sass Lint](https://www.npmjs.com/package/sass-lint), so you can use special comments to disable and enable certain rules throughout your source files in a variety of scenarios.

_**Note!** This comments may be ignored on linting process by [CLI](#-d---no-disabling) and [Nodejs API](#config) for strict checkout!_

Below are examples of how to use this feature:

#### Disable a rule for the entire file

```scss
// sass-lint:disable border-zero
p {
  border: none; // No lint reported
}
```

#### Disable more than 1 rule

```scss
// sass-lint:disable border-zero, quotes
p {
  border: none; // No lint reported
  content: "hello"; // No lint reported
}
```

#### Disable a rule for a single line

```scss
p {
  border: none; // sass-lint:disable-line border-zero
}
```

#### Disable all lints within a block (and all contained blocks)

```scss
p {
  // sass-lint:disable-block border-zero
  border: none; // No result reported
}

a {
  border: none; // Failing result reported
}
```

#### Disable and enable again

```scss
// sass-lint:disable border-zero
p {
  border: none; // No result reported
}
// sass-lint:enable border-zero

a {
  border: none; // Failing result reported
}
```

#### Disable/enable all linters

```scss
// sass-lint:disable-all
p {
  border: none; // No result reported
}
// sass-lint:enable-all

a {
  border: none; // Failing result reported
}
```

---

## Is there a readme badge?

Yes! If you use `happiness-scss` in your project, you can include one of these badges in your readme to let people know that your code is using the `happiness-scss` style.

[![Happiness SCSS Style](https://cdn.rawgit.com/dutchenkoOleg/happiness-scss/master/badge.svg)](https://github.com/dutchenkoOleg/happiness-scss)

```markdown
[![Happiness SCSS Style](https://cdn.rawgit.com/dutchenkoOleg/happiness-scss/master/badge.svg)](https://github.com/dutchenkoOleg/happiness-scss)
```

[![Happiness SCSS Style](https://img.shields.io/badge/code_style-happiness--scss-blue.svg)](https://github.com/dutchenkoOleg/happiness-scss)

```markdown
[![Happiness SCSS Style](https://img.shields.io/badge/code_style-happiness--scss-blue.svg)](https://github.com/dutchenkoOleg/happiness-scss)
```

### Is there an automatic formatter?

Sorry, there no automatic formatter.

---

## Task Runner Integration

- [gulp-happiness-scss](https://www.npmjs.com/package/gulp-happiness-scss)

## TextEditor/IDE Integration

Already available solutions

- [docs / Integration with IntelliJ IDEA](https://github.com/dutchenkoOleg/happiness-scss/blob/master/docs/Integration-with-IntelliJ-IDEA.md)

Also we have [opened issue](https://github.com/dutchenkoOleg/happiness-scss/issues/3) for wanted list.

---

## Tests

1. `npm test` for testing js and scss code style
1. `npm run happiness-fix` for automatically fix most of problems with **js code style**

## Changelog

Please read [CHANGELOG.md](https://github.com/dutchenkoOleg/happiness-scss/blob/master/CHANGELOG.md)

## Contributing

Please read [CONTRIBUTING.md](https://github.com/dutchenkoOleg/happiness-scss/blob/master/CONTRIBUTING.md)

## Code of Conduct

Please read [CODE_OF_CONDUCT.md](https://github.com/dutchenkoOleg/happiness-scss/blob/master/CODE_OF_CONDUCT.md)

repository: OlehDutchenko/happiness-scss

repo_name: OlehDutchenko/happiness-scss


text:
# .NET for Spark Streaming Sample

This sample showcases streaming in .NET for Apache Spark. This app was built for Ubuntu, but should work cross-platform. For convenience, scripts have been created to build and run the application. You can run the commands inside the scripts by entering into the terminal respective to your OS.

## Build the application

```bash
./publish.sh
```

## Run the application

Open a terminal and start netcat

```bash
nc -lp 9000
```

Then, run `run.sh`

```bash
./run.sh
```

In the netcat window, try entering these values, each followed by `Enter`.

```bash
A
B
C
```

repository: luisquintanilla/Presentations

repo_name: luisquintanilla/Presentations


text:
---
title: Delete Certificate | Voyager
menu:
  product_voyager_6.0.0:
    identifier: delete-certificate
    name: Delete
    parent: certificate-guides
    weight: 20
product_name: voyager
menu_name: product_voyager_6.0.0
section_menu_id: guides
---
> New to Voyager? Please start [here](/docs/concepts/overview.md).

# Deleting Certificate

Deleting a Kubernetes `Certificate` object will only delete the certificate CRD from Kubernetes.
It will not delete the obtained certificate and user account secret from Kubernetes. User have to manually delete these secrets for complete cleanup.

 - Delete Certificate crd.

```console
kubectl delete certificate.voyager.appscode.com test-cert
```

 - Delete Obtained Let's Encrypt tls certificate

```console
kubectl delete secret tls-test-cert
```

 - Delete Let's Encrypt user account `Secret`

```console
kubectl delete secret test-user-secret
```

repository: Zhuvikin/voyager

repo_name: Zhuvikin/voyager


text:
# Use Cases

Okay, so how exactly can this service help you improve your life? If you'd like an *unofficial* guide on how to use Beeminder, here are a few easy examples to get you started:

*   **Want to be more productive?**
    *   Track your screen-time with an app like [RescueTime][1] and add a Beeminder goal to limit the amount of distracting time you spend online per day.
    *   Track your to-dos with an app like [Todoist][2] and add a Beeminder goal to get one task done per day.
*   **Want to be more healthy?**
    *   Track your movement with an app like [Garmin][3] and add a Beeminder goal to aim for a certain amount of steps per day.
    *   Track what you eat with an app like [Fitbit][4] and add a Beeminder goal to limit your daily calorie intake.
*   **Want to learn a new language?**
    *   Track your progress on an app like [Duolingo][5] and add a Beeminder goal to aim for a certain amount of XP points per day.

Also, be sure to check out the [**Featured**][6] page and integrations below for even more examples!

[1]: https://www.beeminder.com/rescuetime

[2]: https://www.beeminder.com/todoist

[3]: https://www.beeminder.com/garmin

[4]: https://www.beeminder.com/fitbit

[5]: https://www.beeminder.com/duolingo

[6]: https://www.beeminder.com/featured

repository: narthur/beeminder-wiki

repo_name: narthur/beeminder-wiki


text:
# lnurl-node

[![Build Status](https://travis-ci.org/chill117/lnurl-node.svg?branch=master)](https://travis-ci.org/chill117/lnurl-node)

Node.js implementation of [lnurl](https://github.com/btcontract/lnurl-rfc).

* [Installation](#installation)
* [Subprotocols](#subprotocols)
  * [channelRequest](#channelRequest)
  * [login](#login)
  * [payRequest](#payRequest)
  * [withdrawRequest](#withdrawRequest)
* [Command-line interface](#command-line-interface)
  * [Help menu](#help-menu)
  * [Encoding a URL](#encoding-a-url)
  * [Decoding an lnurl-encoded string](#decoding-an-lnurl-encoded-string)
  * [Generating a new API key](#generating-a-new-api-key)
  * [Running an lnurl server](#running-an-lnurl-server)
  * [Generate a new URL](#generate-a-new-url)
* [API](#api)
  * [encode](#encode)
  * [decode](#decode)
  * [createServer](#createServer)
    * [options](#options-for-createserver-method)
    * [Lightning Backend Configuration Options](#lightning-backend-configuration-options)
    * [Custom Lightning Backend](#custom-lightning-backend)
  * [generateApiKey](#generateapikey)
* [Hooks](#hooks)
  * [Login Hook](#login-hook)
  * [Middleware Hooks](#middleware-hooks)
    * [middleware:signedLnurl:afterCheckSignature](#middlewaresignedLnurlafterCheckSignature)
* [Signed LNURLs](#signed-lnurls)
  * [Shorter Signed LNURLs](#shorter-signed-lnurls)
    * [Subprotocol Short Names](#subprotocol-short-names)
    * [Query Parameter Short Names](#query-parameter-short-names)
    * [E-notation for number values](#e-notation-for-number-values)
    * [Set a shorter endpoint path](#set-a-shorter-endpoint-path)
* [Configuring Data Store](#configuring-data-store)
  * [Redis](#redis)
  * [SQLite](#sqlite)
  * [MySQL](#mysql)
  * [PostgreSQL](#postgresql)
* [Debugging](#debugging)
* [Tests](#tests)
* [Changelog](#changelog)
* [License](#license)
* [Funding](#funding)

## Installation

If you wish to use this module as a [CLI tool](#command-line-interface), install it globally via npm:
```
npm install -g lnurl
```

Add to your application via `npm`:
```
npm install lnurl --save
```
This will install `lnurl` and add it to your application's `package.json` file.

## Subprotocols

The lnurl specification defines a few possible "subprotocols" that client and server software can implement. The subprotocols that are supported are described here in this section.

Each subprotocol has two tables of parameters - server and client. The server parameters table details the parameters that you are required to provide when generating a new LNURL. The client parameters are to be provided by the user's wallet application during the process of executing the respective LNURL subprotocol.

### channelRequest

[specification](https://github.com/btcontract/lnurl-rfc/blob/b14f570d7bc09e6860803139a614551d9fe9b4e0/lnurl-channel.md)

Allows a user to request that your service open a channel with their node.

Server parameters:

| name       | type             | notes         |
| ---------- | ---------------- | ------------- |
| `localAmt` | `integer` (sats) | > 0           |
| `pushAmt`  | `integer` (sats) | <= `localAmt` |

Client parameters:

| name       | type      | notes           |
| ---------- | --------- | --------------- |
| `remoteid` | `hex`     | node public key |
| `private`  | `boolean` | `0` or `1`      |

### login

[specification](https://github.com/btcontract/lnurl-rfc/blob/b14f570d7bc09e6860803139a614551d9fe9b4e0/lnurl-auth.md)

Allows a user to login/authorize with your service. This subprotocol does not require the Lightning Network, but instead uses what it calls "linking keys" to uniquely identify and authorize a user. Linking keys are derived from a combination of a hierarchical, deterministically generated private key (BIP 44) and your service's host (or domain name).

Server parameters:

_None_

Client parameters:

| name  | type  | notes                             |
| ------| ----- | --------------------------------- |
| `sig` | `hex` | `sign(k1, <private linking key>)` |
| `key` | `hex` | public linking key                |

### payRequest

[specification](https://github.com/btcontract/lnurl-rfc/blob/b14f570d7bc09e6860803139a614551d9fe9b4e0/lnurl-pay.md)

Users can pay your service via a static payment QR code.

Server parameters:

| name           | type              | notes            |
| -------------- | ----------------- | ---------------- |
| `minSendable`  | `integer` (msats) | > 0              |
| `maxSendable`  | `integer` (msats) | >= `minSendable` |
| `metadata`     | `string`          | stringified JSON |

Client parameters:

| name       | type              | notes                              |
| ---------- | ----------------- | ---------------------------------- |
| `amount`   | `integer` (msats) | >= `minSendable`, <= `maxSendable` |

### withdrawRequest

[specification](https://github.com/btcontract/lnurl-rfc/blob/b14f570d7bc09e6860803139a614551d9fe9b4e0/lnurl-withdraw.md)

Users can request a payment from your service.

Server parameters:

| name                 | type              | notes                |
| -------------------- | ----------------- | -------------------- |
| `minWithdrawable`    | `integer` (msats) | > 0                  |
| `maxWithdrawable`    | `integer` (msats) | >= `minWithdrawable` |
| `defaultDescription` | `string`          |                      |

Client parameters:

| name       | type      | notes                     |
| ---------- | --------- | ------------------------- |
| `pr`       | `string`  | lightning payment request |

* Note that `pr` can contain multiple payment requests (separated by commas)

## Command-line interface

This section assumes that you have `lnurl` installed globally and that it is available on your current user's PATH.

### Help menu

To view the help screen for the CLI tool:
```bash
lnurl --help
```

### Encoding a URL

Encode a URL:
```bash
lnurl encode "https://service.com/api?q=3fc3645b439ce8e7f2553a69e5267081d96dcd340693afabe04be7b0ccd178df"
```
Expected output:
```
lnurl1dp68gurn8ghj7um9wfmxjcm99e3k7mf0v9cxj0m385ekvcenxc6r2c35xvukxefcv5mkvv34x5ekzd3ev56nyd3hxqurzepexejxxepnxscrvwfnv9nxzcn9xq6xyefhvgcxxcmyxymnserxfq5fns
```
This command also accepts piped input. For example:
```bash
echo -n "https://service.com/api?q=3fc3645b439ce8e7f2553a69e5267081d96dcd340693afabe04be7b0ccd178df" \
	| lnurl encode
```

### Decoding an lnurl-encoded string

Decode an lnurl:
```bash
lnurl decode "lnurl1dp68gurn8ghj7um9wfmxjcm99e3k7mf0v9cxj0m385ekvcenxc6r2c35xvukxefcv5mkvv34x5ekzd3ev56nyd3hxqurzepexejxxepnxscrvwfnv9nxzcn9xq6xyefhvgcxxcmyxymnserxfq5fns"
```
Expected output:
```
https://service.com/api?q=3fc3645b439ce8e7f2553a69e5267081d96dcd340693afabe04be7b0ccd178df
```
This command also accepts piped input. For example:
```bash
echo -n "lnurl1dp68gurn8ghj7um9wfmxjcm99e3k7mf0v9cxj0m385ekvcenxc6r2c35xvukxefcv5mkvv34x5ekzd3ev56nyd3hxqurzepexejxxepnxscrvwfnv9nxzcn9xq6xyefhvgcxxcmyxymnserxfq5fns" \
	| lnurl decode
```

### Generating a new API key

To generate a new API key for your lnurl server:
```bash
lnurl generateApiKey
```
Example output:
```json
{
	"id": "46f8cab814de07a8a65f",
	"key": "ee7678f6fa5ab9cf3aa23148ef06553edd858a09639b3687113a5d5cdb5a2a67"
}
```
For a list of available options:
```bash
lnurl generateApiKey --help
```

### Running an lnurl server

Start an lnurl application server:
```bash
lnurl server \
	--host "localhost" \
	--port "3000" \
	--auth.apiKeys '[{"id:"46f8cab814de07a8a65f","key":"ee7678f6fa5ab9cf3aa23148ef06553edd858a09639b3687113a5d5cdb5a2a67"}]' \
	--lightning.backend "lnd" \
	--lightning.config '{"hostname": "<IP_ADDRESS>:8080", "cert": "/path/to/tls.cert", "macaroon": "/path/to/admin.macaroon"}'
```
* To enable debugging messages, see the [Debugging](#debugging) section of this readme.
* By default the lnurl server stores data in memory - which is fine for development and testing. But once you plan to run it in production, it is recommended that you use a proper data store - see [Configuring Data Store](#configuring-data-store).
* To generate lnurls in a separate (or even offline) application see [Signed LNURLs](#signed-lnurls).
* To use a custom lightning backend with your server see [Custom Lightning Backend](#custom-lightning-backend).

Alternatively, a configuration file can be used:
```bash
lnurl server --configFile ./config.json
```

To print all available options for the server command:
```bash
lnurl server --help
```

### Generate a new URL

To generate a new lnurl that a client application can then consume:

```bash
lnurl generateNewUrl \
	--host "localhost" \
	--port "3000" \
	--protocol "http" \
	--endpoint "/lnurl" \
	--store.backend "knex" \
	--store.config '{"client":"postgres","connection":{"host":"<IP_ADDRESS>","user":"postgres","password":"example","database":"lnurl_example"}}' \
	--tag "withdrawRequest" \
	--params '{"minWithdrawable":10000,"maxWithdrawable":10000,"defaultDescription":""}'
```
Alternatively, a configuration file can be used:
```bash
lnurl generateNewUrl \
	--configFile ./config.json \
	--tag "withdrawRequest" \
	--params '{"minWithdrawable":10000,"maxWithdrawable":10000,"defaultDescription":""}'
```
Example output:
```json
{
	"encoded": "lnurl1dp68gup69uhkcmmrv9kxsmmnwsarxvpsxqhkcmn4wfkr7ufavvexxvpk893rswpjxcmnvctyvgexzen9xvmkycnxv33rvdtrvy6xzv3ex43xzve5vvexgwfj8yenxvm9xaskzdmpxuexywt9893nqvcly0lgs",
	"secret": "c2c069b882676adb2afe37bbfdb65ca4a295ba34c2d929333e7aa7a72b9e9c03",
	"url": "https://localhost:3000/lnurl?q=c2c069b882676adb2afe37bbfdb65ca4a295ba34c2d929333e7aa7a72b9e9c03"
}
```
For a list of available options:
```bash
lnurl generateNewUrl --help
```
It is also possible to generate lnurls in other ways:
* [generateNewUrl](#generateNewUrl) - API method
* [Signed LNURLs](#signed-lnurls) - For separate (or even offline) applications

## API

### encode

`encode(url)`

Encode a url as a bech32-encoded string.

Usage:
```js
const lnurl = require('lnurl');
const encoded = lnurl.encode('https://service.com/api?q=3fc3645b439ce8e7f2553a69e5267081d96dcd340693afabe04be7b0ccd178df');
console.log(encoded);
```

Expected output:
```json
"lnurl1dp68gurn8ghj7um9wfmxjcm99e3k7mf0v9cxj0m385ekvcenxc6r2c35xvukxefcv5mkvv34x5ekzd3ev56nyd3hxqurzepexejxxepnxscrvwfnv9nxzcn9xq6xyefhvgcxxcmyxymnserxfq5fns"
```

### decode

`decode(url)`

Decode a bech32-encoded lnurl.

Usage:
```js
const lnurl = require('lnurl');
const decoded = lnurl.decode('lnurl1dp68gurn8ghj7um9wfmxjcm99e3k7mf0v9cxj0m385ekvcenxc6r2c35xvukxefcv5mkvv34x5ekzd3ev56nyd3hxqurzepexejxxepnxscrvwfnv9nxzcn9xq6xyefhvgcxxcmyxymnserxfq5fns');
console.log(decoded);
```

Expected output:
```json
"https://service.com/api?q=3fc3645b439ce8e7f2553a69e5267081d96dcd340693afabe04be7b0ccd178df"
```

### createServer

`createServer([options])`

Create and initialize an instance of the lnurl server.

Usage:
```js
const lnurl = require('lnurl');
const server = lnurl.createServer({
	host: 'localhost',
	port: 3000,
	auth: {
		apiKeys: [
			{
				id: '46f8cab814de07a8a65f',
				key: 'ee7678f6fa5ab9cf3aa23148ef06553edd858a09639b3687113a5d5cdb5a2a67',
			},
		],
	},
	lightning: {
		backend: 'lnd',
		config: {
			hostname: '<IP_ADDRESS>:8080',
			cert: '/path/to/tls.cert',
			macaroon: '/path/to/admin.macaroon',
		},
	},
});
```
* To enable debugging messages, see the [Debugging](#debugging) section of this readme.
* By default the lnurl server stores data in memory - which is fine for development and testing. But once you plan to run it in production, it is recommended that you use a proper data store - see [Configuring Data Store](#configuring-data-store).
* To use a custom lightning backend with your server see [Custom Lightning Backend](#custom-lightning-backend).

#### Options for createServer method

```js
{
	// The host for the web server:
	host: 'localhost',
	// The port for the web server:
	port: 3000,
	// The protocol to use for the web server:
	protocol: 'https',
	// Whether or not to start listening when the server is created:
	listen: true,
	// The URL where the server is externally reachable (e.g "https://your-lnurl-server.com"):
	url: null,
	// The URI path of the web API end-point:
	endpoint: '/lnurl',
	auth: {
		// List of API keys that can be used to authorize privileged behaviors:
		apiKeys: [],
	},
	apiKey: {
		// Encoding for generated API keys ('hex', 'base64', etc):
		encoding: 'hex',
		numBytes: {
			// Number of random bytes for API key ID:
			id: 5,
			// Number of random bytes for API key secret:
			key: 32,
		},
	},
	/*
		Set equal to NULL to not configure LN backend at the server-wide level.
	*/
	lightning: {
		// Which LN backend to use (only lnd supported currently):
		backend: 'lnd',
		// The configuration object to connect to the LN backend:
		config: {
			// Defaults here depend on the LN backend used.
		},
		// Whether or not to create a mock instance of the LN backend.
		mock: false,
	},
	tls: {
		// The full file path to the TLS certificate:
		certPath: path.join(process.cwd(), 'tls.cert'),
		// The full file path to the TLS certificate key:
		keyPath: path.join(process.cwd(), 'tls.key'),
		// Whether to create TLS cert/key pair if does not already exist:
		generate: true,
		// Whether to self-sign the certificate:
		selfSigned: true,
		// The length of validity of the self-signed certificate:
		days: 3650,
	},
	store: {
		// Name of store backend ('knex', 'memory', 'redis'):
		backend: 'memory',
		// Configuration options to pass to store:
		config: {},
	},
}
```

#### Lightning Backend Configuration Options

This module supports lnd, eclair, and c-lightning as Lightning Network backends.

Configuration options for __lnd__ backend:
```js
{
	// ...
	lightning: {
		backend: 'lnd',
		config: {
			hostname: '<IP_ADDRESS>:8080',
			/*
				Can alternatively provide cert as Buffer or String:
					cert: { data: 'STRING_UTF8_ENCODED' },
					cert: { data: Buffer.from('STRING_UTF8_ENCODED', 'utf8') },
			*/
			cert: '/path/to/lnd/tls.cert',
			/*
				Can alternatively provide macaroon as Buffer or String:
					macaroon: { data: 'STRING_HEX_ENCODED' },
					macaroon: { data: Buffer.from('STRING_HEX_ENCODED', 'hex') },
			*/
			macaroon: '/path/to/lnd/admin.macaroon',
		},
	},
	// ...
}
```

Configuration options for __eclair__ backend:
```js
{
	// ...
	lightning: {
		backend: 'eclair',
		config: {
			hostname: '<IP_ADDRESS>:8080',
			password: 'API_PW_FOR_ECLAIR_NODE',
			protocol: 'http',
		},
	},
	// ...
}
```

Configuration options for __c-lightning__ backend:
```js
{
	// ...
	lightning: {
		backend: 'c-lightning',
		config: {
			nodeUri: 'PUBKEY@<IP_ADDRESS>:9735',
			socket: '/path/to/c-lightning/unix/sock',
		},
	},
	// ...
}
```

#### Custom Lightning Backend

It is possible to define your own custom lightning backend as follows:
```js
// ./backends/custom.js

const { LightningBackend } = require('lnurl');

class Backend extends LightningBackend {

	constructor(options) {
		super('custom', options, {
			defaultOptions: {
				nodeUri: null,
			},
			requiredOptions: ['nodeUri'],
		});
	}

	checkOptions(options) {
		// This is called by the constructor.
		// Throw an error if any problems are found with the given options.
	}

	getNodeUri() {
		return Promise.resolve(this.options.nodeUri);
	}

	openChannel(remoteId, localAmt, pushAmt, makePrivate) {
		return Promise.reject('Not implemented');
	}

	payInvoice(invoice) {
		return Promise.reject('Not implemented');
	}

	addInvoice(amount, extra) {
		return Promise.reject('Not implemented');
	}
}

module.exports = Backend;
```
And to use your new custom backend:
```js
const lnurl = require('lnurl');
const server = lnurl.createServer({
	lightning: {
		backend: {
			path: '/full/path/to/backends/custom.js',
		},
		config: {
			// Options to pass to your custom backend.
		},
	},
});
```

### generateNewUrl

`generateNewUrl(tag, params)`

To generate a new lnurl that a client application can then consume:
```js
server.generateNewUrl('channelRequest', {
	localAmt: 2000,
	pushAmt: 0
}).then(result => {
	const { encoded, secret, url } = result;
	console.log({ encoded, secret, url });
}).catch(error => {
	console.error(error);
});
```
Expected output:
```json
{
	"encoded": "lnurl1dp68gup69uhkcmmrv9kxsmmnwsarxvpsxqhkcmn4wfkr7ufavvexxvpk893rswpjxcmnvctyvgexzen9xvmkycnxv33rvdtrvy6xzv3ex43xzve5vvexgwfj8yenxvm9xaskzdmpxuexywt9893nqvcly0lgs",
	"secret": "c2c069b882676adb2afe37bbfdb65ca4a295ba34c2d929333e7aa7a72b9e9c03",
	"url": "https://localhost:3000/lnurl?q=c2c069b882676adb2afe37bbfdb65ca4a295ba34c2d929333e7aa7a72b9e9c03"
}
```
It is also possible to generate lnurls in other ways:
* [Generate a new URL](#generate-a-new-url) - CLI command
* [Signed LNURLs](#signed-lnurls) - For separate (or even offline) applications

### generateApiKey

`generateApiKey()`

Generate a new API key for your lnurl server.

Usage:
```js
const lnurl = require('lnurl');
const { id, key } = lnurl.generateApiKey();
console.log({ id, key });
````

Expected output:
```json
{
	"id": "46f8cab814de07a8a65f",
	"key": "ee7678f6fa5ab9cf3aa23148ef06553edd858a09639b3687113a5d5cdb5a2a67"
}
```
Available options:
```js
{
	encoding: 'hex',
	numBytes: {
		id: 5,
		key: 32
	}
}
```

## Hooks

It is possible to further customize your lnurl server by using hooks to run custom application code at key points in the server application flow.

### Login Hook

The lnurl-auth subprotocol allows users to login/authenticate with your service. You can use the login hook as shown here to execute your own custom code whenever there is a successful login/authentication attempt for your server.
```js
const lnurl = require('lnurl');
const server = lnurl.createServer();
server.bindToHook('login', function(key, next) {
	// This code is executed when the lnurl-auth checks have passed (e.g valid signature provided).
	// `key` is the public linking key which has just authenticated.
	// Fail the request by calling next with an error:
	next(new Error('Your custom error message'));
	// Or call next without any arguments to continue processing the request:
	next();
});
```

### Middleware Hooks

Special type of hook that allows you to add your own custom middleware functions to your lnurl server. The callback function you provide to this kind of hook is executed as [express middleware](https://expressjs.com/en/guide/using-middleware.html).

#### middleware:signedLnurl:afterCheckSignature

After a request has passed the signed-lnurl authorization signature check.

Example usage:
```js
const lnurl = require('lnurl');
const server = lnurl.createServer();
server.bindToHook('middleware:signedLnurl:afterCheckSignature', function(req, res, next) {
	// Your custom middleware.
	// It is possible to modify the req.query object, like this:
	req.query.extra = 'example changing the query object';
	// Fail the request by calling next with an error:
	next(new Error('Your custom error message'));
	// Or call next without any arguments to continue processing the request:
	next();
});
```

## Signed LNURLs

It is possible to generate new lnurls in a separate (or even offline) application. To do this you will first need an API key for the application that will do the signing - see [Generating a new API key](#generating-a-new-api-key).

See the script [signed-lnurls.js](https://github.com/chill117/lnurl-node/blob/master/examples/signed-lnurls.js) for an example of how to create signed LNURLs. The output of the script will be something like this:
```
https://your-lnurl-server.com/lnurl?id=5619b36a2e&n=1f69afb26c643302&tag=withdrawRequest&minWithdrawable=1000&maxWithdrawable=500000&s=7ef95168e1afa90834ec98b0ebe7a5dc93b4a7e7345d0a1f9e3be3caaebf8925
```
* `id` - the ID of the offline app's API key
* `n` - randomly generated nonce
* `s` - the signature created from the URL's querystring and the offline app's API key
* `tag` - the subprotocol to use
* `minWithdrawable` and `maxWithdrawable` - parameters that depend on which subprotocol being used

And the URL when encoded as a bech32-encoded string:
```
lnurl1dp68gurn8ghj77t0w4ez6mrww4excttnv4e8vetj9e3k7mf0d3h82unv8a5kg0f4xccnjc3nxesnyefxdc7nze3k89skvc3jxe3nvdpnxvcryfn5v9nn6amfw35xgunpwafx2ut4v4ehgfndd9h9w6t5dpj8ycthv93xcefaxycrqvpxd4shs4mfw35xgunpwaskymr9856nqvpsxqczvueaxajkvwf4xymrsef3v9nxzwfs8qengetr8yuxyvr9vfjnwcf4v33njvmzx3snwefhxv6r2epsvyckvwt9xd3x2vmrv9sk2cnx8qunydglm8pum
```

### Shorter Signed LNURLs

With more information contained in the LNURL, the resulting rendered QR code becomes more difficult for mobile applications to scan. To help with this, there are a few tricks that can reduce the length of your signed LNURLs.

#### Subprotocol Short Names

It is possible to shorten the subprotocol name:

| name              | shortened |
| ----------------- | --------- |
| `channelRequest`  | `c`       |
| `login`           | `l`       |
| `payRequest`      | `p`       |
| `withdrawRequest` | `w`       |

The following example:
```
tag=channelRequest&..
```
Can be shortened to:
```
tag=c&..
```

#### Query Parameter Short Names

| name    | shortened | notes                      |
| ------- | --------- | -------------------------- |
| `tag`   | `t`       | the subprotocol to be used |

The following example:
```
tag=channelRequest&..
```
Can be shortened to:
```
t=channelRequest&..
```

Parameters for "channelRequest":

| name       | shortened |
| ---------- | --------- |
| `localAmt` | `pl`      |
| `pushAmt`  | `pp`      |

The following example:
```
tag=channelRequest&localAmt=1000&pushAmt=1000
```
Can be shortened to:
```
t=c&pl=1000&pp=1000
```

Parameters for "login":

_None_

Parameters for "payRequest":

| name          | shortened |
| ------------- | --------- |
| `minSendable` | `pn`      |
| `maxSendable` | `px`      |
| `metadata`    | `pm`      |

The following example:
```
tag=payRequest&minSendable=100000&maxSendable=100000&metadata=%5B%5B%22text%2Fplain%22%2C%22example%20metadata%22%5D%5D
```
Can be shortened to:
```
t=p&pn=100000&px=100000&pm=%5B%5B%22text%2Fplain%22%2C%22example%20metadata%22%5D%5D
```

Parameters for "withdrawRequest":

| name                 | shortened |
| -------------------- | --------- |
| `minWithdrawable`    | `pn`      |
| `maxWithdrawable`    | `px`      |
| `defaultDescription` | `pd`      |

The following example:
```
tag=withdrawRequest&minWithdrawable=1000&maxWithdrawable=500000
```
Can be shortened to:
```
t=w&pn=1000&px=500000
```

#### E-notation for number values

It is possible to pass numbers in e-notation. For example:
```
pn=1000000&px=5000000
```
Can be shortened to:
```
pn=1e6&px=5e6
```

#### Set a shorter endpoint path

You can set a shorter path for your server's HTTPS end-point via the `endpoint` option:
```js
const lnurl = require('lnurl');
const server = lnurl.createServer({
	// ...
	endpoint: '/a',
	// ...
});
```
And then a signed LNURL could look something like this instead:
```
https://your-lnurl-server.com/a?id=5619b36a2e&n=e4b058f353d0bff5&t=w&pn=1&px=5e4&s=975b38202ac17430cb981c4987071f25685123750f4a7af9d9d87290c88e017e
```
Encoded as:
```
lnurl1dp68gurn8ghj77t0w4ez6mrww4excttnv4e8vetj9e3k7mf0vylkjepax5mrzwtzxvmxzvn9yehr6ef5vgcr2wrxxv6nxepsvfnxvdfxws7hwfnsdc7nzfns0q7n2ef5yeen6wfhx43rxwpjxqexzce3xu6rxvrrvgunsvtrxsunsdesxuckvv34xcur2vfjxvmn2vrxx3snwctx89jrjepcxuerjvrr8qux2vp3xajslvwjm7
```
Which is about __25%__ shorter than the original unshortened LNURL.

## Configuring Data Store

By default the lnurl server will store data in memory - which is not ideal for several reasons. It is strongly recommended that you configure a proper data store for your server. This module supports [Redis](#redis), [SQLite](#sqlite), [MySQL](#mysql), and [PostgreSQL](#postgresql).

### Redis

To use Redis as your data store you will need to install the [ioredis module](https://github.com/luin/ioredis) wherever you are running your lnurl server:
```bash
npm install ioredis
```
Then you can run your server via the API as follows:
```js
const lnurl = require('lnurl');
const server = lnurl.createServer({
	// ...
	store: {
		backend: 'redis',
		config: {
			prefix: 'lnurl:',
		},
	},
	// ...
});
```
Or via the CLI:
```bash
lnurl server \
	--store.backend="redis" \
	--store.config='{"prefix":"lnurl:"}'
```

### SQLite

To use SQLite as your data store you will need to install the [sqlite3 module](https://github.com/mapbox/node-sqlite3) and [knex](http://knexjs.org/) wherever you are running your lnurl server:
```bash
npm install knex sqlite3
```
Then you can run your server via the API as follows:
```js
const lnurl = require('lnurl');
const server = lnurl.createServer({
	// ...
	store: {
		backend: 'knex',
		config: {
			client: 'sqlite3',
			connection: {
				filename: './lnurl-server.sqlite3',
			},
		},
	},
	// ...
});
```
Or via the CLI:
```bash
lnurl server \
	--store.backend="knex" \
	--store.config='{"client":"sqlite3","connection":{"filename":"./lnurl-server.sqlite3"}}'
```

### MySQL

To use MySQL as your data store you will need to install the [mysql module](https://github.com/mysqljs/mysql) and [knex](http://knexjs.org/) wherever you are running your lnurl server:
```bash
npm install knex mysql
```
Then you can run your server via the API as follows:
```js
const lnurl = require('lnurl');
const server = lnurl.createServer({
	// ...
	store: {
		backend: 'knex',
		config: {
			client: 'mysql',
			connection: {
				host: '<IP_ADDRESS>',
				user: 'lnurl_server',
				password: '',
				database: 'lnurl_server',
			},
		},
	},
	// ...
});
```
Or via the CLI:
```bash
lnurl server \
	--store.backend="knex" \
	--store.config='{"client":"mysql","connection":{"host":"<IP_ADDRESS>","user":"lnurl_server","password":"","database":"lnurl_server"}}'
```

### PostgreSQL

To use PostgreSQL as your data store you will need to install the [postgres module](https://github.com/brianc/node-postgres) and [knex](http://knexjs.org/) wherever you are running your lnurl server:
```bash
npm install knex pg
```
Then you can run your server via the API as follows:
```js
const lnurl = require('lnurl');
const server = lnurl.createServer({
	// ...
	store: {
		backend: 'knex',
		config: {
			client: 'postgres',
			connection: {
				host: '<IP_ADDRESS>',
				user: 'lnurl_server',
				password: '',
				database: 'lnurl_server',
			},
		},
	},
	// ...
});
```
Or via the CLI:
```bash
lnurl server \
	--store.backend="knex" \
	--store.config='{"client":"postgres","connection":{"host":"<IP_ADDRESS>","user":"lnurl_server","password":"","database":"lnurl_server"}}'
```

## Debugging

This module uses [debug](https://github.com/visionmedia/debug) to output debug messages to the console. To output all debug messages, run your node app with the `DEBUG` environment variable:
```bash
DEBUG=lnurl* node your-app.js
```
Or if using the CLI interface:
```bash
DEBUG=lnurl* lnurl server ...
```

## Tests

To run all tests:
```
npm test
```

## Changelog

See [CHANGELOG.md](https://github.com/chill117/lnurl-node/blob/master/CHANGELOG.md)

## License

This software is [MIT licensed](https://tldrlegal.com/license/mit-license):
> A short, permissive software license. Basically, you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source.  There are many variations of this license in use.

## Funding

This project is free and open-source. If you would like to show your appreciation by helping to fund the project's continued development and maintenance, you can find available options [here](https://degreesofzero.com/donate.html?project=lnurl-node).

repository: asoltys/lnurl-node

repo_name: asoltys/lnurl-node


text:
# Address

- [1. ![Optional](https://img.shields.io/badge/Optional-yellow) Property `Address > address`](#address)
  - [1.1. Address > address > a number](#autogenerated_heading_2)
  - [1.2. Address > address > address item 1](#autogenerated_heading_3)
  - [1.3. Address > address > again a string](#autogenerated_heading_4)
  - [1.4. Address > address > finally an enum](#autogenerated_heading_5)

**Title:** Address

|                           |                                                                                |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **Type**                  | `object`                                                                                |
| **Additional properties** | [![Any type: allowed](https://img.shields.io/badge/Any%20type-allowed-green)](# "Additional Properties of any type are allowed.") |

| Property               | Pattern | Type  | Deprecated | Definition | Title/Description |
| ---------------------- | ------- | ----- | ---------- | ---------- | ----------------- |
| - [address](#address ) | No      | array | No         | -          | -                 |

## 1. ![Optional](https://img.shields.io/badge/Optional-yellow) Property `Address > address`

|          |         |
| -------- | ------- |
| **Type** | `array` |

**Example:**

```json
[
    1600,
    "Pennsylvania",
    "Avenue",
    "NW",
    "Washington"
]
```

|                      | Array restrictions |
| -------------------- | ------------------ |
| **Min items**        | N/A                |
| **Max items**        | N/A                |
| **Items unicity**    | False              |
| **Additional items** | True               |
| **Tuple validation** | See below          |

| Each item of this array must be      | Description          |
| ------------------------------------ | -------------------- |
| [a number](#address_items_i0)        | -                    |
| [address item 1](#address_items_i1)  | followed by a string |
| [again a string](#address_items_i2)  | -                    |
| [finally an enum](#address_items_i3) | -                    |

### 1.1. Address > address > a number

**Title:** a number

|          |          |
| -------- | -------- |
| **Type** | `number` |

### 1.2. Address > address > address item 1

|          |          |
| -------- | -------- |
| **Type** | `string` |

**Description:** followed by a string

### 1.3. Address > address > again a string

**Title:** again a string

|          |                    |
| -------- | ------------------ |
| **Type** | `enum (of string)` |

Must be one of:
* "Street"
* "Avenue"
* "Boulevard"

### 1.4. Address > address > finally an enum

**Title:** finally an enum

|          |                    |
| -------- | ------------------ |
| **Type** | `enum (of string)` |

Must be one of:
* "NW"
* "NE"
* "SW"
* "SE"

----------------------------------------------------------------------------------------------------------------------------
Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans)

repository: coveooss/json-schema-for-humans

repo_name: coveooss/json-schema-for-humans


text:
---
layout: default
---

# 1994-03-02 - Re: Insecurity of public key crypto #1 (reply to Mandl)

## Header Data

From: Eric Johnson<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: b7be7f2acdeed48298deb159955512adf5794148027aac99a8ec36c1f7be6a3b

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-03-02 05:11:49 UTC

Raw Date: Tue, 1 Mar 94 21:11:49 PST

## Raw message

```
{% raw  %}From: Eric Johnson<EMAIL_ADDRESS>Date: Tue, 1 Mar 94 21:11:49 PST
To<EMAIL_ADDRESS>Subject: Re: Insecurity of public key crypto #1 (reply to Mandl)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

: From<EMAIL_ADDRESS>Tue Mar  1 21:44:58 1994
: Subject: Re: Insecurity of public key crypto #1 (reply to Mandl)
: To<EMAIL_ADDRESS>(Eric Johnson)
: Cc<EMAIL_ADDRESS>: X-Mailer: ELM [version 2.4 PL21]
: Content-Type: text
: Content-Length: 1207
:
: > Would it not make sense, therefore, to publish a public cypherpunks
: > mailing list key, which is returned with subscription requests?
: > All incoming message cleartext to the mailing list server would
: > then be encrypted in the server's key; not for security, but
: > precisely for the reason you state above.  That _would_ create
: > quite a volume of encrypted communications to each recipient of
: > the list.
:
: Please don't do that.  I don't want to go through hoops to read this
: mailing list.  It's already cumbersome as is.  Adding PGP in the soup
: would make things very nasty.  I'd rather not use PGP except for private
: messages.

That was exactly the point Eric Hughes was making; it is not a good
strategy to save encryption for only private communications.

Besides, procmail (or similar) should be able to handle piping
incoming cypherpunks traffic through the decryptor, so the hoop
would be transparent anyway.  No muss, no fuss.

	--Eric

{% endraw %}
```

## Thread

+ Return to [March 1994](/archive/1994/03)

+ Return to "[Anthony D Ortenzi <ao27+@andrew.cmu.edu>](/authors/anthony_d_ortenzi_ao27_at_andrew_cmu_edu_)"
+ Return to "[Eric Johnson <ejohnson@pmip.dist.maricopa.edu>](/authors/eric_johnson_ejohnson_at_pmip_dist_maricopa_edu_)"
+ Return to<EMAIL_ADDRESS>(Eric Hughes)](/authors/hughes_at_ah_com_eric_hughes_)"
+ Return to "[Jeremy Cooper <jeremy@crl.com>](/authors/jeremy_cooper_jeremy_at_crl_com_)"
+ Return to "[Nathan Loofbourrow <loofbour@cis.ohio-state.edu>](/authors/nathan_loofbourrow_loofbour_at_cis_ohiostate_edu_)"
+ Return to "["Perry E. Metzger" <pmetzger@lehman.com>](/authors/perry_e_metzger_pmetzger_at_lehman_com_)"
+ Return to<EMAIL_ADDRESS>(Timothy C. May)](/authors/tcmay_at_netcom_com_timothy_c_may_)"

+ 1994-03-02 (Tue, 1 Mar 94 21:11:49 PST) - Re: Insecurity of public key crypto #1 (reply to Mandl) - _Eric Johnson<EMAIL_ADDRESS>  + 1994-03-02 (Wed, 2 Mar 94 04:15:29 PST) - [Re: Insecurity of public key crypto #1 (reply to Mandl)](/archive/1994/03/36737ea949485430988ce3c215ac03ae68fa963ac13af4404c1525c2d774bf31) - _"Perry E. Metzger"<EMAIL_ADDRESS>    + 1994-03-02 (Wed, 2 Mar 94 06:52:01 PST) - [Increasing the encrypted/unencrypted ratio (was Re: Insecurity of public key crypto #1 (reply to Mandl))](/archive/1994/03/c1dcc112669316a72f2113b6c2a7bd040922bf87e0d77dc6e3c173de522fa6e1) - _Nathan Loofbourrow<EMAIL_ADDRESS>      + 1994-03-02 (Wed, 2 Mar 94 08:30:14 PST) - [Increasing the encrypted/unencrypted ratio (was Re: Insecurity of public key crypto #1 (reply to Mandl))](/archive/1994/03/1725bbd9274e60f0b83521e6eb400fd075ea183da14d1d0b6625d06c662c7594) -<EMAIL_ADDRESS>(Eric Hughes)_
        + 1994-03-02 (Wed, 2 Mar 94 13:35:16 PST) - [Re: Increasing the encrypted/unencrypted ratio (was Re: Insecurity of public key crypto #1 (reply to Mandl))](/archive/1994/03/b326e0363e357987ce415e5440ae7289344dd099c1069df56aec7916d749be27) - _Anthony D Ortenzi<EMAIL_ADDRESS>          + 1994-03-04 (Fri, 4 Mar 94 13:04:32 PST) - [Re: Increasing the encrypted/unencrypted ratio (was Re: Insecurity of public key crypto #1 (reply to Mandl))](/archive/1994/03/76565581934b67f1cf204e2c8fe4b7b616fa7ed5e128f3a5348367aff8651f26) - _Jeremy Cooper<EMAIL_ADDRESS>      + 1994-03-02 (Wed, 2 Mar 94 10:38:38 PST) - [Laziness?](/archive/1994/03/3be20685fc3b0ea241bb806ed9232d9ddfc20ebbdb9a0ab1942b5e7be821f2f8) -<EMAIL_ADDRESS>(Timothy C. May)_
        + 1994-03-02 (Wed, 2 Mar 94 13:29:40 PST) - [Re: Laziness?](/archive/1994/03/505cf0144fa3e8da4c8d6972fca8ed06a70a38d8184d8c575f282f0c939c3a48) - _Nathan Loofbourrow<EMAIL_ADDRESS>          + 1994-03-03 (Wed, 2 Mar 94 16:39:56 PST) - [Laziness?](/archive/1994/03/47e46022f84b02e2c18237a6ddcbf5da6695d1908a921b2039c4c84dbe489bd7) -<EMAIL_ADDRESS>(Eric Hughes)_