text:
# **`Custom Object Detection From Images & Videos`**
```python
!pip install xtreme-vision
```

### **`Custom Image Object Detection` Using `RetinaNet`**

> **Note**: You can use any of the Following Models:
  - Use_CenterNet()
  - Use_RetinaNet()
  - Use_YOLOv4()
  - Use_TinyYOLOv4()

```python
from xtreme_vision.Detection import Object_Detection

model = Object_Detection()
model.Use_RetinaNet()
custom_objects = model.Custom_Objects(kite=True)

model.Detect_Custom_Objects_From_Image(custom_objects,
                                       input_path = 'kite.jpg',
                                       output_path = './custom_detection.jpg',
                                       minimum_percentage_probability = 0.2,
                                       extract_objects=False)

Image.open('custom_detection.jpg')
```

### **`Custom Video Object Detection` Using `CenterNet`**

> **Note**: You can Use Any of the following Models:
  - Use_RetinaNet()
  - Use_CenterNet()
  - Use_YOLOv4()
  - Use_TinyYOLOv4()

```python
from xtreme_vision.Detection import Object_Detection

model = Object_Detection()
model.Use_CenterNet()
custom_obj = model.Custom_Objects(car=True)

model.Detect_Custom_Objects_From_Video(custom_obj,
                                       input_path = 'traffic-mini.mp4',
                                       output_path = './centernet_custom.mp4')
```

### Details:
```python
from xtreme_vision.Detection import Object_Detection
model = Object_Detection()
```
The First Line imports Object_Detection Class from Xtreme-Vision Library and
second line Instantiates the Object Detection Class.
```python
model.Use_RetinaNet()
model.Use_CenterNet()
```
The above lines specify which Model you want to Use,
You can use any of above mentioned models.
```python
custom_obj = model.Custom_Objects(car=True)
model.Detect_Custom_Objects_From_Image()
model.Detect_Custom_Objects_From_Video()
```
First line generates a dictionary, set those Objects to True which you want to Detect, it provides 80 different objects that are set to False, you can easily set them to True.
Second line specifies that, you want to Detect Custom Objects from Images.
Third line specifies that, you want to Detect Custom Objects from Videos.

**Detect_Custom_Objects_From_Image** Function accepts the following Arguments:
  - custom_objects (dict) -> **[dictionary returned from Custom_Objects Function]**
  - input_path (str) -> **[path to the input image in which you want to detect objects]**
  - output_path (str) -> **[output path at which you want to save the output image]**
  - extract_objects (bool) -> **[wether you want to extract detected objects or not,Only RetinaNet supports it]**
  - minimum_percentage_probability (float) -> **[Any thing detected with confidence below this value, will not be shown in the output, Only RetinaNet supports it]**

**Detect_Custom_Objects_From_Video** Function accepts the following Arguments:
  - custom_objects (dict) -> **[dictionary returned from Custom_Objects Function]**
  - input_path (str) -> **[path to the input video in which you want to detect objects]**
  - output_path (str) -> **[output path at which you want to save the output video]**
  - extract_objects (bool) -> **[wether you want to extract detected objects or not,Only RetinaNet supports it]**
  - minimum_percentage_probability (float) -> **[Any thing detected with confidence below this value, will not be shown in the output, Only RetinaNet supports it]**
  - fps (int) -> **[Frames Per Second for Output video]**

```python
from PIL import Image
Image.open('output.jpg')
```
The Above lines are used to open the output image from the Model to show the results

repository: AsadRasheed-AR/Xtreme-Vision

repo_name: AsadRasheed-AR/Xtreme-Vision


text:
# Vesting Module

## Overview

Vesting module provides a means of scheduled balance lock on an account. It uses the *graded vesting* way, which unlocks a specific amount of balance every period of time, until all balance unlocked.

### Vesting Schedule

The schedule of a vesting is described by data structure `VestingSchedule`: from the block number of `start`, for every `period` amount of blocks, `per_period` amount of balance would unlocked, until number of periods `period_count` reached. Note in vesting schedules, *time* is measured by block number. All `VestingSchedule`s under an account could be queried in chain state.

license: Unlicense

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Java Log

### General

#### 15 Jul 2018 22:40 (after France's PK goal to Croatia at 2018 World Cup)

We can use underscore in numeric literals to increase readibility, only between digits. Read here: https://docs.oracle.com/javase/8/docs/technotes/guides/language/underscores-literals.html

repository: ariaenggar/learninglog

repo_name: ariaenggar/learninglog


text:
---
title: 'Testing the Entity Manager API'
date: 2021-12-13
author: 'Aneesh Mistry'
subtitle: 'Use matchers to improve the readability of assertions with the assertJ library'
time: '7'
tags:
- Java
- Testing
---

Testing the EntityManager

Use Mockito to create stubbed query responses when testing implementations of the Entity Manager API.
The Entity Manager API is used to create instances for persistance that fall on the repository layer of a Spring Boot application.
The Entity Manager will manage the lifecycle fo the entity instances for persistance, and can be highly important when persisting and managing data for an application.

This video will use Mockito to stub an EntityManager and Query to control the response of an EntityManager for testing a simple select query.

[![YouTube video link](../images/082_entityManager.jpg)](https://youtu.be/daHupokH4us )

license: MIT

branch_name: refs/heads/main

gha_language: JavaScript

gha_license_id: MIT


text:
# Nemesis

The purpose of this webtool is to make a Waitlist Managers and Fleetcommanders job a bit less painful,
simple x-up with ship fitting via copy & paste from ingame as well as simple authentication via Eve SSO. Integrates with the Eve
IGB to show fittings, characters, corporations and to directly invite pilots from the waitlist.
On the other hand it also works perfectly fine in Chrome (great to have it on that third monitor).

## Features

- create new waitlists, choose an arbitrary name e.g. *E-UNI Vanguard Fleet (FORMING)*
- share a waitlist via URL (WL Linky) or pilots may browse the home page for lists.
- pilots may post one or multiple fits and can indicate their fleet-role
- timers to indicate how long pilots have been in the queue
- basic statistics to get a quick grasp whats on the list
- automatically updates
- works in Chrome as well as in Eve IGB
- integrates with the Eve IGB, view fits, show character info, show corp/alliance
- owner can pass on control of his waitlists
- secure, easy login via Eve SSO. No new passwords or API keys.
- free and open source

## Getting started

Prerequisites:
- install `mysql` server e.g. `sudo apt-get install mysql-server`
- install `nodejs`, `npm` and 'bower'

1. check out this repository
2. install dependencies with `npm install`
3. install components `cd public; bower install;`
3. setup Eve SSO app
  1. Register an Eve SSO application here: https://developers.eveonline.com/resource/single-sign-on
  1. `cp src/config/evesso.example.json  src/config/evesso.json`
  2. `nano src/config/evesso.json` and add your key
  3. edit `src/config/config.json` to reflect your `eveSsoCallback`, it must match your host and should end with `/nemesis/api/auth/callback`
4. setup the database
  2. setup a new database e.g. `CREATE SCHEMA nemesis;`
  3. optional: set up a new db user
  3. edit `src/config/config.json` to reflect you database configuration
5. start nemesis
  1. depending on you `config.json` set the environment variable `NODE_ENV` e.g. `export NODE_ENV=production`
  2. start the server with `npm start`

Feel free to open a new issue if you run into troubles.

## Security

### Authentication
All data and actions via the tool are authenticated by Eve SSO.

### Authorization
Pilots can only manipulate their own entries.

### Confidentiality
All content is served via TLS, which provides server authentication and confidentiality as well as integrity.

### Privacy
No private data except the posted ship fitting is saved.

Login via Eve SSO leaks no information
to the tool except the pilots ID. To make sure there is no phishing involved you may check
the TLS certificate on the SSO page (should be CCP).

After login, public data of the pilot is fetched from the official CCP API and
locally cached (character name, corporation, alliance, ...). Images are directly fetched from the
official CCP servers.

### Common Exploits
All user input is sanitized and escaped,
to my knowledge the tool is save from XSS and SQL injections.

## Authors
see public/humans.txt

repository: trichner/nemesis

repo_name: trichner/nemesis


text:
---
title: Coupons
description: Zen Cart Coupons
category: order_total
weight: 10
---
If you want to offer a coupon, you need to first enable the coupon system:

Go to: Admin > Modules > Order Total > Discount Coupons (ot_coupon).
If it's not already installed, click Install to enable it.

## Creating Coupons

Now, in your Admin area, click Discounts > Coupon Admin.

Next, you create a coupon by clicking Insert.  (Or Edit to edit an existing coupon.)
Fill in the details.
If the coupon is for a percentage discount, enter the percent sign after the number.
If the coupon is ONLY for free shipping, check the free shipping box. (This ignores all the % or amount discounts, and makes the coupon ONLY apply to shipping.)
You can enter a coupon code, or if you leave it blank, the system will generate a random code for you.
Save the coupon.

Now you can either take the coupon code and manually give it to your customers in advertisements (in print or on your website) or you can click the Email button and send it to a list of customers.

If you want to set up restrictions so the coupon applies to only to certain products or categories, click the Restrictions button to set them up.  You can do this at a later date if you desire.

## Coupon Restrictions

Coupon Restrictions are designed to limit Discount Coupons to Categories or Products.

When using Coupon Restrictions, it is best to start with the setting for the Categories of:
TOP **DENY**

This starts with the Discount Coupon not allowing any Product or Category of Products to work.

Next, you would add the Category or Categories allowed, if any.

Then, you would add the Product or Products allowed, specifically, if not already covered by the Categories.

These Restrictions will then **ALLOW** or **DENY** the use of the Discount Coupon.

These Restrictions can then be seen by the Customer via the **Discount Coupons** link in the **Information sidebox** where the customer can enter the Discount Coupon redemption code to see any limits placed on the Discount Coupon.

## Redeeming Coupons

When a customer adds something to their cart and proceeds to checkout, they will see a spot to enter a coupon code on the Payments page.
Once they fill in the code and press Enter, it will be checked for validity, and if it is valid and not restricted against what's in their cart, a Success message will show on the screen, and their order Total will be adjusted appropriately.

If they wish to remove a coupon, they can enter a different coupon code, or they can type "REMOVE", and press Enter.

repository: AmoureuseDesetoiles/documentation

repo_name: AmoureuseDesetoiles/documentation


text:
# KUDO Spark Operator

# Developing

### Prerequisites

Required software:
* Docker
* GNU Make 4.2.1 or higher
* sha1sum
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
* [KUDO CLI Plugin](https://kudo.dev/docs/#install-kudo-cli) 0.15.0 or higher

For test cluster provisioning and Stub Universe artifacts upload valid AWS access credentials required:
* `AWS_PROFILE` **or** `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables should be provided

For pulling private repos, a GitHub token is required:
* generate [GitHub token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)
and export environment variable with token contents: `export GITHUB_TOKEN=<your token>`
  * or save the token either to `<repo root>/shared/data-services-kudo/.github_token` or to `~/.ds_kudo_github_token`

### Build steps

GNU Make is used as the main build tool and includes the following main targets:
* `make cluster-create` creates a Konvoy or MKE cluster
* `make cluster-destroy` creates a Konvoy or MKE cluster
* `make clean-all` removes all artifacts produced by targets from local filesystem
* `make docker-spark` builds Spark base image based on Apache Spark 3.0.0
* `make docker-operator` builds Operator image and Spark base image if it's not built
* `make docker-builder` builds image with required tools to run tests
* `make docker-push` publishes Spark base image and Spark Operator image to DockerHub
* `make test` runs tests suite
* `make clean-docker` removes all files, created by `make` during `docker build` goals execution

A typical workflow looks as following:
```
make clean-all
make cluster-create
make docker-push
make test
make cluster-destroy
```

To run tests on a pre-existing cluster with specified operator and spark images, set KUBECONFIG, SPARK_IMAGE_FULL_NAME and OPERATOR_IMAGE_FULL_NAME variables

```
make test KUBECONFIG=$HOME/.kube/config \
SPARK_IMAGE_FULL_NAME=mesosphere/spark:spark-3.0.0-hadoop-2.9-k8s \
OPERATOR_IMAGE_FULL_NAME=mesosphere/kudo-spark-operator:3.0.0-1.1.0
```

# Package and Release
Release process is semi-automated and based on Github Actions. To make a new release:
- Copy manifsets and docs for KUDO Spark Operator to the [Operators repo](https://github.com/kudobuilder/operators/tree/master/repository/spark), raise a PR and make sure the CI check is successful
- After the PR is merged, create and push a new tag, e.g:
```
git tag -a v3.0.0-1.1.0 -m "KUDO Spark Operator 3.0.0-1.1.0 release"
```
Pushing the new tag will trigger [release workflow](.github/workflows/release.yml), will build the operator package with KUDO,
create a new GH release draft with the package attached to it.

- Verify the new release (draft) is created and operator package attached as a release asset
- Add the release notes and publish the release

# Installing and using Spark Operator

### Prerequisites

* Kubernetes cluster up and running
* `kubectl` configured to work with provisioned cluster
* [KUDO CLI Plugin](https://kudo.dev/docs/#install-kudo-cli) 0.15.0 or higher

### Installation

To install KUDO Spark Operator, run:
```bash
make install
```

This make target runs [install_operator.sh](scripts/install_operator.sh) script which will install Spark Operator and
create Spark Driver roles defined in [specs/spark-driver-rbac.yaml](specs/spark-driver-rbac.yaml). By default, Operator
and Driver roles will be created and configured to run in namespace `spark-operator`. To change the namespace,
provide `NAMESPACE` parameter to make:
```bash
make install NAMESPACE=test-namespace
```

### Submitting Spark Application

To submit Spark Application and check its status run:
```bash
#switch to operator namespace, e.g.
kubens spark-operator

# create Spark application
kubectl create -f specs/spark-application.yaml

# list applications
kubectl get sparkapplication

# check application status
kubectl describe sparkapplication mock-task-runner
```

To get started with your app monitoring, please, see also [monitoring documentation](kudo-spark-operator/docs/latest/monitoring.md)

repository: mesosphere/kudo-spark-operator

gha_language: Shell

repo_name: mesosphere/kudo-spark-operator


text:
# pihole-dnsblinks
Code for blinking LEDs based on DNS requests made to a Pi-hole Raspberry Pi

Just hook some LEDs and resistors up to BCM pins 17, 27, and 22 (physical pins 11, 13, and 15. There is also a convenient ground at pin 9). One will blink for forwards, one for cached responses, and one for blocks.

Demo:

https://www.youtube.com/watch?v=ZNu22D9DfRw

repository: scottymuse/pihole-dnsblinks

repo_name: scottymuse/pihole-dnsblinks


text:
# Segmentation Research
Tensorflow Implementation of Dilated Residual Networks and other Segementation Networks

### Backbones Supported
- ResNet - https://arxiv.org/abs/1512.03385
- Dilated Residual Networks (DRN) - https://arxiv.org/abs/1705.09914
- ResNetv2 Dilated Style (alteration of original resnet, differs from above)

### Networks Supported

- PSPNet - https://arxiv.org/abs/1612.01105
- FPN (In Progress) - https://arxiv.org/abs/1612.03144

### Acknowledgements

This repository structure inspired by [segmentation_models](https://github.com/qubvel/segmentation_models).

Model architecture and implementations differ to support my own research directions, and based on updates from original authors (e.g. [semseg](https://github.com/hszhao/semseg)).

gha_language: Python


text:
# Contributing

We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.

## Development workflow

To get started with the project, run `yarn install` in the root directory to install the required dependencies for each package:

```sh
yarn install
```

Make sure your code passes TypeScript and ESLint. Run the following to verify:

```sh
yarn typescript
yarn lint
```

To fix formatting errors, run the following:

```sh
yarn lint --fix
```

Remember to add tests for your change if possible. Run the unit tests by:

```sh
yarn test
```

### Commit message convention

We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:

- `fix`: bug fixes, e.g. fix crash due to deprecated method.
- `feat`: new features, e.g. add new method to the module.
- `refactor`: code refactor, e.g. migrate from class components to hooks.
- `docs`: changes into documentation, e.g. add usage example for the module..
- `test`: adding or updating tests, eg add integration tests using detox.
- `chore`: tooling changes, e.g. change CI config.

Our pre-commit hooks verify that your commit message matches this format when committing.

### Linting and tests

[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)

We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.

Our pre-commit hooks verify that the linter and tests pass when committing.

### Scripts

The `package.json` file contains various scripts for common tasks:

- `yarn typescript`: type-check files with TypeScript.
- `yarn lint`: lint files with ESLint.
- `yarn test`: run unit tests with Jest.

gha_language: TypeScript


text:
The Witness Puzzle Solver (SPOILERS!)
=====================================

This is a tool for solving all of the non-environment puzzles in the video game
[The Witness](http://store.steampowered.com/app/210970/). It provides an
interface for inputting puzzles similar to the panels in the game. It finds the
simplest solution and displays it in the grid. You can also configure the solver
to only show part of the solution if you just need a hint.

You can try out the solver here:

https://overv.github.io/TheWitnessSolver/

# Algorithm

Currently a very simple branch-and-bound algorithm is used that walks through
all possible paths from each starting node and evaluates if the current path
forms a correct solution when it hits an exit node.

Even just verifying a solution for the puzzles with tetris blocks appears to be
an [NP-complete problem](https://en.wikipedia.org/wiki/Tetris#Computational_complexity)
so the algorithm is unlikely to become more efficient. Most of the effort should
probably be dedicated to finding heuristics for the bound conditions to reduce
the depth of the search tree.

This solver does not attempt to find the "simplest" solution, because that would
require an exhaustive search that eliminates many optimisation opportunities to
keep the performance reasonable.

The areas split up by the solution path are found incrementally, which means
that for every step in the path only the last area has to be reexamined. This
is much faster than running flood fill from scratch for every proposed solution
and allows for early termination decisions, because other areas are known to
longer change with future steps.

Similar to the first-fit decreasing bin packing algorithm, tetris puzzle
solutions are verified by trying to fit the largest tetris blocks within an area
first, which allows for detecting nonsensical solutions earlier. Note that
unlike the bin packing algorithm, all possible combinations will be attempted if
necessary.

### Prefer required neighbour nodes

If multiple unvisited neighbour nodes are available, try visiting the required
nodes first. This can avoid a lot of dead end solutions early on.

### Segregation optimization through auxilary required nodes

If differently colored squares are direct neighbours, then the edge between them
**must** be part of the correct solution path. That means that the endpoints of
that edge are required nodes in the path. By checking for these (extra) required
nodes in the solution check, the full segregation check doesn't need to run most
of the time, which saves a lot of time.

### Terminate a path if finished areas are already wrong

If an area that cannot be revisited already fails the segregation or tetris
checks then there is no point going on.

# Rules

This is a list of the mechanics as implemented by this solver:

##### Path

The path must be a self-avoiding walk starting at a start node and ending at an end node

##### Hexagons

Nodes or edges with a hexagon *must* be included in the path

##### Squares

For every region R, all squares in R must share the same color.

##### Suns / Stars

For every region R, **if** a sun of color X in in R, **then** there must be **exactly two** elements of color X in R.

##### Tetris Pieces

For every region R, R must exactly accommodate all the tetris pieces represented in R.

##### Hollow Squares

For every region R, let H be the total number of hollow squares represented in the region (that is, groups just contribute their size, and the shape is ignored).
**For some** choice of H individual tetris blocks, R must pass tetris validation (the step described above) when these pieces are removed, **but not if fewer** than H blocks are removed.

##### Cancellation symbols

For every region R, let K denote the number of cancellation symbols in R.
**For some** choice of K (non-cancellation) elements from the region, validation must pass (that is, all the rules described above must pass) when these elements are removed, **but not if fewer** than K elements are removed.

# Notable implementation discrepancies

Here are some things that are different from the game:

* Perhaps most importantly, Cancellation symbols will not respect hexagons -- they only consider entities in the interiors of cells.
* Hollow tetris cubes are implemented *only* depending on the total amount of hollow blocks in a region, disregarding shape.
For the vast majority of puzzles in the game, this is acceptable.
It's not completely clear *how* respecting the shape of hollow squares would work, as there were very few puzzles in the game using this mechanic.

repository: danielchatfield/TheWitnessSolver

repo_name: danielchatfield/TheWitnessSolver


text:
fromnow
=======

> Generate dates and times relative from now.

## Usage

```
fromnow v0.1.1 (semver.org 2.0)
Alberto Leal<EMAIL_ADDRESS>(github.com/dashed)
Generate dates and times relative from now.

USAGE:
    fromnow [FLAGS] [OPTIONS] <duration>...

FLAGS:
    -h, --help        Prints help information
    -s, --subtract    Subtract time spans/durations to generate date/time in the past.
                      By default, time
                      spans/durations are added.
    -V, --version     Prints version information

OPTIONS:
    -f, --format <format>
        Format specifier for the combined date and time output.
        Example output: July 5, 2016 9:36 PM
        Default is: %B
        %-d, %Y %-l:%M %p

        See: https://lifthrasiir.github.io/rust-chrono/chrono/format/strftime/index.html

ARGS:
    <duration>...
        A duration/span of time. (Example: 3 hours)
        A duration is an integer number followed by time span units. (Example: 42 hours)
        There may be whitespace between the integer and the time span unit.
        Whitespace between <duration> items is optional (Example: 3hours30mins).
        There may be an ' and ' between duration items (Example: 42 days and 42 mins).

        Arguments may compose into a valid duration/time span; removing the need to enclose durations in quotes.

        Time span units are case-insensitive.
        Valid time span units and their abbreviations:
        weeks/week/wks/wk/w
        days/day/dys/dy/d
        hours/hour/hrs/hr/h
        minutes/minute/mins/min/m
        seconds/second/secs/sec/s
        milliseconds/millisecond/msecs/msec/ms

```

## Examples

```
fromnow 6 hours
fromnow 6 hours 42mins
fromnow 6 hours 42mins 6 week
fromnow 6 hours 42mins 6 week and 9000 secs
fromnow 6 hours 42mins 6 week and 9000 secs -f "%B %-d, %Y %-l:%M %p"
```

## Format Specifiers

Taken from: https://lifthrasiir.github.io/rust-chrono/chrono/format/strftime/index.html

Spec. | Example       | Description
----- | ------------- | -----------
      |               | **DATE SPECIFIERS:**
`%Y`  | `2001`        | The full proleptic Gregorian year, zero-padded to 4 digits. [1]
`%C`  | `20`          | The proleptic Gregorian year divided by 100, zero-padded to 2 digits. [2]
`%y`  | `01`          | The proleptic Gregorian year modulo 100, zero-padded to 2 digits. [2]
      |               |
`%m`  | `07`          | Month number (01--12), zero-padded to 2 digits.
`%b`  | `Jul`         | Abbreviated month name. Always 3 letters.
`%B`  | `July`        | Full month name. Also accepts corresponding abbreviation in parsing.
`%h`  | `Jul`         | Same to `%b`.
      |               |
`%d`  | `08`          | Day number (01--31), zero-padded to 2 digits.
`%e`  | ` 8`          | Same to `%d` but space-padded. Same to `%_d`.
      |               |
`%a`  | `Sun`         | Abbreviated weekday name. Always 3 letters.
`%A`  | `Sunday`      | Full weekday name. Also accepts corresponding abbreviation in parsing.
`%w`  | `0`           | Sunday = 0, Monday = 1, ..., Saturday = 6.
`%u`  | `7`           | Monday = 1, Tuesday = 2, ..., Sunday = 7. (ISO 8601)
      |               |
`%U`  | `28`          | Week number starting with Sunday (00--53), zero-padded to 2 digits. [3]
`%W`  | `27`          | Same to `%U`, but week 1 starts with the first Monday in that year instead.
      |               |
`%G`  | `2001`        | Same to `%Y` but uses the year number in ISO 8601 week date. [4]
`%g`  | `01`          | Same to `%y` but uses the year number in ISO 8601 week date. [4]
`%V`  | `27`          | Same to `%U` but uses the week number in ISO 8601 week date (01--53). [4]
      |               |
`%j`  | `189`         | Day of the year (001--366), zero-padded to 3 digits.
      |               |
`%D`  | `07/08/01`    | Month-day-year format. Same to `%m/%d/%y`.
`%x`  | `07/08/01`    | Same to `%D`.
`%F`  | `2001-07-08`  | Year-month-day format (ISO 8601). Same to `%Y-%m-%d`.
`%v`  | ` 8-Jul-2001` | Day-month-year format. Same to `%e-%b-%Y`.
      |               |
      |               | **TIME SPECIFIERS:**
`%H`  | `00`          | Hour number (00--23), zero-padded to 2 digits.
`%k`  | ` 0`          | Same to `%H` but space-padded. Same to `%_H`.
`%I`  | `12`          | Hour number in 12-hour clocks (01--12), zero-padded to 2 digits.
`%l`  | `12`          | Same to `%I` but space-padded. Same to `%_I`.
      |               |
`%P`  | `am`          | `am` or `pm` in 12-hour clocks.
`%p`  | `AM`          | `AM` or `PM` in 12-hour clocks.
      |               |
`%M`  | `34`          | Minute number (00--59), zero-padded to 2 digits.
`%S`  | `60`          | Second number (00--60), zero-padded to 2 digits. [5]
`%f`  | `026490000`   | The fractional seconds (in nanoseconds) since last whole second. [8]
`%.f` | `.026490`     | Similar to `.%f` but left-aligned. [8]
`%.3f`| `.026`        | Similar to `.%f` but left-aligned but fixed to a length of 3. [8]
`%.6f`| `.026490`     | Similar to `.%f` but left-aligned but fixed to a length of 6. [8]
`%.9f`| `.026490000`  | Similar to `.%f` but left-aligned but fixed to a length of 9. [8]
      |               |
`%R`  | `00:34`       | Hour-minute format. Same to `%H:%M`.
`%T`  | `00:34:60`    | Hour-minute-second format. Same to `%H:%M:%S`.
`%X`  | `00:34:60`    | Same to `%T`.
`%r`  | `12:34:60 AM` | Hour-minute-second format in 12-hour clocks. Same to `%I:%M:%S %p`.
      |               |
      |               | **TIME ZONE SPECIFIERS:**
`%Z`  | `ACST`        | *Formatting only:* Local time zone name.
`%z`  | `+0930`       | Offset from the local time to UTC (with UTC being `+0000`).
`%:z` | `+09:30`      | Same to `%z` but with a colon.
      |               |
      |               | **DATE & TIME SPECIFIERS:**
`%c`  | `Sun Jul  8 00:34:60 2001` | `ctime` date & time format. Same to `%a %b %e %T %Y` sans `\n`.
`%+`  | `2001-07-08T00:34:60.026490+09:30` | ISO 8601 / RFC 3339 date & time format. [6]
      |               |
`%s`  | `994518299`   | UNIX timestamp, the number of seconds since 1970-01-01 00:00 UTC. [7]
      |               |
      |               | **SPECIAL SPECIFIERS:**
`%t`  |               | Literal tab (`\t`).
`%n`  |               | Literal newline (`\n`).
`%%`  |               | Literal percent sign.

## Install

Direct downloads are available through the [releases page](https://github.com/dashed/fromnow/releases).

If you're on OSX, you may install using [Homebrew](http://brew.sh/):

```
brew install https://raw.githubusercontent.com/dashed/fromnow/master/fromnow.rb
```

## Why?

I'm aware there exists a `date` command that does essentially the same thing.
However, there are different flavours of the `date` command in OSX and linux. Example:

- http://stackoverflow.com/q/9804966/412627
- http://stackoverflow.com/q/498358/412627

I created `fromnow` for my own usecases rather than making a bash script to 'monkeypatch' the `date` command.

License
=======

MIT.

repository: dashed/fromnow

repo_name: dashed/fromnow


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.15.0](https://github.com/instructure/instructure-ui/compare/v5.14.0...v5.15.0) (2018-06-28)

### Bug Fixes

* **ui-presets:** don't PSA for release candidates ([7cf8648](https://github.com/instructure/instructure-ui/commit/7cf8648))

# [5.14.0](https://github.com/instructure/instructure-ui/compare/v5.13.1...v5.14.0) (2018-06-28)

### Bug Fixes

* **ui-presets:** fix post publish script ([693a7a4](https://github.com/instructure/instructure-ui/commit/693a7a4))

## [5.13.1](https://github.com/instructure/instructure-ui/compare/v5.13.0...v5.13.1) (2018-06-22)

**Note:** Version bump only for package @instructure/ui-presets

# [5.13.0](https://github.com/instructure/instructure-ui/compare/v5.12.0...v5.13.0) (2018-06-16)

### Bug Fixes

* **karma:** Improve plugin support inside monorepos ([94d0d2a](https://github.com/instructure/instructure-ui/commit/94d0d2a))
* **ui-presets:** catch error w/ no issues ([0443262](https://github.com/instructure/instructure-ui/commit/0443262))
* **ui-presets:** include version in slack message ([c762e86](https://github.com/instructure/instructure-ui/commit/c762e86))
* **ui-presets:** only run deploy after a stable release ([387501c](https://github.com/instructure/instructure-ui/commit/387501c))
* **ui-presets:** release script changes for Jenkins ([511ddb3](https://github.com/instructure/instructure-ui/commit/511ddb3))

### Features

* **cz-lerna-changelog,ui-presets:** add lerna changelog package ([f7592eb](https://github.com/instructure/instructure-ui/commit/f7592eb))

# [5.12.0](https://github.com/instructure/instructure-ui/compare/v5.11.0...v5.12.0) (2018-06-11)

### Bug Fixes

* **ui-presets:** Always pass an npm tag to publish ([da06936](https://github.com/instructure/instructure-ui/commit/da06936))
* **ui-presets:** Remove meta data from pre-release versions ([ecc8d1c](https://github.com/instructure/instructure-ui/commit/ecc8d1c))

### Features

* **ui-presets:** Add ui-scripts for release and publish ([1e7409f](https://github.com/instructure/instructure-ui/commit/1e7409f))

# [5.11.0](https://github.com/instructure/instructure-ui/compare/v5.10.0...v5.11.0) (2018-06-06)

### Bug Fixes

* **docs:** Add Object.values polyfill to fix IE11 ([af17ebd](https://github.com/instructure/instructure-ui/commit/af17ebd))

### Features

* **config-loader:** Add a config-loader package ([832ff12](https://github.com/instructure/instructure-ui/commit/832ff12))
* **ui-presets:** Add stylelint rules for bidrectional text support ([b58ea17](https://github.com/instructure/instructure-ui/commit/b58ea17))

See the instructure-ui mono-repo [change log](#CHANGELOG) for past changes.

repository: tgroshon/instructure-ui

repo_name: tgroshon/instructure-ui


text:
# Devise Guests
[![Build Status](https://travis-ci.org/cbeer/devise-guests.png?branch=master)](https://travis-ci.org/cbeer/devise-guests)

A drop-in guest user implementation for devise

(I'm using "user" to mean my devise model, but you should be able to use any model you want, just like devise)

## Installation

```ruby
# install devise first
# gem install devise
# rails g devise:install
# rails g devise User

gem install devise-guests
rails g devise_guests User
```

## Usage

```ruby
# Where you might use current_user; now you can use

current_or_guest_user

# which returns

current_user # (for logged in users)

=> User<id: 1, email: ...>
# or

guest_user # ( for anonymous users)

=> User<id: nil, email<EMAIL_ADDRESS>guest: true>

```

### Transferring Guest to User on Login

During the login process you may want to transfer things from your guest user to the account the logged into.
To do so, modify your ApplicationController like so:

```ruby
define_callbacks :logging_in_user
set_callback :logging_in_user, :before, :transfer_guest_to_current_user

private
def transfer_guest_to_current_user
  # At this point you have access to:
  #   * current_user - the user they've just logged in as
  #   * guest_user - the guest user they were previously identified by
  #
  # After this block runs, the guest_user will be destroyed!

  if current_user.cart
    guest_user.cart.line_items.update_all(cart_id: current_user.cart.id)
  else
    guest_user.cart.update!(user: current_user)
  end
end
```

### Custom attribute

If you have added additional authentication_keys, or have other attributes on your Devise model that you need to set
when creating a guest user, you can do so by overriding the set_guest_user_params method in your ApplicationController:

```ruby
private
def guest_user_params
  { site_id: current_site.id }
end
```

### Prevent deletion of guest records

By default, when signing in from a guest account to an authenticated account, the guest user is destroyed. You have an
opportunity through the `logging_in_user` callback (or `logging_in_MODEL` if you're not using `User`) to transfer data
from the guest to the main account before destruction occurs.

However, for some situations such as guest-checkout, you may desire that any guest account which makes a purchase does
not get destroyed. In that case you can use the `skip_destroy_guest_user` method to identify when to skip deleting these
records. By default this method returns `false`, indicating that every record is acceptable for destruction, but you
could use something like the following to optionally prevent it:

```ruby
def skip_destroy_guest_user
  guest_user.orders.any?
end
```

repository: pacso/devise-guests

gha_language: Ruby

repo_name: pacso/devise-guests


text:
Shown here is a YAML file that associates two containers in a Pod. The containers communicate with each other through shared path mounts. This allows the second container to act as a sidecar. Inspect how the Pod is created.

`ccat sidecar-example.yaml`{{execute}}

Deploy the Pod.

`kubectl apply -f sidecar-example.yaml`{{execute}}

Inspect the initialization progress.

`kubectl get pods`{{execute}}

Both containers in the Pod start quickly so the Pod status may be already running, creating, or initializing. One downside is the more containers you put in a Pod, the more time it will take to create, restart and scale. Be aware that containers start in parallel and the order of availability is not predictable. Nginx is running once the status the Pod status reports `Running`.

To interact with the Nginx application in the Pod we need a Service that can address the Pod. Let's expose a Service with the NodePort type.

`kubectl expose pod sidecar-pod --type=NodePort --port=80`{{execute}}

Now check the service list and notice the `sidecar-pod` Service is now listed with an URL.

`kubectl get services`{{execute}}.

The service is on a high, random Kubernetes NodePort (some value above 30000). This next line will force the NodePort to 31111

`kubectl patch service sidecar-pod --type='json' --patch='[{"op": "replace", "path": "/spec/ports/0/nodePort", "value":31111}]'`{{execute}}

Now the Service lists the exposed address with the correct port number.

`kubectl get services`{{execute}}.

Next, let's query the service.

repository: litmusbot/katacoda-courses

repo_name: litmusbot/katacoda-courses


text:
---
description: Minter is a global rewards and loyalty points network powered by a fast blockchain. Any brand, community, or blogger can create their own coins and launch their reward or loyalty system in minutes.
---

# Minter blockchain

Minter is a global rewards and loyalty points network powered by a fast blockchain. Any brand, community, or blogger can create their own coins and launch their reward or loyalty system in minutes.

Github: https://github.com/MinterTeam/minter-go-node
Official site: https://minter.network/

## Install Minter

There are several ways you can install Minter Blockchain Testnet node on your machine.

### Using binary

1. **Download Minter**
   Get [latest binary build](https://github.com/MinterTeam/minter-go-node/releases) suitable for your architecture and unpack it to desired folder.
2. **Run Minter**
   ```bash
   ./minter node
   ```
### From Source

You'll need `golang` installed https://golang.org/doc/install and the
required
[environment variables
set](https://github.com/tendermint/tendermint/wiki/Setting-GOPATH)

1. **Clone Minter source code to your machine**
  ```bash
  mkdir -p $GOPATH/src/github.com/MinterTeam
  cd $GOPATH/src/github.com/MinterTeam
  git clone https://github.com/MinterTeam/minter-go-node.git
  cd minter-go-node
  ```
2. **Get Tools & Dependencies**
  ```bash
  make get_tools
  make get_vendor_deps
  ```
3. **Compile**
  ```bash
  make install
  ```
  to put the binary in `$GOPATH/bin` or use:
  ```bash
  make build
  ```
  to put the binary in `./build`.
  The latest `minter version` is now installed.
4. **Run Minter**
  ```bash
  ./build/minter node
  ```
  or
  ```bash
  minter node
  ```
## Blockchain Specification

**Tendermint**

Minter Blockchain utilizes `Tendermint Consensus Engine`.

Tendermint is software for securely and consistently replicating an
application on many machines.
By securely, we mean that Tendermint works even if up to 1/3 of machines
fail in arbitrary ways.
By consistently, we mean that every non-faulty machine sees the same
transaction log and computes the same state.
Secure and consistent replication is a fundamental problem in distributed
systems; it plays a critical role in the
fault tolerance of a broad range of applications, from currencies, to
elections, to infrastructure orchestration,
and beyond.

Tendermint is designed to be easy-to-use, simple-to-understand, highly
performant, and useful for a wide variety of
distributed applications.

You can read more about Tendermint Consensus in [official
documentation](https://tendermint.com/docs/)

**Consensus**

In Minter we implemented Delegated Proof of Stake (DPOS) Consensus Protocol.

DPOS is the fastest, most efficient, most decentralized, and most flexible
consensus model available. DPOS leverages the power of stakeholder approval
voting to resolve consensus issues in a fair and democratic way.

**Block speed**

Minter Blockchain is configured to produce `1 block per 5 sec`. Actual block
speed may vary depends on validators count, their computational power,
internet speed, etc.

**Block size**

We limit block size to `10 000 transactions`. Block size in terms of bytes
is not limited.

## Coins

Minter Blockchain is multi-coin system.

Base coin in testnet is `MNT`.
Base coin in mainnet is `BIP`.

Smallest part of *each* coin is called `pip`.
1 pip = 1^-18 of any coin. In Blockchain and API we only operating with
pips.

> **Note:** Each coin has its **own** pip. You should treat pip like atomic
part of a coin, not as currency:
> 1 MNT = 10^18 pip (MNT's pip)
> 1 ABC = 10^18 pip (ABC's pip)
> 1 MNT != 1 ABC

### Coin Issuance

Every user of Minter can issue own coin. Each coin is backed by base coin in
some proportion.
Issue own coin is as simple as filling a form with given fields:

- **Coin name** - Name of a coin. Arbitrary string up to 64 letters length.
- **Coin symbol** - Symbol of a coin. Must be unique, alphabetic, uppercase,
3 to 10 letters length.
- **Initial supply** - Amount of coins to issue. Issued coins will be
available to sender account. Should be between 1 and 1,000,000,000,000,000
coins.
- **Initial reserve** - Initial reserve in base coin. Should be at least 10
bips.
- **Constant Reserve Ratio (CRR)** - uint, should be from 10 to 100.
- **Max supply** - Max amount of coins that are allowed to be issued.
Maximum is 1,000,000,000,000,000

After coin issued you can send is as ordinary coin using standard wallets.

### Issuance Fees

To issue a coin Coiner should pay fee. Fee is depends on length of Coin
Symbol.

3 letters – 1 000 000 bips
4 letters – 100 000 bips
5 letters – 10 000 bips
6 letters – 1000 bips
7-10 letters – 100 bips

### Coin Exchange

Each coin in system can be instantly exchanged to another coin. This is
possible because each coin has "reserve" in base
coin.

Here are some formulas we are using for coin conversion:

**CalculatePurchaseReturn**
Given a coin supply (s), reserve balance (r), CRR (c) and a deposit amount
(d), calculates the return for a given conversion (in the base coin):

```go
return s * ((1 + d / r) ^ c - 1);
```

**CalculateSaleReturn**
Given a coin supply (s), reserve balance (r), CRR (c) and a sell amount (a),
calculates the return for a given conversion

```go
return r * (1 - (1 - a / s) ^ (1 / c));
```

## Transactions

Transactions in Minter are
[RLP-encoded](https://github.com/ethereum/wiki/wiki/RLP) structures.

Example of a signed transaction:
    f873230101aae98a4d4e540000000000000094a93163fdf10724dc4785ff5cbfb9
    ac0b5949409f880de0b6b3a764000080801ba06838db4a2197cfd70ede8d8d184d
    bf332932ca051a243eb7886791250e545dd3a04b63fb1d1b5ef5f2cbd2ea12530c
    da520b3280dcb75bfd45a873629109f24b29
Each transaction has:

-   **Nonce** - int, used for prevent transaction reply.
-   **ChainID** - id of the network (1 - mainnet, 2 - testnet)
-   **Gas Price** - big int, fee multiplier, should be equal or greater than
current mempool min gas price.
-   **Gas Coin** - 10 bytes, symbol of a coin to pay fee, right padded with
zeros
-   **Type** - type of transaction (see below).
-   **Data** - data of transaction (depends on transaction type).
-   **Payload** (arbitrary bytes) - arbitrary user-defined bytes.
-   **Service Data** - reserved field.
-   **Signature Type** - single or multisig transaction.
-   **Signature Data** - digital signature of transaction.

```go
type Transaction struct {
    Nonce         uint64
    ChainID       byte
    GasPrice      *big.Int
    GasCoin       [10]byte
    Type          byte
    Data          []byte
    Payload       []byte
    ServiceData   []byte
    SignatureType byte
    SignatureData Signature
}

type Signature struct {
    V           *big.Int
    R           *big.Int
    S           *big.Int
}

type MultiSignature struct {
    MultisigAddress [20]byte
    Signatures      []Signature
}
```

### Signature Types

|Type Name                           |Byte|
|----------------------------------- |----|
|**TypeSingle**                      |0x01|
|**TypeMulti**                       |0x02|

### Types

Type of transaction is determined by a single byte.

|Type Name                           |Byte|
|----------------------------------- |----|
|**TypeSend**                        |0x01|
|**TypeSellCoin**                    |0x02|
|**TypeSellAllCoin**                 |0x03|
|**TypeBuyCoin**                     |0x04|
|**TypeCreateCoin**                  |0x05|
|**TypeDeclareCandidacy**            |0x06|
|**TypeDelegate**                    |0x07|
|**TypeUnbond**                      |0x08|
|**TypeRedeemCheck**                 |0x09|
|**TypeSetCandidateOnline**          |0x0A|
|**TypeSetCandidateOffline**         |0x0B|
|**TypeCreateMultisig**              |0x0C|
|**TypeMultisend**                   |0x0D|
|**TypeEditCandidate**               |0x0E|

### Send transaction

Type: **0x01**

Transaction for sending arbitrary coin.

*Data field contents:*

```go
type SendData struct {
    Coin  [10]byte
    To    [20]byte
    Value *big.Int
}
```

**Coin** - Symbol of a coin.
**To** - Recipient address in Minter Network.
**Value** - Amount of **Coin** to send.

### Sell coin transaction

Type: **0x02**

Transaction for selling one coin (owned by sender) in favour of another coin
in a system.

*Data field contents:*

```go
type SellCoinData struct {
    CoinToSell          [10]byte
    ValueToSell         *big.Int
    CoinToBuy           [10]byte
    MinimumValueToBuy   *big.Int
}
```

**CoinToSell** - Symbol of a coin to give.
**ValueToSell** - Amount of **CoinToSell** to give.
**CoinToBuy** - Symbol of a coin to get.
**MinimumValueToBuy** - Minimum value of coins to get.

### Sell all coin transaction

Type: **0x03**

Transaction for selling all existing coins of one type (owned by sender) in
favour of another coin in a system.

*Data field contents:*

```go
type SellAllCoinData struct {
    CoinToSell          [10]byte
    CoinToBuy           [10]byte
    MinimumValueToBuy   *big.Int
}
```

**CoinToSell** - Symbol of a coin to give.
**CoinToBuy** - Symbol of a coin to get.
**MinimumValueToBuy** - Minimum value of coins to get.

### Buy coin transaction

Type: **0x04**

Transaction for buy a coin paying another coin (owned by sender).

*Data field contents:*

```go
type BuyCoinData struct {
    CoinToBuy           [10]byte
    ValueToBuy          *big.Int
    CoinToSell          [10]byte
    MaximumValueToSell  *big.Int
}
```

**CoinToBuy** - Symbol of a coin to get.
**ValueToBuy** - Amount of **CoinToBuy** to get.
**CoinToSell** - Symbol of a coin to give.
**MaximumValueToSell** - Maximum value of coins to sell.

### Create coin transaction

Type: **0x05**

Transaction for creating new coin in a system.

*Data field contents:*

```go
type CreateCoinData struct {
    Name                 string
    Symbol               [10]byte
    InitialAmount        *big.Int
    InitialReserve       *big.Int
    ConstantReserveRatio uint
    MaxSupply            *big.Int
}
```

**Name** - Name of a coin. Arbitrary string up to 64 letters length.
**Symbol** - Symbol of a coin. Must be unique, alphabetic, uppercase, 3 to
10 symbols length.
**InitialAmount** - Amount of coins to issue. Issued coins will be available
to sender account.
**InitialReserve** - Initial reserve in BIP's.
**ConstantReserveRatio** - CRR, uint, should be from 10 to 100.
**MaxSupply** - Max amount of coins that are allowed to be issued. Maximum
is 1,000,000,000,000,000.

### Declare candidacy transaction

Type: **0x06**

Transaction for declaring new validator candidacy.

*Data field contents:*

```go
type DeclareCandidacyData struct {
    Address    [20]byte
    PubKey     []byte
    Commission uint
    Coin       [10]byte
    Stake      *big.Int
}
```

**Address** - Address of candidate in Minter Network. This address would be
able to control candidate. Also all rewards will be sent to this address.
**PubKey** - Public key of a validator.
**Commission** - Commission (from 0 to 100) from rewards which delegators
will pay to validator.
**Coin** - Symbol of coin to stake.
**Stake** - Amount of coins to stake.

### Delegate transaction

Type: **0x07**

Transaction for delegating funds to validator.

*Data field contents:*

```go
type DelegateData struct {
    PubKey []byte
    Coin   [10]byte
    Value  *big.Int
}
```

**PubKey** - Public key of a validator.
**Coin** - Symbol of coin to stake.
**Value** - Amount of coins to stake.

### Unbond transaction

Type: **0x08**

Transaction for unbonding funds from validator's stake.

*Data field contents:*

```go
type UnbondData struct {
    PubKey []byte
    Coin   [10]byte
    Value  *big.Int
}
```

**PubKey** - Public key of a validator.
**Coin** - Symbol of coin to unbond.
**Value** - Amount of coins to unbond.

### Redeem check transaction

Type: **0x09**

Transaction for redeeming a check.

*Data field contents:*

```go
type RedeemCheckData struct {
    Check []byte
    Proof [65]byte
}
```

**Check** - Check received from sender.
**Proof** - Proof of owning a check: password signed with recipient's
address. [Read
more](https://docs.minter.network/#section/Minter-Check/Check-hijacking-protection)

Note that maximum GasPrice is limited to 1 to prevent fraud, because
GasPrice is set by redeem tx sender but commission is charded from check
issuer.

### Set candidate online transaction

Type: **0x0A**

Transaction for turning candidate on. This transaction should be sent from
address which is set in the "Declare candidacy transaction".

*Data field contents:*

```go
type SetCandidateOnData struct {
    PubKey []byte
}
```

**PubKey** - Public key of a validator.

### Set candidate offline transaction

Type: **0x0B**

Transaction for turning candidate off. This transaction should be sent from
address which is set in the "Declare candidacy transaction".

*Data field contents:*

```go
type SetCandidateOffData struct {
    PubKey []byte
}
```

**PubKey** - Public key of a validator.

### Create multisig address

Type: **0x0C**

Transaction for creating multisignature address.

*Data field contents:*

```go
type CreateMultisigData struct {
    Threshold uint
    Weights   []uint
    Addresses [][20]byte
}
```

### Multisend transaction

Type: **0x0D**

Transaction for sending coins to multiple addresses.
*MultisendData can contain only 100 items. Therefore, this type of transaction has a limit of 100 recipent addresses.*

*Data field contents:*

```go
type MultisendData struct {
    List []MultisendDataItem
}

type MultisendDataItem struct {
    Coin  [10]byte
    To    [20]byte
    Value *big.Int
}
```

### Edit candidate transaction

Type: **0x0E**

Transaction for editing existing candidate

*Data field contents:*

```go
type EditCandidateData struct {
    PubKey           []byte
    RewardAddress    [20]byte
    OwnerAddress     [20]byte
}
```

## Minter Check

Minter Check is like an ordinary bank check. Each user of network can
issue check with any amount of coins and pass it to another person.
Receiver will be able to cash a check from arbitrary account.

### Introduction

Checks are prefixed with "Mc". Here is example of a Minter Check:

```
Mcf89b01830f423f8a4d4e5400000000000000843b9aca00b8419b3beac2c6ad88a8bd54d24912754bb820e58345731cb1b9bc0885ee74f9e50a58a80aa990a29c98b05541b266af99d3825bb1e5ed4e540c6e2f7c9b40af9ecc011ca0387fd67ec41be0f1cf92c7d0181368b4c67ab07df2d2384192520d74ff77ace6a04ba0e7ad7b34c64223fe59584bc464d53fcdc7091faaee5df0451254062cfb37
```

Each Minter Check has:
-   **Nonce** - unique "id" of the check.
-   **Coin Symbol** - symbol of coin.
-   **Value** - amount of coins.
-   **GasCoin** - symbol of a coin to pay fee.
-   **Due Block** - defines last block height in which the check can
    be used.
-   **Lock** - secret to prevent hijacking.
-   **Signature** - signature of issuer.

### Check hijacking protection

Minter Checks are issued offline and do not exist in blockchain before
"cashing". So we decided to use special passphrase to protect checks
from hijacking by another person in the moment of activation. Hash of
this passphrase is used as private key in ECDSA to prove that sender is
the one who owns the check.

*TODO: describe algorithm*

### How to issue a Minter Check

For issuing Minter Check you can use our
[Console](https://console.minter.network).

You will need to fill a form:
-   **Nonce** - unique "id" of the check.
-   **Coin Symbol** - symbol of coin.
-   **Gas coin** - symbol of a coin to pay fee.
-   **Value** - amount of coins.
-   **Pass phrase** - secret phrase which you will pass to receiver
    of the check.

### How to cash a Minter Check

To redeem a check user should have:
-   Check itself
-   Secret passphrase

After redeeming balance of user will increased instantly.

### Commission

There is no commission for issuing a check because it done offline. In
the moment of cashing issuer will pay commission.

## Multisignatures

Minter has built-in support for multisignature wallets. Multisignatures,
or technically Accountable Subgroup Multisignatures (ASM), are signature
schemes which enable any subgroup of a set of signers to sign any
message, and reveal to the verifier exactly who the signers were.

Suppose the set of signers is of size *n*. If we validate a signature if
any subgroup of size *k* signs a message, this becomes what is commonly
reffered to as a *k* of *n* multisig in Bitcoin.

Minter Multisig Wallets has 2 main goals:
-   Atomic swaps with sidechains
-   Basic usage to manage funds within Minter Blockchain

### Structure of multisig wallet

Each multisig wallet has:
-   Set of signers with corresponding weights
-   Threshold

Transactions from multisig wallets are proceed identically to the K of N
multisig in Bitcoin, except the multisig fails if the sum of the weights
of signatures is less than the threshold.

### How to create multisig wallet

TO BE DESCRIBED

### How to use multisig wallet

TO BE DESCRIBED

## Commissions

For each transaction sender should pay fee. Fees are measured in
"units".

1 unit = 10^15 pip = 0.001 bip.

### Standard commissions

Here is a list of current fees:

| Type                       | Fee |
|----------------------------|-----|
|**TypeSend**                | 10 units |
|**TypeSellCoin**            | 100 units |
|**TypeSellAllCoin**         | 100 units |
|**TypeBuyCoin**             | 100 units |
|**TypeCreateCoin**          | Depends on the coin symbol length |
|**TypeDeclareCandidacy**    | 10000 units |
|**TypeDelegate**            | 200 units |
|**TypeUnbond**              | 200 units |
|**TypeRedeemCheck**         | 30 units |
|**TypeSetCandidateOnline**  | 100 units |
|**TypeSetCandidateOffline** | 100 units |
|**TypeCreateMultisig**      | 100 units |
|**TypeMultisend**           | 10+(n-1)*5 units |
|**TypeEditCandidate**       | 10000 units |
Also sender should pay extra 2 units per byte in Payload and Service
Data fields.

### Special fees

To issue a coin with short name Coiner should pay extra fee. Fee is
depends on length of Coin Symbol.

3 letters — 1 000 000 bips
4 letters — 100 000 bips
5 letters — 10 000 bips
6 letters — 1000 bips
7-10 letters — 100 bips

## Validators

### Introduction

The Minter Blockchain is based on Tendermint, which relies on a set of
validators that are responsible for committing new blocks in the
blockchain. These validators participate in the consensus protocol by
broadcasting votes which contain cryptographic signatures signed by each
validator's private key.

Validator candidates can bond their own coins and have coins
"delegated", or staked, to them by token holders. The validators are
determined by who has the most stake delegated to them.

Validators and their delegators will earn BIP (MNT) as rewards for
blocks and commissions. Note that validators can set commission on the
rewards their delegators receive as additional incentive.

If validators double sign or frequently offline, their staked coins
(including coins of users that delegated to them) can be slashed. The
penalty depends on the severity of the violation.

### Requirements
Minimal requirements for running Validator's Node in testnet are:

-   4GB RAM
-   200GB SSD
-   x64 2.0 GHz 4 vCPUs

SSD disks are preferable for high transaction throughput.

Recommended:

-   4GB RAM
-   200GB SSD
-   x64 3.4 GHz 8 vCPUs
-   HSM

### Validators limitations
Minter Network has limited number of available slots for validators.

At genesis there are `16` slots. `4` slots will be added each
`518,400` blocks. Maximum number of validators is `256`.

### Rewards
Rewards for blocks and commissions are accumulated and proportionally
(based on stake value) payed once per `12 blocks` (approx 1 minute) to
all active validators (and their delegators).

Block rewards are configured to decrease from 333 to 0 BIP (MNT) in \~7
years.

Delegators receive their rewards at the same time after paying
commission to their validators (commission value is based on
validator's settings).

`10%` from reward going to DAO account.

`10%` from reward going to Developers.

### Rules and fines

Validators have one main responsibility:
-   Be able to constantly run a correct version of the software:
    validators need to make sure that their servers are always online
    and their private keys are not compromised.
If a validator misbehaves, its bonded stake along with its delegators'
stake and will be slashed. The severity of the punishment depends on the
type of fault. There are 3 main faults that can result in slashing of
funds for a validator and its delegators:

-   **Double signing**: If someone reports on chain A that a validator
    signed two blocks at the same height on chain A and chain B, this
    validator will get slashed on chain A
-   **Unavailability**: If a validator's signature has not been
    included in the last 12 blocks, 1% of stake will get slashed and
    validator will be turned off
Note that even if a validator does not intentionally misbehave, it can
still be slashed if its node crashes, looses connectivity, gets DDOSed,
or if its private key is compromised.

### Becoming validator in testnet

1. Install and run Minter Full Node.
2. Get your validator's public key (`minter show_validator`).
3. Go to [Minter
Console](https://testnet.console.minter.network/masternode/) and send 2
transactions:

  Fill and send `Declare candidacy` and `Set candidate online` forms.
  1. Declare candidacy
      Validators should declare their candidacy, after which users
      can delegate and, if they so wish, unbond. Then declaring
      candidacy validator should fill a form:
      -   Address - You will receive rewards to this address and
          will be able to on/off your validator.
      -   Public Key - Paste public key from step 2 *(Mp\...)*.
      -   Commission - Set commission for delegated stakes.
      -   Coin - Enter coin of your stake (i.e. MNT).
      -   Stake - Enter value of your stake in given coin.
  2. Set candidate online
      Validator is **offline** by default. When offline, validator
      is not included in the list of Minter Blockchain validators,
      so he is not receiving any rewards and cannot be punished
      for low availability.
      To turn your validator **on**, you should provide Public Key
      (from step 2 *(Mp\...)*).
      *Note: You should send transaction from address you choose
      in Address field in step 3.1*
4. Done.
  Now you will receive reward as long as your node is running and available.
### DDOS protection. Sentry node architecture
Denial-of-service attacks occur when an attacker sends a flood of
internet traffic to an IP address to prevent the server at the IP
address from connecting to the internet.

An attacker scans the network, tries to learn the IP address of various
validator nodes and disconnect them from communication by flooding them
with traffic.

One recommended way to mitigate these risks is for validators to
carefully structure their network topology in a so-called sentry node
architecture.

Validator nodes should only connect to full-nodes they trust because
they operate them themselves or are run by other validators they know
socially. A validator node will typically run in a data center. Most
data centers provide direct links the networks of major cloud providers.
The validator can use those links to connect to sentry nodes in the
cloud. This shifts the burden of denial-of-service from the validator's
node directly to its sentry nodes, and may require new sentry nodes be
spun up or activated to mitigate attacks on existing ones.

Sentry nodes can be quickly spun up or change their IP addresses.
Because the links to the sentry nodes are in private IP space, an
internet based attacked cannot disturb them directly. This will ensure
validator block proposals and votes always make it to the rest of the
network.

It is expected that good operating procedures on that part of validators
will completely mitigate these threats.

#### Practical instructions

To setup your sentry node architecture you can follow the instructions
below:

Validators nodes should edit their `config.toml`:
```toml
# Comma separated list of nodes to keep persistent connections to
# Do not add private peers to this list if you don't want them advertised
persistent_peers = ["list of sentry nodes"]
# Set true to enable the peer-exchange reactor
pex = false
```

Sentry Nodes should edit their `config.toml`:
```toml
# Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
private_peer_ids = "ipaddress of validator nodes"
```

## Delegator FAQ

### What is a delegator?
People that cannot, or do not want to run validator operations, can
still participate in the staking process as delegators. Indeed,
validators are not chosen based on their own stake but based on their
total stake, which is the sum of their own stake and of the stake that
is delegated to them. This is an important property, as it makes
delegators a safeguard against validators that exhibit bad behavior. If
a validator misbehaves, its delegators will move their staked coins away
from it, thereby reducing its stake. Eventually, if a validator's stake
falls under the top addresses with highest stake, it will exit the
validator set.

Delegators share the rewards of their validators, but they also share
the risks. In terms of rewards, validators and delegators differ in that
validators can apply a commission on the rewards that goes to their
delegator before it is distributed. This commission is known to
delegators beforehand and cannot be changed. In terms of risk,
delegators' coins can be slashed if their validator misbehaves. For
more, see Risks section.

To become delegators, coin holders need to send a "Delegate
transaction" where they specify how many coins they want to bond and to
which validator. Later, if a delegator wants to unbond part or all of
its stake, it needs to send an "Unbond transaction". From there, the
delegator will have to wait 30 days to retrieve its coins.

### Directives of delegators
Being a delegator is not a passive task. Here are the main directives of
a delegator:
- Perform careful due diligence on validators before delegating. If a
    validator misbehaves, part of its total stake, which includes the
    stake of its delegators, can be slashed. Delegators should therefore
    carefully select validators they think will behave correctly.
- Actively monitor their validator after having delegated. Delegators
    should ensure that the validators they're delegating to behaves
    correctly, meaning that they have good uptime, do not get hacked and
    participate in governance. If a delegator is not satisfied with its
    validator, it can unbond and switch to another validator.
### Rewards
Validators and delegators earn rewards in exchange for their services. This
rewards is given in three forms:
- Block rewards
- Transaction fees: Each transaction on the Minter Network comes with
    transactions fees. Fees are distributed to validators and delegators
    in proportion to their stake.
### Validator commission
Each validator's staking pool receives rewards in proportion to its
total stake. However, before this rewards is distributed to delegators
inside the staking pool, the validator can apply a commission. In other
words, delegators have to pay a commission to their validators on the
rewards they earn.

`10%` from reward going to DAO account.

`10%` from reward going to Developers.

Lets consider a validator whose stake (i.e. self-bonded stake +
delegated stake) is 10% of the total stake of all validators. This
validator has 20% self-bonded stake and applies a commission of 10%. Now
let us consider a block with the following rewards:
- 111 Bips as block reward (after subtraction taxes of 20%)
- 10 Bips as transaction fees (after subtraction taxes of 20%)

This amounts to a total of 121 Bips to be distributed among all staking
pools.

Our validator's staking pool represents 10% of the total stake, which
means the pool obtains 12.1 bips. Now let us look at the internal
distribution of rewards:
- Commission = 10% * 80% * 12.1 bips = 0.69696 bips
- Validator's rewards = 20% * 12.1 bips + Commission = 3.11696 bips
- Delegators' total rewards = 80% * 12.1 bips - Commission = 8.98304
    bips
Then, each delegator in the staking pool can claim its portion of the
delegators' total rewards.

### Risks
Staking coins is not free of risk. First, staked coins are locked up,
and retrieving them requires a 30 days waiting period called unbonding
period. Additionally, if a validator misbehaves, a portion of its total
stake can be slashed (i.e. destroyed). This includes the stake of their
delegators.

There are 2 main slashing conditions:
- **Double signing**: If someone reports on chain A that a validator
    signed two blocks at the same height on chain A and chain B, this
    validator will get slashed on chain A
- **Unavailability**: If a validator's signature has not been
    included in the last 12 blocks, 1% of stake will get slashed and
    validator will be turned off
This is why delegators should perform careful due diligence on
validators before delegating. It is also important that delegators
actively monitor the activity of their validators. If a validator
behaves suspiciously or is too often offline, delegators can choose to
unbond from it or switch to another validator. Delegators can also
mitigate risk by distributing their stake across multiple validators.

## Minter SDKs
### GO SDK
-   [minter-go-sdk](https://github.com/MinterTeam/minter-go-sdk) – a pure GO SDK for working with Minter blockchain

### JavaScript SDK
-   [minter-js-sdk](https://github.com/MinterTeam/minter-js-sdk) –
    work with transactions, checks, and deeplinks
-   [minterjs-wallet](https://github.com/MinterTeam/minterjs-wallet) –
    work with mnemonic, private/public key and address
-   [minterjs-tx](https://github.com/MinterTeam/minterjs-tx) –
    low level TX implementation (only for advanced users, use SDK instead)
-   [minterjs-util](https://github.com/MinterTeam/minterjs-util) – a collection of utility functions for Minter

### iOS SDK
-   [minter-ios-core](https://github.com/MinterTeam/minter-ios-core) –
    create, manipulate and sign Minter transactions
-   [minter-ios-explorer](https://github.com/MinterTeam/minter-ios-explorer)
    – communicate with the Minter blockchain through Explorer

### PHP SDK
-   [minter-php-sdk](https://github.com/MinterTeam/minter-php-sdk) – a pure PHP SDK for working with Minter blockchain

### Android SDK
-   [minter-android-core](https://github.com/MinterTeam/minter-android-core)
- foundation for all Minter blockchain operations
- [minter-android-blockchain](https://github.com/MinterTeam/minter-android-blockchain)
- operate with Minter transactions using this sdk
- [minter-android-explorer](https://github.com/MinterTeam/minter-android-explorer)
- communicate with the Minter blockchain through the Explorer

### C++ SDK
- [cpp-minter](https://github.com/MinterTeam/cpp-minter) - build and sign any transaction, generate mnemonic with private and public key

## Node API

### v2 (latest)
[Documentation](https://minterteam.github.io/node-grpc-gateway/)
Testnet base url: `https://testnet.node-api.minter.network/v2/`

### v1 (deprecated)
[Documentation](https://minterteam.github.io/minter-go-node-docs/)
[openapi.yaml](https://github.com/MinterTeam/minter-go-node-docs/blob/gh-pages/openapi.yaml),  [openapi.json](https://github.com/MinterTeam/minter-go-node-docs/blob/gh-pages/openapi.json)
Testnet base url: `https://testnet.node-api.minter.network/`

## Other public services
### Explorer API
[Documentation](https://app.swaggerhub.com/apis-docs/GrKamil/minter-explorer_api)
Testnet base url: `https://testnet.explorer-api.minter.network/api/v1/`
Mainnet base url: `https://explorer-api.minter.network/api/v1/`

### Gate API
Minter Gate is a service to publish prepared transactions to the Minter Network.
  Prefer to use it instead of node, because it provides load balancing and automatical check of transaction success.

[Documentation](https://minterteam.github.io/minter-gate-docs/#section/Introduction)
Testnet base url: `https://testnet.gate-api.minter.network/api/v1/`
Mainnet base url: `https://gate-api.minter.network/api/v1/`

### bip.dev API
Trade BIP through [bip.dev](https://bip.dev)

[Documentation](https://minterteam.github.io/bipdev-docs/)
Url: `https://api.bip.dev/api/`
[Card API documentation (Swagger)](https://app.swaggerhub.com/apis-docs/GrKamil/bipdev-card-api)
Card API url: `https://card-api.bip.dev/api/v1/`


text:
### 2016-05-30

#### swift
* [
      onmyway133
      /
      fantastic-ios-animation
](https://github.com/onmyway133/fantastic-ios-animation):

☔ A collection of iOS animation repos

* [
      Ramotion
      /
      expanding-collection
](https://github.com/Ramotion/expanding-collection):
      ExpandingCollection is a card peek/pop controller

* [
      alexdrone
      /
      Render
](https://github.com/alexdrone/Render):
      Swift and UIKit a la React.

* [
      PureSwift
      /
      Cacao
](https://github.com/PureSwift/Cacao):
      Pure Swift Cross-platform UIKit (Cocoa Touch) implementation (Supports Linux)

* [
      daltonclaybrook
      /
      tween-controller
](https://github.com/daltonclaybrook/tween-controller):
      A toolkit for creating interactive menus and tutorials in Swift

* [
      philackm
      /
      Scrollable-GraphView
](https://github.com/philackm/Scrollable-GraphView):
      An adaptive scrollable graph view for iOS to visualise simple discrete datasets. Written in Swift.

* [
      wangshengjia
      /
      LeeGo
](https://github.com/wangshengjia/LeeGo):
      Declarative, configurable & highly reusable UI development as making Lego bricks.

* [
      MessageKit
      /
      MessageKit
](https://github.com/MessageKit/MessageKit):
      Eventually, a Swift re-write of JSQMessagesViewController

* [
      Alamofire
      /
      Alamofire
](https://github.com/Alamofire/Alamofire):
      Elegant HTTP Networking in Swift

* [
      vsouza
      /
      awesome-ios
](https://github.com/vsouza/awesome-ios):
      A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

* [
      ipader
      /
      SwiftGuide
](https://github.com/ipader/SwiftGuide):
      这份指南汇集了Swift语言主流学习资源，并以开发者的视角整理编排。http://dev.swiftguide.cn

* [
      Ahmed-Ali
      /
      JSONExport
](https://github.com/Ahmed-Ali/JSONExport):
      JSONExport is a desktop application for Mac OS X which enables you to export JSON objects as model classes with their associated constructors, utility methods, setters and getters in your favorite language.

* [
      qutheory
      /
      vapor
](https://github.com/qutheory/vapor):
      A web framework and server for Swift that works on OS X and Ubuntu.

* [
      danielgindi
      /
      Charts
](https://github.com/danielgindi/Charts):
      Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.

* [
      ipraba
      /
      EPSignature
](https://github.com/ipraba/EPSignature):
      Signature component for iOS in Swift

* [
      devxoul
      /
      Then
](https://github.com/devxoul/Then):

✨ Super sweet syntactic sugar for Swift initializers.

* [
      Ramotion
      /
      preview-transition
](https://github.com/Ramotion/preview-transition):
      PreviewTransition is a simple preview gallery controller

* [
      lrtitze
      /
      Swift-VectorBoolean
](https://github.com/lrtitze/Swift-VectorBoolean):
      A Swift iOS rewrite of Andy Finnell's VectorBoolean bezier path tools

* [
      Codeido
      /
      PMAlertController
](https://github.com/Codeido/PMAlertController):
      PMAlertController is a great and customizable substitute to UIAlertController

* [
      goktugyil
      /
      EZSwiftExtensions
](https://github.com/goktugyil/EZSwiftExtensions):

😏 How Swift standard types and classes were supposed to work.

* [
      iAugux
      /
      Phonetic
](https://github.com/iAugux/Phonetic):
      An iOS App to add phonetic keys for Chinese names. Written in Swift.

* [
      dkhamsing
      /
      open-source-ios-apps
](https://github.com/dkhamsing/open-source-ios-apps):

📱 Collaborative List of Open-Source iOS Apps

* [
      krzyzanowskim
      /
      CryptoSwift
](https://github.com/krzyzanowskim/CryptoSwift):
      Crypto related functions and helpers for Swift implemented in Swift programming language

* [
      Zewo
      /
      Reflection
](https://github.com/Zewo/Reflection):
      Reflection provides an API for advanced reflection at runtime including dynamic construction of types

* [
      matteocrippa
      /
      awesome-swift
](https://github.com/matteocrippa/awesome-swift):
      A collaborative list of awesome swift resources. Feel free to contribute!

#### objective-c
* [
      gskbyte
      /
      GSKStretchyHeaderView
](https://github.com/gskbyte/GSKStretchyHeaderView):
      A generic stretchy header for UITableView and UICollectionView

* [
      casatwy
      /
      CTVideoPlayerView
](https://github.com/casatwy/CTVideoPlayerView):
      A video player view for iOS, better than PBJVideoPlayer, which can let you to play multy video at the same time, and provided download, customized operation buttons, customized cover of video

* [
      appsquickly
      /
      XcodeEditor
](https://github.com/appsquickly/XcodeEditor):
      An API for manipulating Xcode project files.

* [
      HZQuan
      /
      Bzier-Animation-FloatingWindow
](https://github.com/HZQuan/Bzier-Animation-FloatingWindow):
* [
      AFNetworking
      /
      AFNetworking
](https://github.com/AFNetworking/AFNetworking):
      A delightful networking framework for iOS, OS X, watchOS, and tvOS.

* [
      jessesquires
      /
      JSQMessagesViewController
](https://github.com/jessesquires/JSQMessagesViewController):
      An elegant messages UI library for iOS

* [
      facebook
      /
      SocketRocket
](https://github.com/facebook/SocketRocket):
      A conforming Objective-C WebSocket client library.

* [
      jackrex
      /
      FakeWeChatLoc
](https://github.com/jackrex/FakeWeChatLoc):
      手把手教你制作一款iOS越狱App

* [
      music4kid
      /
      FastStub-Xcode
](https://github.com/music4kid/FastStub-Xcode):
      Xcode Plugin helps you find missing methods in your class header, protocols, and super class, also makes fast inserting.

* [
      typcn
      /
      bilibili-mac-client
](https://github.com/typcn/bilibili-mac-client):
      An unofficial bilibili client for mac

* [
      ibireme
      /
      YYKit
](https://github.com/ibireme/YYKit):
      A collection of iOS components.

* [
      daniulive
      /
      SmarterStreaming
](https://github.com/daniulive/SmarterStreaming):
      SmarterStreaming系列产品，系daniulive（大牛直播）出品的跨平台视频采集、直播SDK（支持私有协议和RTMP推流，如Windows推流/android推流/iOS推流/Windows播放/android播放/iOS播放），公网毫秒级延迟，也许是国内最靠谱的视频直播推流、播放SDK之一，助您轻松实现类似于花椒、映客、斗鱼手机直播推送与播放。

* [
      realm
      /
      realm-cocoa
](https://github.com/realm/realm-cocoa):
      Realm is a mobile database: a replacement for Core Data & SQLite

* [
      bestswifter
      /
      MySampleCode
](https://github.com/bestswifter/MySampleCode):
      这个项目用于存储我博客中的demo

* [
      rs
      /
      SDWebImage
](https://github.com/rs/SDWebImage):
      Asynchronous image downloader with cache support as a UIImageView category

* [
      slackhq
      /
      SlackTextViewController
](https://github.com/slackhq/SlackTextViewController):
      A drop-in UIViewController subclass with a growing text input view and other useful messaging features

* [
      CoderMJLee
      /
      MJRefresh
](https://github.com/CoderMJLee/MJRefresh):
      An easy way to use pull-to-refresh.

* [
      liuslevis
      /
      GYBootingProtection
](https://github.com/liuslevis/GYBootingProtection):
      A tool for detecting and repairting continuous launch crash of iOS App

* [
      bang590
      /
      JSPatch
](https://github.com/bang590/JSPatch):
      JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally use for hotfix iOS App.

* [
      SnapKit
      /
      Masonry
](https://github.com/SnapKit/Masonry):
      Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout

* [
      CoderJackyHuang
      /
      DownloadManager
](https://github.com/CoderJackyHuang/DownloadManager):
      download demo

* [
      Draveness
      /
      iOS-Source-Code-Analyze
](https://github.com/Draveness/iOS-Source-Code-Analyze):
      深入解析 iOS 开源项目

* [
      banchichen
      /
      TZImagePickerController
](https://github.com/banchichen/TZImagePickerController):
      一个支持多选、选原图和视频的图片选择器，同时有预览功能，适配了iOS6789系统。 A clone of UIImagePickerController, support picking multiple photos、original photo、video, also allow preview photo and video, fitting iOS6789 system.

* [
      BradLarson
      /
      GPUImage
](https://github.com/BradLarson/GPUImage):
      An open source iOS framework for GPU-based image and video processing

* [
      facebook
      /
      AsyncDisplayKit
](https://github.com/facebook/AsyncDisplayKit):
      Smooth asynchronous user interfaces for iOS apps.

#### go
* [
      ory-am
      /
      hydra
](https://github.com/ory-am/hydra):
      Run your own low-latency, cloud native OAuth2 and OpenID Connect provider. Written in Google Go.

* [
      getlantern
      /
      lantern
](https://github.com/getlantern/lantern):

⚡ Open Internet for everyone. Lantern is a free desktop application that delivers fast, reliable and secure access to the open Internet for users in censored regions. It uses a variety of techniques to stay unblocked, including P2P and domain fronting. Lantern relies on users in uncensored regions acting as access points to the open Internet.

* [
      ichinaski
      /
      pxl
](https://github.com/ichinaski/pxl):
      Display images in the terminal

* [
      docker
      /
      docker
](https://github.com/docker/docker):
      Docker - the open-source application container engine

* [
      golang
      /
      go
](https://github.com/golang/go):
      The Go programming language

* [
      xlab
      /
      android-go
](https://github.com/xlab/android-go):
      The android-go project provides a platform for writing native Android apps in Go programming language.

* [
      grammarly
      /
      rocker
](https://github.com/grammarly/rocker):
      Rocker breaks the limits of Dockerfile.

* [
      ory-am
      /
      fosite
](https://github.com/ory-am/fosite):
      Extensible security first OAuth2 and OpenID Connect framework for Google's Go Language.

* [
      uber-go
      /
      zap
](https://github.com/uber-go/zap):
      Fast, structured, leveled logging in Go

* [
      containous
      /
      traefik
](https://github.com/containous/traefik):
      Træfɪk, a modern reverse proxy

* [
      coreos
      /
      dex
](https://github.com/coreos/dex):
      OpenID Connect Identity (OIDC) and OAuth 2.0 Provider with Pluggable Connectors

* [
      kataras
      /
      iris
](https://github.com/kataras/iris):
      Fast, unopinionated, minimalist web framework for Go. Built on top of fasthttp, up to 20x faster than the rest.

* [
      avelino
      /
      awesome-go
](https://github.com/avelino/awesome-go):
      A curated list of awesome Go frameworks, libraries and software

* [
      kubernetes
      /
      kubernetes
](https://github.com/kubernetes/kubernetes):
      Container Cluster Manager from Google

* [
      go-kit
      /
      kit
](https://github.com/go-kit/kit):
      A standard library for microservices.

* [
      syncthing
      /
      syncthing
](https://github.com/syncthing/syncthing):
      Open Source Continuous File Synchronization

* [
      labstack
      /
      echo
](https://github.com/labstack/echo):
      Fast and unfancy HTTP server framework for Go (Golang). Up to 10x faster than the rest.

* [
      astaxie
      /
      beego
](https://github.com/astaxie/beego):
      beego is an open-source, high-performance web framework for the Go programming language.

* [
      otoolep
      /
      go-httpd
](https://github.com/otoolep/go-httpd):
      How to organise a Go HTTP service

* [
      gin-gonic
      /
      gin
](https://github.com/gin-gonic/gin):
      Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

* [
      junegunn
      /
      fzf
](https://github.com/junegunn/fzf):

🌸 A command-line fuzzy finder written in Go

* [
      grafana
      /
      grafana
](https://github.com/grafana/grafana):
      Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB

* [
      pingcap
      /
      tidb
](https://github.com/pingcap/tidb):
      TiDB is a distributed NewSQL database compatible with MySQL protocol

* [
      dineshappavoo
      /
      basex
](https://github.com/dineshappavoo/basex):
      Create Youtube-Like IDs With Golang

* [
      prometheus
      /
      prometheus
](https://github.com/prometheus/prometheus):
      The Prometheus monitoring system and time series database.

#### javascript
* [
      aosabook
      /
      500lines
](https://github.com/aosabook/500lines):
      500 Lines or Less

* [
      FreeCodeCamp
      /
      FreeCodeCamp
](https://github.com/FreeCodeCamp/FreeCodeCamp):
      The https://FreeCodeCamp.com open source codebase and curriculum. Learn to code and help nonprofits.

* [
      parkjs814
      /
      AlgorithmVisualizer
](https://github.com/parkjs814/AlgorithmVisualizer):
      Algorithm Visualizer

* [
      decosoftware
      /
      deco-ide
](https://github.com/decosoftware/deco-ide):
      The React Native IDE

* [
      JensDebergh
      /
      certificate-dashboard
](https://github.com/JensDebergh/certificate-dashboard):
      Dashboard for ssl certificates

* [
      facebook
      /
      react
](https://github.com/facebook/react):
      A declarative, efficient, and flexible JavaScript library for building user interfaces.

* [
      facundoolano
      /
      google-play-keywords
](https://github.com/facundoolano/google-play-keywords):
      Tools for app store optimization on Google Play

* [
      getify
      /
      You-Dont-Know-JS
](https://github.com/getify/You-Dont-Know-JS):
      A book series on JavaScript. @YDKJS on twitter.

* [
      vuejs
      /
      vue
](https://github.com/vuejs/vue):
      Simple yet powerful library for building modern web interfaces.

* [
      airbnb
      /
      javascript
](https://github.com/airbnb/javascript):
      JavaScript Style Guide

* [
      bvaughn
      /
      react-virtualized
](https://github.com/bvaughn/react-virtualized):
      React components for efficiently rendering large lists and tabular data

* [
      AlloyTeam
      /
      AlloyFinger
](https://github.com/AlloyTeam/AlloyFinger):
      super tiny size multi-touch gestures library for the web. 　　　You can touch this →

* [
      mobxjs
      /
      mobx
](https://github.com/mobxjs/mobx):
      Simple, scalable state management.

* [
      futurice
      /
      pepperoni-app-kit
](https://github.com/futurice/pepperoni-app-kit):
      Pepperoni - React Native App Starter Kit for Android and iOS

* [
      d3
      /
      d3
](https://github.com/d3/d3):
      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

* [
      Nickersoft
      /
      push.js
](https://github.com/Nickersoft/push.js):
      A compact, cross-browser solution for using the JavaScript Notifications API

* [
      quorrajs
      /
      Quorra
](https://github.com/quorrajs/Quorra):
      A full fledged, open-source NodeJS MVC framework

* [
      akveo
      /
      blur-admin
](https://github.com/akveo/blur-admin):
      Angular Bootstrap Admin Panel Framework

* [
      brownhci
      /
      WebGazer
](https://github.com/brownhci/WebGazer):
      WebGazer.js: Scalable Webcam EyeTracking Using User Interactions

* [
      reactjs
      /
      redux
](https://github.com/reactjs/redux):
      Predictable state container for JavaScript apps

* [
      mzabriskie
      /
      axios
](https://github.com/mzabriskie/axios):
      Promise based HTTP client for the browser and node.js

* [
      clauderic
      /
      react-infinite-calendar
](https://github.com/clauderic/react-infinite-calendar):

✨ Infinite scrolling date-picker built with React, with localization, themes, keyboard support, and more.

* [
      angular
      /
      angular.js
](https://github.com/angular/angular.js):
      HTML enhanced for web apps

* [
      zafree
      /
      pilpil
](https://github.com/zafree/pilpil):
       Pilpil - Progressive Image Loading

* [
      nodejs
      /
      node
](https://github.com/nodejs/node):
      Node.js JavaScript runtime ✨🐢🚀✨

#### ruby
* [
      zverok
      /
      time_math2
](https://github.com/zverok/time_math2):
      Small library for operations with time steps (like "next day", "floor to hour" and so on)

* [
      fastlane
      /
      fastlane
](https://github.com/fastlane/fastlane):
      The easiest way to automate building and releasing your iOS and Android apps

* [
      piotrmurach
      /
      tty-command
](https://github.com/piotrmurach/tty-command):
      Execute shell commands with pretty output logging and capture stdout, stderr and exit status.

* [
      jekyll
      /
      jekyll
](https://github.com/jekyll/jekyll):

🌐 Jekyll is a blog-aware, static site generator in Ruby

* [
      ruby
      /
      ruby
](https://github.com/ruby/ruby):
      The Ruby Programming Language

* [
      jondot
      /
      awesome-react-native
](https://github.com/jondot/awesome-react-native):
      An "awesome" type curated list of React Native components, news, tools, and learning material

* [
      doorkeeper-gem
      /
      doorkeeper
](https://github.com/doorkeeper-gem/doorkeeper):
      Doorkeeper is an OAuth 2 provider for Rails

* [
      Homebrew
      /
      brew
](https://github.com/Homebrew/brew):

🍺 The missing package manager for OS X

* [
      discourse
      /
      discourse
](https://github.com/discourse/discourse):
      A platform for community discussion. Free, open, simple.

* [
      rails
      /
      rails
](https://github.com/rails/rails):
      Ruby on Rails

* [
      caskroom
      /
      homebrew-cask
](https://github.com/caskroom/homebrew-cask):
      A CLI workflow for the administration of Mac applications distributed as binaries

* [
      andypike
      /
      rectify
](https://github.com/andypike/rectify):
      Build more maintainable Rails apps

* [
      Thibaut
      /
      devdocs
](https://github.com/Thibaut/devdocs):
      API Documentation Browser

* [
      plataformatec
      /
      devise
](https://github.com/plataformatec/devise):
      Flexible authentication solution for Rails with Warden.

* [
      danger
      /
      danger
](https://github.com/danger/danger):
      Stop saying "you forgot to …" in code review

* [
      sass
      /
      sass
](https://github.com/sass/sass):
      Sass makes CSS fun again.

* [
      Homebrew
      /
      legacy-homebrew
](https://github.com/Homebrew/legacy-homebrew):

💀 The former home of 🍺 the missing package manager for OS X

* [
      hanami
      /
      hanami
](https://github.com/hanami/hanami):
      The web, with simplicity.

* [
      kilimchoi
      /
      engineering-blogs
](https://github.com/kilimchoi/engineering-blogs):
      A curated list of engineering blogs

* [
      tmuxinator
      /
      tmuxinator
](https://github.com/tmuxinator/tmuxinator):
      Manage complex tmux sessions easily

* [
      mitchellh
      /
      vagrant
](https://github.com/mitchellh/vagrant):
      Vagrant is a tool for building and distributing development environments.

* [
      gitlabhq
      /
      gitlabhq
](https://github.com/gitlabhq/gitlabhq):
      GitLab is version control for your server | Please open issues in our issue tracker on GitLab.com

* [
      CocoaPods
      /
      CocoaPods
](https://github.com/CocoaPods/CocoaPods):
      The Cocoa Dependency Manager.

* [
      rapid7
      /
      metasploit-framework
](https://github.com/rapid7/metasploit-framework):
      Metasploit Framework

* [
      capistrano
      /
      capistrano
](https://github.com/capistrano/capistrano):
      Remote multi-server automation tool

repository: josephyzhou/github-trending

gha_language: Go

repo_name: josephyzhou/github-trending


text:
PHP mktemp
==========

Create temporary files and directories in PHP, safely.

Sadly PHP is deficient when it comes to creating temporary files and directories
in a safe and secure manner. This library aims to address these short-comings.

Usage
-----

### Functions

* `Cs278\Mktemp\temporaryFile(string|null $template, string|null $dir)`

  Create a temporary file with a supplied template for the name.

  The template should be a string containing a sequence of 3 consecutive `X`
  characters, these characters will be replaced with a random component. If this
  argument is `null` a default `tmp.XXXXXX` template will be used.

  The directory should be a path that exists and the user can write to, if this
  argument is not supplied the default temporary directory will be used.

  A `Cs278\Mktemp\Exception\CreateFailedException` will be thrown if a file
  cannot be created.

  ```php
  use function Cs278\Mktemp\temporaryFile;

  var_dump(temporaryFile());
  // /tmp/tmp.P9aLnd
  var_dump(temporaryFile('output.XXXX.pdf'));
  // /tmp/output.oI7b.pdf
  var_dump(temporaryFile(null, '/var/tmp'));
  // /var/tmp/tmp.8uJx
  var_dump(temporaryFile('test.XXX.html', '/var/tmp'));
  // /var/tmp/test.9h2.html
  ```

* `Cs278\Mktemp\temporaryDir(string|null $template, string|null $dir)`

  Create a temporary directory with a supplied template for the name.

  The template should be a string containing a sequence of 3 consecutive `X`
  characters, these characters will be replaced with a random component. If this
  argument is `null` a default `tmp.XXXXXX` template will be used.

  The directory should be a path that exists and the user can write to, if this
  argument is not supplied the default temporary directory will be used.

  A `Cs278\Mktemp\Exception\CreateFailedException` will be thrown if a directory
  cannot be created.

  ```php
  use function Cs278\Mktemp\temporaryDir;

  var_dump(temporaryDir());
  // /tmp/tmp.P9aLnd
  var_dump(temporaryDir('output.XXXX.pdf'));
  // /tmp/output.oI7b.pdf
  var_dump(temporaryDir(null, '/var/tmp'));
  // /var/tmp/tmp.8uJx
  var_dump(temporaryDir('test.XXX.html', '/var/tmp'));
  // /var/tmp/test.9h2.html
  ```

### `Cs278\Mktemp\TempFile`

* `TempFile::__construct(string|null $template, string|null $dir)`

  Create a temporary file object that manages the life cycle of the file system
  entity.

  Arguments are the same as those documented for `temporaryFile()`.

* `TempFile::getPath()`

  Return the path to the temporary file, this is mainly intended to be used when
  interacting with the file outside of PHP.

* `TempFile::open(string $mode)`

  Open the file for reading/writing according to the supplied mode, defaults to
  `r+`. Returns an `\SplFileObject` that maybe used to manipulate the contents
  of the temporary file.

* `TempFile::keep(string $newPath)`

  Persist the temporary file into permanent file at the path specified, returns
  a new `\SplFileInfo` representing the new file.

* `TempFile::copyTo(resource $stream)`

  Copy the contents of the file into the supplied stream.

* `TempFile::release()`

  Removes the temporary file from disk.

gha_language: PHP


text:
### Create password file
First install relevant tools
```
apt -y install apache2-utils
```
Next create the file. Usually it has "hidden" name like `.htpasswd` (with dot) but I don't care here
```
htpasswd -c htpasswd USERNAME
```
Type password when prompted

### Build the image
```
docker build -t schema-server .
```
### Run the container
```
docker run -p 8888:80 schema-server
```

repository: gitarte/how-to-nginx

repo_name: gitarte/how-to-nginx


text:
---
layout: post
title:      "Memorize These Methods: NOPE!"
date:       2020-04-03 14:06:35 -0400
permalink:  memorize_these_methods_nope
---

There are a couple of places in the curriculum where the prose explicitly instructs students to memorize certain concepts, methods, functions, etc. I'm here to say the same thing I said when my ninth grade teacher told us that the best way to be decent human beings was to memorize a whole bunch of prayers: Nope. But also Nope, Nope and ***Nope***.

![Nope!](https://i.giphy.com/media/yMaLDA976YtUs/giphy.webp)

Lots of times in life educators reach for memorization. They tell us it's the way to be useful, it's the way to remember, and that it's core to whatever topic we're trying to master. But again, typically, not so much.

There are *very* limited uses for memorizing things like that. If a thing is worth knowing, and will come up, you'll be able to build muscle memory by constantly needing it. And yes, for the first dozen or so times, you'll need to look it up. But that seems *far* superior to me than spending hours upon hours drilling something into your brain.

There are obvious exceptions. I'd imagine doctors need to memorize lots of drug-related dosage info and interactions. In the midst of a life-saving proceedure, there might not be *time* to look it up. But in coding, there's nothing you can't just read the docs for when you need it.

(And if you're thinking, "but interviews!", a reasonable interview should be asking you about concepts, ideas, implementations, etc., but very much *not* to whiteboard-repeat some built-in function. It's *far* more relevant for them to test your Googling skills than your memorization skills.)

![I *could* spend hours memorizing this, but why in the ever loving universe would I *bother*?](https://p37.f2.n0.cdn.getcloudapp.com/items/NQuZ6PwK/Nope.png?v=bf06579ad3c74aed4ad4849304b2f3e6)

> One such snippet ^. I *could* spend hours memorizing this, but why in the ever loving universe would I *bother*?

In coding, it seems far more useful to develop instincts about what sort of methods are useful in which cases, than to memorize literally *anything*. For one thing, best practices are constantly changing. For another, you can always just look it up. And like all things, the more you do it, the more you'll remember it, and pretty soon you'll have memorized it without noticing it, and certainly without going back to grade-school study habits.

I'm sure sections like these are well intentioned, but when I read them, I just see "you're going to use these a lot, consider bookmarking some of the docs that best help you understand them."

I'd recommend you do the same.

extension: markdown