text:
![Unity Pool Manager](https://github.com/MathewHDYT/Unity-Pool-Manager-UPM/blob/main/logo.png/)

[![MIT license](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://lbesson.mit-license.org/)
[![Unity](https://img.shields.io/badge/Unity-2018.1%2B-green.svg?style=flat-square)](https://docs.unity3d.com/2018.1/Documentation/Manual/index.html)
[![GitHub release](https://img.shields.io/github/release/MathewHDYT/Unity-Pool-Manager-UPM/all.svg?style=flat-square)](https://github.com/MathewHDYT/Unity-Pool-Manager-UPM/releases/)
[![GitHub downloads](https://img.shields.io/github/downloads/MathewHDYT/Unity-Pool-Manager-UPM/all.svg?style=flat-square)](https://github.com/MathewHDYT/Unity-Pool-Manager-UPM/releases/)

# Unity Pool Manager (UPM)
Used to easily create and manage instances of prefabs as pools of a given size, that saves having to utilize destroy and instantiate when wanting to use an instance of that prefab.

## Contents
- [Unity Pool Manager (UPM)](#unity-pool-manager-upm)
  - [Contents](#contents)
  - [Introduction](#introduction)
  - [Installation](#installation)
- [Documentation](#documentation)
  - [Reference to Pool Manager Script](#reference-to-pool-manager-script)
  - [Spawning Pool Objects](#spawning-pool-objects)
  - [Overriding the derived PoolObject Class](#overriding-the-derived-poolobject-class)
  - [Public accesible methods](#public-accesible-methods)
  	- [Create Pool method](#create-pool-method)
  	- [Parent Pool method](#parent-pool-method)
  	- [Increase Pool Size method](#increase-pool-size-method)
  	- [Enable Dynamic Pooling method](#enable-dynamic-pooling-method)
  	- [Reuse Object method](#reuse-object-method)

## Introduction
A lot of games need to instantiate and destroy prefabs at runtime and this small and easily integrated Pool Manager can help you create pools of isntances from prefabs of a given size to make sure that there are never more instances of that object then you actually need in the scene.

**Unity Pool Manager implements the following methods consisting of a way to:**
- Create a pool with a given size (see [Create Pool method](#create-pool-method))
- Parent a pool to a given gameObject (see [Parent Pool method](#parent-pool-method))
- Increase the pool size at runtime (see [Increase Pool Size method](#increase-pool-size-method))
- En -or disable dynamic pooling, to create new slots in the pool once there are only visible instances to reuse (see [Enable Dynamic Pooling method](#enable-dynamic-pooling-method))
- Reuse an Pool Object from the given pool (see [Reuse Object method](#reuse-object-method))

For each method there is a description on how to call it and how to use it correctly for your game in the given section.

## Installation
**Required Software:**
- [Unity](https://unity3d.com/get-unity/download) Ver. 2020.3.17f1

The Pool Manager itself is version independent, as long as .NET5 already exists. Additionally the example project can be opened with Unity itself or the newest release can be downloaded and exectued to test the functionality.

If you prefer the first method, you can simply install the shown Unity version and after installing it you can download the project and open it in Unity (see [Opening a Project in Unity](https://docs.unity3d.com/2021.2/Documentation/Manual/GettingStartedOpeningProjects.html)). Then you can start the game with the play button to test the Pool Managers functionality.

To simply use the Pool Manager in your own project without downloading the Unity project get the ```PoolManager.CS``` and ```PoolObject.CS``` files in the **Example Project/Assets/Scritps/** called or alternatively get them from the newest release (may not include the newest changes) and save them in your own project. Then create a new empty ```gameObject``` and attach the ```PoolManager.CS``` script to it. Now you can easily add pools like shown in [Create Pool method](#create-pool-method).

# Documentation
This documentation strives to explain how to start using the Pool Manager in your project and explains how to call and how to use its publicly accesible methods correctly.

## Reference to Pool Manager Script
To use the Pool Manager to start creating pools outside of itself you need to reference it. As the Pool Manager is a [Singelton](https://stackoverflow.com/questions/2155688/what-is-a-singleton-in-c) this can be done easily when we get the instance and save it as a private variable in the script that uses the Pool Manager.

```csharp
private PoolManager pm;

void Start() {
    pm = PoolManager.instance;
    // Calling method in PoolManager
    pm.CreatePool(this.gameObject, 10);
}
```

Alternatively you can directly call the methods this is not advised tough, if it is executed multiple times or you're going to need the instance multiple times in the same file.

```csharp
void Start() {
    PoolManager.CreatePool(this.gameObject, 10);
}
```

## Spawning Pool Objects
Additionaly the ```WeightedObject.CS``` file can be included to make a lootTable, where certain ```poolObjects``` have a higher change of being spawned then others.

**To add a new ```weightedObject``` to the lootTable simply create a new element in the Weighted Objects array with the properties:**
- ```Game Object``` (The Game ```poolObject``` that should be *instantiated* or *destroyed* when utilizing the pool)
- ```Weight``` (How likely it is that the weight is choosen divide the total weight of all elements by the weight of this element * 100 to get a procentual amount)
- ```Spawn Amount``` (How many ```poolObjects``` we want to have in our pool --> Pool Size)

![Image of WeightedObject Script](https://image.prntscr.com/image/MrIZOJggTeS1xGJKUIGtMw.png)

For this the random ```poolObject``` we want to choose from need to be saved into a list of ```weightedObjects``` and ordered by their value in a descending order.

```csharp
[Header("Spawn Object Settings:")]
[SerializeField]
private List<WeightedObject> weightedObjects;

private int weightTotal = 1;

private void Start() {
    // Create a pool and its parent for each weightedObject.
    foreach (var spawnPrefab in weightedObjects) {
        pm.CreatePool(spawnPrefab.gameObject, spawnPrefab.spawnAmount);
        pm.ParentPool(spawnPrefab.gameObject, this.transform);
        weightTotal += spawnPrefab.weight;
    }
    // Order weightedObjects by their assigned weight.
    weightedObjects = weightedObjects.OrderByDescending(x => x.weight).ToList();
}
```

If we create a pool for each ```weightedObjects```, we can now choose a random one of them while still utilizing the weight we've assigned earlier.

```csharp
private GameObject GetRandomSpawnPrefab() {
    int randomNumber = Random.Range(0, weightTotal);
    int weightSum = 0;

    foreach (var spawnPrefab in weightedObjects) {
        weightSum += spawnPrefab.weight;
        if (randomNumber < weightSum) {
            return spawnPrefab.gameObject;
        }
    }

    return null;
}
```

Now that we have a ```gameObject```, we can simply reuse one of these ```gameObjects``` from the pool with the [Reuse Object method](#reuse-object-method).

## Overriding the derived PoolObject Class
**If needed the ```PoolObject``` can implement the derived class to use certain calls like:**
- On Object Reuse (called when the object gets reused from the [Reuse Object method](#reuse-object-method))
- Set Velocity (called when the object gets reused from the [Reuse Object method](#reuse-object-method) with an additional ```Vector2``` that includes the velocity given to the method)
- On Became Invisble (called when the object isn't rendered anymore by the camera see [OnBecameInvisible Docs](https://docs.unity3d.com/2021.2/Documentation/ScriptReference/MonoBehaviour.OnBecameInvisible.html) for more information)
- On Became Visible (called when the object gets rendered again by the camera see [OnBecameVisible Docs](https://docs.unity3d.com/2021.2/Documentation/ScriptReference/MonoBehaviour.OnBecameVisible.html) for more information)

For this you simply need to create a new class that implements the ```PoolObject``` class and then ```override``` the ```virtual``` methods (see [Overriding virtual methods](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/virtual)).

## Public accesible methods
This section explains all public accesible methods, especially what they do, how to call them and when using them might be advantageous instead of other methods. We always assume PoolManager instance has been already referenced in the script. If you haven't done that already see [Reference to Pool Manager Script](#reference-to-pool-manager-script).

### Create Pool method
**What it does:**
Instantiates and disables the given amount of prefabs and adds them into the poolDictionary.

**How to call it:**
- ```Prefab``` is the prefab we want to save into our pool
- ```PoolSize``` is the amount of instances of the prefabs we want to create for our pool
- ```DynamicPooling``` defines if the poolSize should increase dynamically, if there are only visible instances of the given prefab to use

```csharp
GameObject prefab = this.gameObject;
int poolSize = 25;
bool dynamicPooling = false;
pm.CreatePool(prefab, poolSize, dynamicPooling);
```

Alternatively you can call the methods with less paramters as some of them have default arguments.

```csharp
GameObject prefab = this.gameObject;
int poolSize = 25;
pm.CreatePool(prefab, poolSize);
```

**When to use it:**
When you want to create a pool with a given size for a given gameObject.

### Parent Pool method
**What it does:**
Changes the parent of the pool with the instances of the given prefab.

**How to call it:**
- ```Prefab``` is the prefab we want to change the pool parent at
- ```Parent``` is the new parent we want to set our pool under

```csharp
GameObject prefab = this.gameObject;
Tranform parent = this.transform;
pm.ParentPool(prefab, parent);
```

**When to use it:**
When you want to change the parent of a pool to show all of the pools under the Pool Manager for example.

### Increase Pool Size method
**What it does:**
Instantiates and disables the given amount of prefabs and adds them into the poolDictionary into the already existing pool.

**How to call it:**
- ```Prefab``` is the prefab we want to save into our pool
- ```Difference``` is the additional amount of instances of the prefab we want to save into our pool

```csharp
GameObject prefab = this.gameObject;
int difference = 1;
pm.IncreasePoolSize(prefab, difference);
```

**When to use it:**
When you want to increase the size of an already existing pool at runtime, because the space is running out and causing popping.

### Enable Dynamic Pooling method
**What it does:**
En -or disables dynamic pooling on the pool with the instances of the given prefab.

**How to call it:**
- ```Prefab``` is the prefab we want to en -or disable dynamic pooling on the pool off.
- ```DynamicPooling``` defines if the poolSize should increase dynamically, if there are only visible instances of the given prefab to use

```csharp
GameObject prefab = this.gameObject;
bool dynamicPooling = true;
pm.EnableDynamicPooling(prefab, dynamicPooling);
```

Alternatively you can call the methods with less paramters as some of them have default arguments.

```csharp
GameObject prefab = this.gameObject;
pm.EnableDynamicPooling(prefab);
```

**When to use it:**
When you want to en -or disable dynamic pooling on a given pool, because it is not needed anymore or becomes needed after a certain switch in gameplay.

### Reuse Object method
**What it does:**
Reuses or uses one of the instances in the pool of the given prefab.

**How to call it:**
- ```Prefab``` is the prefab we want to reuse one of the instances from the pool from
- ```Position``` is the new position the instance should have after enabling it again
- ```Rotation``` is the new rotation the instance should have after enabling it again
- ```Velocity``` is the new velocity the instance should have after enabling it again

```csharp
GameObject prefab = this.gameObject;
Vector3 position = Vector3.zero;
Quaternion rotation = Quaternion.identity;
Vector2 velocity = Vector2.zero;
pm.ReuseObject(prefab, position, rotation, velocity);
```

Alternatively you can call the methods with less paramters as some of them have default arguments.

```csharp
GameObject prefab = this.gameObject;
pm.ReuseObject(prefab);
```

**When to use it:**
When you want to use one of the instances in the pool of the given prefabs to spawn them in a new location with a given velocity and rotation.

repository: MathewHDYT/Unity-Pool-Manager

repo_name: MathewHDYT/Unity-Pool-Manager


text:
# TCP over gRPC Tunnel

**Contributors**:
James Protzman, Carl Lebsack, Rob Shakir

**February, 2019**
*Updated*: February 2021

<!-- MarkdownTOC -->

- [TCP over gRPC Tunnel](#tcp-over-grpc-tunnel)
  - [Objective](#objective)
  - [Background](#background)
  - [Overview](#overview)
  - [Detailed Design](#detailed-design)
    - [Tunnel Proto Design](#tunnel-proto-design)
    - [Data Message Fields](#data-message-fields)
      - [Tag Field](#tag-field)
      - [Data Field](#data-field)
      - [Close Field](#close-field)
    - [RegisterOp Message Fields](#registerop-message-fields)
    - [Session Message Fields](#session-message-fields)
      - [Tag Field](#tag-field-1)
      - [Accept Field](#accept-field)
      - [Target ID Field](#target-id-field)
      - [Target Type Field](#target-type-field)
      - [Error Field](#error-field)
    - [Target Message Fields](#target-message-fields)
      - [Op Field](#op-field)
      - [Accept / Target ID/ Target Type / Error Fields](#accept--target-id-target-type--error-fields)
    - [Subscription Message Fields](#subscription-message-fields)
      - [Op Field](#op-field-1)
      - [Accept Fields](#accept-fields)
      - [Target Type Fields](#target-type-fields)
      - [Error Fields](#error-fields)
    - [Handlers](#handlers)
    - [Tunnel Client](#tunnel-client)
    - [Tunnel Server](#tunnel-server)
    - [Target Registration](#target-registration)
    - [Subscription](#subscription)
    - [Bridge Mode](#bridge-mode)

<!-- /MarkdownTOC -->

## Objective

To create a transparent, bi-directional TCP-over-gRPC tunnel.

## Background

gRPC is a service based strictly around a client-server model in order to send a
gRPC request. gRPC Requests are executed on the server, and the result(s) are
returned to the client. If the client is unable to reach the server for any
reason, then it is not possible to send the request.

Common reasons that a gRPC client would be unable to communicate with a server
include:

*   the server is behind a firewall with ACLs preventing inbound connections
*   the server is behind a router implementing address translation (NAT)
*   other operational requirements which prevent outside connections

See the figure below for an example:

![gRPC Request Is Blocked at the Firewall / Router](images/grpctunnel-blocked-example.png "gRPC Request Is Blocked at the Firewall / Router")

Additional references and discussion:

[gRPC tunneling (Github issue)](https://github.com/grpc/grpc/issues/14101)
[gRPC-in-gRPC tunneling](https://github.com/jhump/grpctunnel)

## Overview

In the cases outlined above, it could be preferable to instantiate a connection
in reverse (server to client) between the gRPC client and server rather than
modifying the infrastructure between them. However, there is no mechanism built
into the gRPC library which supports reverse connections.

This document proposes an approach which will allow a gRPC client and server to
communicate using a TCP over gRPC tunnel. The tunnel will support external
connections from either endpoint over TCP and forward them using gRPC streams.
It’s possible that this tunnel could be used to forward more than gRPC traffic.

An overview of how the tunnel works from both client and server sides follows:

**Server side**:

1.  A new session, identified by a unique string, is requested from the tunnel
    server.
1.  The tunnel server forwards a request through the register stream.
1.  If the tunnel client can handle this request, it will do 2 things:
    1.  create a new tunnel stream to the tunnel server, and
    1.  call the tunnel client defined handler on the stream.
1.  The tunnel server will accept and return the stream.

More detail can be found in the [server section](#server) below.

**Client side**:

1.  A new session, identified by a unique string, is requested from the tunnel
    client.
1.  The tunnel client forwards a request through the register stream.
1.  The tunnel server will send an accepted request back to the tunnel client on
    the register stream.
2.  The tunnel client will
    1.  create a new tunnel stream to the tunnel server, and
    2.  return the stream.
3.  The tunnel server will accept the stream, and call the tunnel client defined
    handler.

More detail can be found in the [client section](#client) below.

The figure below illustrates the communication:

![gRPC Client and Server Communicate Through Tunnel](images/grpctunnel-client-server.png "gRPC Client and Server Communicate Through Tunnel")

## Detailed Design

### Tunnel Proto Design

```
service Tunnel {
  rpc Register(stream RegisterOp) returns (stream RegisterOp);
  rpc Tunnel(stream Data) returns (stream Data);
}

message Data {
  int32 tag = 1;
  bytes data = 2;
  bool close = 3;
}

message RegisterOp {
  oneof Registration {
    Target target = 1;
    Session session = 2;
    Subscription subscription = 3;
  }
}

enum TargetType {
  UNKNOWN = 0;
  SSH = 22;
  OPENFLOW = 6653;
  GNMI_GNOI = 9339;
  P4_RUNTIME = 9559;
}

message Target {
  enum TargetOp {
    UNKNOWN = 0;
    ADD = 1;
    REMOVE = 2;
  }
  TargetOp op = 1;
  bool accept = 2;
  string target = 3;
  string target_type = 4;
  string error = 5;
}

message Session {
  int32 tag = 1;
  bool accept = 2;
  string target = 3;
  string target_type = 4;
  string error = 5;
}

message Subscription {
  enum SubscriptionOp {
    UNKNOWN = 0;
    SUBCRIBE = 1;
    UNSUBCRIBE = 2;
  }
  SubscriptionOp op = 1;
  bool accept = 2;
  string target_type = 3;
  string error = 4;
}

```

**Tunnel protobuf definition**

The tunnel proto defines a gRPC service, `Tunnel`, which defines two rpc
methods:

1. a `Register` method which allows the tunnel server to request new tunnel
streams from the tunnel client using
[RegisterOp messages](#registerop-message-fields), and
2. a `Tunnel` method, which is used to create new tunnel streams. These streams
forward the data from TCP streams over a bi-directional gRPC stream of [data
messages](#data-message-fields).

Each field is described in the next section.

### Data Message Fields

#### Tag Field

The tunnel `tag` field is used by the tunnel endpoints to ensure the correct
tunnel streams are used to forward the correct TCP client connections.

#### Data Field

The `data` field is used to encapsulate raw bytes received from the client code.
This data will be forwarded, unchanged through the tunnel
endpoints, to the proper destination. This allows the tunnel to potentially
handle non-gRPC connections.

#### Close Field

The `close` field is used by the tunnel endpoints to know when forwarding has
finished - usually signalled by the TCP connection reaching EOF or going idle.
Once this boolean is set, the tunnel client and tunnel server will clean up the
associated tunnel connections.

### RegisterOp Message Fields

RegisterOp can be one of Target, Session or Subscription message.

### Session Message Fields

#### Tag Field

The `tag` field in the register service is used by the tunnel endpoints to
request new tunnel streams for a certain tag.  This tag defines the set of tags
used by the [data message tag field](#tag-field). By default, the tunnel server
uses positive tags, and the tunnel client uses negative tags. They start at 1,
and -1, respectively to disambiguate 0.

#### Accept Field

The `accept` field is sent by the tunnel server to indicate that it added an
associated connection in its map. This allows a new tunnel session from the
tunnel client to be handled correctly.

#### Target ID Field

The `target` field is used by the register handler on either the tunnel
server or client to define what the handler function can handle. This is
explained in more detail in the [handlers](#handler-field) sections below.

#### Target Type Field

The `target_type` represents the type of targets. It is use together with
target in most cases.

#### Error Field

The `error` field is used by the tunnel client and tunnel server to exchange
errors encountered when requesting new sessions.

### Target Message Fields

#### Op Field

The `op` field is used to represent different registration operations
(ADD/REMOVE/UNKNOWN).

#### Accept / Target ID/ Target Type / Error Fields

These fields carry the same meaning as the corresponding fields in the Session
message.

### Subscription Message Fields

#### Op Field

The `op` field is used to represent different subscription operations
(subscribe/unsubscribe/unknown).

#### Accept Fields

The `accept` field is sent by the tunnel server to indicate that the
subscription is successful.

#### Target Type Fields

The `type_type` field is used to indicate the eligible targets. If it is empty,
the server will assume that the tunnel client wants to subscribe everything.

#### Error Fields

The `error` field is used by the server to send back errors if the subscription
is unsuccessful.

### Handlers

There are two handlers used by the tunnel: the register handler function, and
the handler function itself. The register handler function defines what the
handler function will accept. A handler function and register handler are
required on one end of the tunnel in order to forward traffic, as they handle
what is done with a stream on the opposing side of a new session request.

### Tunnel Client

A new client will be created and started using the `NewClient`. When the tunnel
client is started, it will attempt to connect to the tunnel server over the
register gRPC service. If it is successful, the tunnel client
[registers](#target-registration) its target id and target type. If configured,
the tunnel client will also [subscribe](#subscription) targets from the tunnel
server. At this point, the tunnel server and section](#server) below will cover
new session requests from the tunnel server perspective.

When `NewSession` is called on the tunnel client, it will send a register
request to the tunnel server. The tunnel server will check if it can handle the
register request via the tunnel server register handler. This handler will
return an error if it cannot handle the requested session. If it can handle it,
the tunnel server will send an accepted register session back to the tunnel
client and the tunnel client will start a new tunnel stream, using the tunnel
gRPC service. At this time, all register requests sent to the tunnel client
should contain the accept message. The rationale is that the tunnel client will
only receive requests from the tunnel server which are ready to have a new
tunnel session created for them.

This stream is passed to the tunnel server handler function on the tunnel
server, and returned to `NewSession` on the tunnel client side. See the timing
diagram below.

![Successful NewSession on Client](images/grpctunnel-client-newsession.png "Successful NewSession on Client")

### Tunnel Server

A tunnel server will need to be created using `grpc.NewServer` and the exported
`NewServer` method from this tunnel package.  Once the tunnel server is
listening, it will accept a connection from a tunnel client. The new tunnel
server will then wait for new session requests.

When `NewSession` is called on the tunnel server, it will send a register
request, with an accept to the tunnel client. The tunnel client will then check if
it can handle the request, and if it can, it will create a new tunnel session
to the tunnel server. The tunnel session is then forwarded to the tunnel client
handler function on the tunnel client, and returned to the `NewSession` request
on the tunnel server.

### Target Registration

During registration, a client will send a `Target` message to register its
target (ID and type). The tunnel server will check if the target is already
registered. It will return an error message not accepted (e.g. target already
exists) or return an accepted acknowledgement message otherwise. A target
addition handler will be called.

Once the tunnel is up running, subsequent addition and deletion of targets are
also supported.

### Subscription

During registration, a client sends an `subscription` message to subscribe
targets from the tunnel server. The subscription can be either by target type
or everything if the `target_type` field is empty. Once the tunnel server
receives the subscription, it will send a list of filtered targets back to
client as `Target` message. After sending the whole list, it sends an accepted
message. The tunnel server will also send updates to all corresponding
subscribers when a target is added or deleted.

Once the tunnel is up running, subsequent subscription and unsubscription are
also supported.

### Bridge Mode

The bridge mode is a special session initiated from a client, where the
requested target is `remote` to tunnel server. It is initiated in the same way
as non-bridge session via `NewSession` while the target ID and type corresponds
to a `remote` target for the tunnel server.

Upon receiving such request, tunnel server will check if the request corresponds
to a`remote` target (otherwise, it will be treated as a normal new session
request as in [Client](#client)). Next, the bridge reigster handler and tunnel
handler will be called, where it will call `NewSession` to create  a new session
to the `remote` client, and start a continuous bi-direcitonal copy between the
newly created session (with the `remote` client) and the session with the
original client.

repository: fieldju/grpctunnel

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: fieldju/grpctunnel


text:
# Emercoin Instance

This Microsoft Azure template deploys a single Emercoin client which will connect to the public Emercoin network.

Once your deployment is complete you will be able to connect to the Emercoin public network.

![Emercoin-Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/blockchain/images/emercoin.png)

# Emercoin Deployment Walkthrough
1. Get your node's IP
 1. browse to https://portal.azure.com

 2. then click browse all, followed by "resource groups", and choose your resource group

 3. then expand your resources, and public ip address of your node.

2. Connect to your node
 1. SSH to the public ip of your node as the user you specified for `adminUsername`, enter your `adminPassword`
 2. Try to use the cli-client by `emc help` or `emc getinfo`
 3. Point your browser to the public ip of your node, sign in with `adminUsername` and `adminPassword` specified before (note that browser may show you a warning of bad certificate - it's OK, you may replace the self-signed certificates by yours at /etc/ssl/emc/emcweb*)

license: MIT

repository: MSBrett/azure-quickstart-templates

gha_language: Shell

gha_license_id: MIT

repo_name: MSBrett/azure-quickstart-templates


text:
> WARNING!
> WIP: ready for production as bootstrap, but still work in progress

# IgnitialIO app

## What is this ?

IgnitialIO (or ignitial.io, or IIOS) web application template allows you to use
IgnitialIO toolbox for deploying micro-services based web apps.

It provides the capability to build all your app features as a service, which we
can summarize as below:

>
> Evertyhing is service
>

More information on IIOS can be found on in the
[IIOS Github repository](https://github.com/ignitialio/iio-services).

Current template is a bootstrap for accessing IIOS thourgh a web app based
on [VueJS](https://vuejs.org/) front-end side.

Backend uses [connect](https://www.npmjs.com/package/connect) and
[connect-rest](https://www.npmjs.com/package/connect-rest), as well as
[socket.io](https://www.npmjs.com/package/socket.io) for serving static files,
communicate with the front-end and provide additional REST APIs.

Two services must be provided in any case:
- data service allowing database access. Here we use IIOS base _dlake_ service
configured to use MongoDB
- authentication service that controls access to IIO services based on roles. This
is used even if no authentication is required (= anonymous users only). Current
template uses _auth_ base service which implements JSONWebToken based authentication.

## Creation

An web app based on IIOS can be created as below:

```bash
# installs IIO CLI tool
npm install -g @ignitial/iio-cli

# create an app with name myapp (creates folder as well)
iio create app myapp
```

> WARNING: Take care to always have the latest iio-cli version

This bootstraps a folder with a ready to run app that you can modify or incrementally
complete with your own features.

You can implement any feature through IIOS services that allow you to inject new
UI components.

## Use in development

### Install dependencies

```bash
npm i
```

### Populate database for development

Database and authentication service need a minimum set of info (eg. roles) in
order to run web app. Then, you need to populate database before starting your
app:

```bash
npm run dev:config:populate
```

Here we use mongodb as primary database (user info is a MongoDB collection), then
we populate a MongoDB whose name is the one defined in the configuration.

Configuration uses environment variables to overwrite default values. For the db,
you need to update __IIOS_DBNAME__ env variable. We do this in the script that
executes populate, __scripts/populate_db-mongo.sh__ in our case, since Mongo is
concerned:

```bash
export IIOS_DBNAME=ignitialio
```

RBAC information is populated as well in Redis. Then, we need to define IIOS
namespace in order to let script know which one to use in Redis database:

```bash
export IIOS_NAMESPACE=ignitialio
```

### Auto-populate

Starting with _dlake:3.2.0_ an automated populate is done by the _dlake_ service.
It creates the minimal roles and access rights as per the template needs, as well
as an _admin_ user (password: _toto13!_).

### Configure

We can configure application through two different methods:
- using JS and environment variables (_server/config_)
- using YAML configuration file template and related generated config data using
_iio-cli_

Currently, applicaiton is configured to use YAML configuration by default. See
_dev_start.sh_ script to check it:

```bash

#!/bin/sh

if command -v iio 2>/dev/null; then
  iio infra dev
  # HERE ------------------------------------------------
  iio config app generate
  # -----------------------------------------------------
  if [ $? -ne 0 ]
  then
    echo "iio version must be >=2.2.1: 'npm i -g @ignitial/iio-cli'"
    exit 1
  fi
else
  echo "iio not installed: 'npm i -g @ignitial/iio-cli'"
  exit 1
fi
```

Command _iio config app generate_ will generate json configuration in the
_server/config_ folder. It uses _config/app.yaml_ for that, while _app.yaml_
references _config/i18n.yaml_ file for i18n translations.
When generated file detected, it is automatically used for providing application
configuration.

The same can be done for Kubernetes deployments. That time it is necessary to use
a ConfigMap receipe, which is already done in the template.
You just need to update _k8s/config/deploy.yaml_ and _k8s/config/app.yaml_ as per
your needs. First one defines Kubernetes related configuration (mainly references
used in K8S receipes), while the second one is equivalent to _config/app.yaml_
file, but for K8S deploy.

### Run for development

#### Build dev image

```bash
npm run docker:build
```

In the dev mode, source code from the local directory is used within the image,
so you need to install node dependencies before starting:

```bash
npm i
```

#### Start app and associated services

```bash
npm run dev:start
```

#### Stop and clean up

```bash
npm run dev:stop
```

### Run with minikube

> __Note__
>
> You need minikube installed and configured.

First, you need to create app and dlake images and publish them to minikube docker
environment:

```bash
npm run docker:build
npm run docker:publish:minikube
```

> __Note__
>
> This uses _ignitial/dlake_ and _ignitial/auth_ images published on Docker Hub.

```bash
iio deploy
```

And it works:

[![asciicast](https://asciinema.org/a/0lgSjc7qy526Mgqj6DUTmSSWx.svg)](https://asciinema.org/a/0lgSjc7qy526Mgqj6DUTmSSWx)

#### Clean up

```bash
iio remove
```

> _WARNING_: this will erase Redis persistent volume and then you will lose current
> roles and users. On production deploy, you need to separate PV management from
> deployment itself.

> __Note__
>
> This will not stop minikube cluster.

### Run for production

You need first to push app image to some private registry (currently targets
GitLab one, but you can obviously conifigure tour own replacing that registry
name).

```bash
npm run docker:publish:private
```

Then you need to update your .kube/config file or to point out any kubeconfig file
that targets the right Kubernetes cluster (in this second situation, you need to
update accordingly related _cluster.kubeConfigPath_ in _k8s/config/deploy.yaml_
file). Then, same as previously:

```bash
iio deploy
```

Done !

repository: ignitialio/iio-app-template

repo_name: ignitialio/iio-app-template


text:
# About

In Swift, [functions][functions] are also values that are associated with names, though the syntax used to declare a function differs from that used to declare a constant or a variable. They are defined using the `func` keyword followed by a pair of parentheses enclosing a comma-separated list of parameter names where these names include an [argument label and a parameter name][argument labels] followed by a [type annotation][type annotations]. The argument label is used to refer to a parameter when the function is _called_ and the parameter name is used to refer to the parameter's value inside the function body. The parameter list is followed by `->` and the type of the value returned by the function. Note that the type annotations for the parameters are required and can not be inferred by the compiler. If the return type of the function is `Void`, i.e. `()`, the `-> ()` or `-> Void` may be omitted.

let fifteen = add10(to: 5)
Finally, this is followed by the body of the function enclosed in a pair of curly braces. For example:

```swift
func add10(to x: Int) -> Int {
  return x + 10
}

// calling add10
let fifteen = add10(to: 5)
```

There are two variations of this syntax:

1. If the author of the function does not want the caller of the function to use an argument label, the label is replaced with an underscore, `_`.
2. If the author of the function wants the argument label to be the same as the parameter name, the argument label may be completely omitted.

```swift
func square(_ x: Int) -> Int {
  return x * x
}

func area(radius: Double) -> Double {
  return Double.pi * radius * radius
}

// calling square
let twentyFive = square(5)
// calling area
let circleArea = area(radius: 2.71828)
```

All three of these variants may be used within the same function definition:

```swift
func add(_ x: Int, and y: Int, doubleResult: Bool) -> Int {
  let sum = x + y
  if doubleResult {
    return sum * 2
  } else {
    return sum
  }

let twentySix = add(6, and: 7, doubleResult: true)
}
```

Within the body of a function, parameters are treated as constants, not variables.

[functions]: https://docs.swift.org/swift-book/LanguageGuide/Functions.html
[argument labels]: https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html#ID166
[type annotations]: https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html#ID312

repository: adauguet/swift

branch_name: refs/heads/main

repo_name: adauguet/swift


text:
# GitFindCommitter

[![CircleCI](https://circleci.com/gh/shoyan/git_find_committer/tree/master.svg?style=svg)](https://circleci.com/gh/shoyan/git_find_committer/tree/master)

The git_find_commiter is a tool to seek committers from the commit history of git.
This tool will help the code review your team.

In Japanese.

* http://48n.jp/blog/2016/07/25/introduce-to-git-find-committer/

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'git_find_committer'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install git_find_committer

## Usage

```ruby
require 'git_find_committer'

committer = GitFindCommitter.search(repo: 'balloonbros/sutekki', branch: 'add-ui')
=> [{:name=>"Shohei Yamasaki", :commit_count=>51}, {:name=>"keitakawamoto", :commit_count=>21}]
committer.names(1)
=> ["Shohei Yamasaki"]
```

## Working with GitHub Enterprise

With a bit of setup, you can also use GitFindCommitter with your Github Enterprise instance.

```ruby
GitFindCommitter.configure do |c|
  c.url = "https://<hostname>"
  c.access_token = "<your 40 char token>"
end
```

## Filtering

You can filter the committers.

```ruby
GitFindCommitter.configure do |c|
  c.available_committer_name = %w(shoyan)
end
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/git_find_committer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

gha_language: Ruby


text:
# cURL Scripts: SalesForce with OpenID Connect

Each directory is the name of a workflow.

```
code/   OpenID Connect workflow with Authorization Codes
```

## OpenID Connect

I used this guide to figure out which parameters were supposed to be in the
request body vs. query string.

https://help.salesforce.com/articleView?id=sf.remoteaccess_oauth_web_server_flow.htm&type=5

## Environment

### `direnv` for environment settings (secrets)

Try using direnv from HomeBrew: https://formulae.brew.sh/formula/direnv#default

1. Install `direnv` and the hook, by adding the `eval` call __at the bottom__ of
   your shell initializer (`.zshrc` and the like).  Yes, it really has to be at
   the bottom.
1. Make sure you are in the directory containing `.envrc[-template]`.
1. Copy `.envrc-template` to `.envrc` and fill in the values from SalesForce
   (Setup -> Manage Connected Apps -> <your app> -> Enable OAuth settings -> API
   -> Consumer Key/Secret).
1. Say `direnv allow` in this directory, and `direnv` should export those
   environment variables with your secrets.

### jq

Install `jq` with homebrew for later JSON parsing.  It's the bees' knees.

repository: kkrull/shell-sandbox

repo_name: kkrull/shell-sandbox


text:
Alfresco Share "Create Link" Action
===================================

Description
-----------
**"Create Link"** is a custom Alfresco Share Document Library action, similar to "Copy to...", but instead of copying, it creates a link (shortcut, reference) to the document.

With standard Alfresco Share, if you want a document to be accessible from multiple locations, it must be physically copied. "Create Link" action allows a single document stored in Alfresco to be accessible from multiple locations without duplicating the document. A user who is able to access the primary document is able to create a reference in any number of locations that links back to the physical document. Any changes made to the physical document or its metadata are immediately accessible from all referenced locations. Once you have a link created, you can use standard Alfresco Share actions to delete a link without affecting primary document, or to navigate to the folder where primary document resides.

This project uses Alfresco (Maven) SDK. Implementation is based on Alfresco Explorer "Paste as Link" Shelf's functionality, which means that links created by either actions should behave the same way.

Installation
------------
You can find ready-to-install alfresco and share AMP's on [releases](https://github.com/skomarica/alfresco-share-create-link/releases) page.

Alternatively, you can clone this repository and use `mvn install` to build AMP's from the latest source code.

> ###Compatibility
|Module version|Alfresco version|Java version|Alfresco (Maven) SDK|
|--------------|----------------|------------|------------------|
|v1.0.0|4.2.x, 5.0.a|Java 7|1.1.1|

Using
-----
Using "Create Link" action is similar to using "Copy to..." or "Move to..." out-of-the box Alfresco Share actions:

1. Navigate to a document in your Document Library (e.g. "My File.docx") you want to create link to and execute "Create Link" action
2. Select a target folder where you want your link to be created and confirm the dialog (you will need write permissions on selected folder)
3. A node of type "app:filelink" pointing to "My File.docx" will be created within the selected folder, with appropriate thumbnail and name like "Link to: My File.docx"

License, support, maintenance
-----------------------------
This is an open-source project, distributed under Apache License (v2.0). It's supplied free of charge, with no formal support, maintenance or warranty. If you find a bug related to this functionality or you have some nice enhancement in mind, feel free to raise an issue or, even better, implement a solution and contribute it back to the project.

FAQ
---
> #### What is an AMP file and how can I install it?
An [AMP](https://wiki.alfresco.com/wiki/AMP_Files) file is a standard way of distributing Alfresco extensions. Use [Module Management Tool](https://wiki.alfresco.com/wiki/Module_Management_Tool) to apply "create-link-repo.amp" to "alfresco.war", and "create-link-share.amp" to "share.war" application. [Official documentation](http://docs.alfresco.com/) is always a good reference.

> #### What is Alfresco (Maven) SDK and how can I use it?
There is a great [tutorial](http://ecmarchitect.com/alfresco-developer-series-tutorials/maven-sdk/tutorial/tutorial.html) on how to get started with Alfresco Maven SDK. [Official documentation](http://docs.alfresco.com/) is always a good reference.

> #### Can I create a link to folder?
Although the creation of links to folder is supported by backend mechanism, I did not intentionally add "Create Link" action to the folder-browse and folder-details action groups. The reason for this is the way Alfresco Share application works with links (even with those created using Alfresco Explorer Shelf "Paste as Link" functionality):
* Document link points to the document details view which is fine and expected
* Folder link points to the folder details view and clicking the folder link will not navigate you to the linked folder path, displaying folder's content, but to the folder details view

> #### Why am I getting an error "Link creation could not be completed"?
Common reasons for getting such error message are:
* You have not correctly installed "create-link-repo.amp" to "alfresco.war"
* You already have a link with the same name within a selected folder

repository: gdavydov/museum-collections

repo_name: gdavydov/museum-collections


text:
---
title: APISIX variable
keywords:
 - Apache APISIX
 - API Gateway
 - APISIX variable
description: This article describes the variables supported by Apache APISIX.
---

<!--
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
-->

## Description

Besides [NGINX variable](http://nginx.org/en/docs/varindex.html), APISIX also provides
additional variables.

## List of variables

|   Variable Name     |  Origin    | Description                                                                         | Example        |
|-------------------- | ---------- | ----------------------------------------------------------------------------------- | -------------  |
| balancer_ip         | core       | The IP of picked upstream server.                                                   | <IP_ADDRESS>    |
| balancer_port       | core       | The port of picked upstream server.                                                 | 80             |
| consumer_name       | core       | Username of Consumer.                                                               |                |
| consumer_group_id   | core       | Group ID of Consumer.                                                               |                |
| graphql_name        | core       | The [operation name](https://graphql.org/learn/queries/#operation-name) of GraphQL. | HeroComparison |
| graphql_operation   | core       | The operation type of GraphQL.                                                      | mutation       |
| graphql_root_fields | core       | The top level fields of GraphQL.                                                    | ["hero"]       |
| mqtt_client_id      | mqtt-proxy | The client id in MQTT protocol.                                                     |                |
| route_id            | core       | Id of Route.                                                                        |                |
| route_name          | core       | Name of Route.                                                                      |                |
| service_id          | core       | Id of Service.                                                                      |                |
| service_name        | core       | Name of Service.                                                                    |                |
| redis_cmd_line      | Redis      | The content of Redis command.                                                       |                |
| resp_body           | core       | In the logger plugin, if some of the plugins support logging of response body, for example by configuring `include_resp_body: true`, then this variable can be used in the log format. |                |
| rpc_time            | xRPC       | Time spent at the rpc request level.                                                |                |

You can also register your own [variable](./plugin-develop.md#register-custom-variable).

repository: apache/apisix

gha_language: Lua

repo_name: apache/apisix


text:
# Approval2

A trivial implementation of the 4 eyes principle. All record actions require an approval to take effect.

Models that require an approval have a column called approval_status, a value of U implies that the record is un-approved, and a value of A implies that the record is approved.

A default scope on the model ensures that only records with approval_status = 'A' are used.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'approval2'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install approval2

## Usage

The gem provides a generator to get started

```ruby
rails g approval2:install
```
This creates a migration for unapproved_records, and its associated model & controller. This is used to keep track of all unapproved records across the application, and can be used to create an 'approval worklist'.

Models that need an approval, should have the following columns

1. approval_status
2. approved_version
3. approved_id
4. last_action

These columns can be added by calling 'approval_columns' in the migration. This method is added by the gem to the TableGeneator.

In addition to these columns, the model should include the module Approval2::ModelAdditions in its class.

The gem does not yet modify the routes, and an approve action needs to be added for each model manually.

All unique indexes on the model need to be modified to include 'approval_status' as an additional column, this is required because the Edit action creates a new record.

## The Approval Cycle

### Create
When a record is created, it has approval_status 'U', and a entry is added to unapproved_records.

When the record is approved, the approval_status is updated from 'U' to 'A'

### Edit
When a record is edited, a clone of the record is created. This clone has approval_status = 'U and the approved_version and approved_id is set to the lock_version & id of the record that was edited. This clone is persisted, and you now have 2 records in the table, one with approval_status = A (the record that was edited, but without any changes), and one with approval_status = U (the clone, with the changes applied).

When the changes are approved, the record with approval_status = 'A' is deleted, and the approval_status of the cloned record is changed from 'U' to 'A'. To prevent buried updates, this is done only if the lock_version of the A record is still the same as the approved_version of the U record . ( It is expected that any application that updates such records increments lock_version whenever it updates an A record)

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/approval2. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
---
hrs_structure:
  division: '2'
  volume: '10'
  title: '25'
  chapter: '437'
  section: 437-34
type: hrs_section
tags:
  - Business
menu:
  hrs:
    identifier: HRS_0437-0034
    parent: HRS0437
    name: '437-34 Credit sale contracts, when purchase of unlawful'
weight: 18200
title: 'Credit sale contracts, when purchase of unlawful'
full_title: '437-34 Credit sale contracts, when purchase of unlawful'
---
**§437-34 Credit sale contracts, when purchase of unlawful.** No person engaged in the business of buying credit sale contracts from motor vehicle dealers in this State, and no officer, agent, or representative of such person, shall purchase or attempt to purchase any such credit sale contract from any motor vehicle dealer in this State:

(1) When the dealer in consequence of any contract, agreement, or arrangement between such person and a manufacturer or distributor supplying motor vehicles to the dealer has been induced or coerced to sell such credit sale contract by means of any statement, suggestion, promise, or threat, made, directly or indirectly, that the manufacturer or distributor supplying motor vehicles to the dealer would in any manner injure or benefit the dealer, or by means of any act of the manufacturer or distributor that has benefited or injured the dealer, or by means of any statement or representation, made, directly or indirectly, that the dealer is under any obligation whatsoever to make such sale;

(2) When such person has received or has contracted to receive from any manufacturer or distributor supplying motor vehicles to the dealer, or has given or contracted to give to the manufacturer or distributor, any subsidy or thing of service or value, where the effect of the giving or receiving of such subsidy or thing of service or value may be to lessen or eliminate competition in the business of purchasing credit sale contracts from motor vehicle dealers or tend to grant an unfair trade advantage or to create a monopoly in such person. [L 1939, c 258, §18; RL 1945, §7379; am L 1951, c 90, pt of §1; RL 1955, §160-179; [HRS §437-34](/title-25/chapter-437/section-437-34/); am L 1987, c 283, §29]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# v0.4.1

* Fixed race condition that occured if you called pause during a flush.

# v0.4.0

* Fixed misspelling of `delimiter` [#40](https://github.com/C2FO/fast-csv/issues/40)

# v0.3.1

* Added transform support to formatters
   * When using `createWriteStream` you can now you the `transform` method to specify a row transformer.
   * When using other transform methods you can specify a `transform` option.

# v0.3.0

* You can now specify `objectMode` when parsing a csv which will cause `data` events to have an object emitted.
* You can now pipe directly to the stream returned from `createWriteStream`
* You can now transform csvs by piping output from parsing into a formatter.

# v0.2.5

* Fixed issue where not all rows are emitted when using `pause` and `resume`

# v0.2.4

* Added more fine grained control to `.pause` and `.resume`
   * You can now pause resume between chunks

# v0.2.3

* Add new `createWriteStream` for creating a streaming csv writer

# v0.2.2

* Fixed issue with having line breaks containing `\r\n`

# v0.2.1

* Fixed issue with `\r` line break in parser

# v0.2.0

* Added multiline value support
* Updated escaping logic
* More performance enhancements
* More robusts test cases
* Removed support for having two quote types instead it just supports a single quote and escape sequence.
 Source code (zip)

# v0.1.2

* Fixed issue with formatter handling undefined or null values.
* Changed formatter not not include a new line at the end of a CSV.
* Added pause and resume functionality to ParserStream

# v0.1.1

* Added trim, ltrim, and rtrim to parsing options

# v0.1.0

repository: wei-lee/fast-csv

repo_name: wei-lee/fast-csv


text:
# Get your State Pension Frontend
[![Build Status](https://travis-ci.org/dwp/gysp-customer-frontend.svg?branch=master)](https://travis-ci.org/dwp/gysp-customer-frontend) [![Known Vulnerabilities](https://snyk.io/test/github/dwp/gysp-customer-frontend/badge.svg)](https://snyk.io/test/github/dwp/gysp-customer-frontend)

Frontend service for Get your State Pension.

### Requirements

* Docker 18.0.0+
* Docker compose 1.23.0+

#### Config

Use the provided `.env.example` file to create your own `.env` file and complete the config.

### Running Locally

#### Running

```
make up
```

This will now be available at your configured URL, default is: `http://localhost:3001`.

#### Stopping

To stop the app running, in the terminal window press `CTRL` + `C`.

### Running in DEV/TEST

There are various system variables that need to be set for the application to run correctly in different environments, most have some form of default.

### Testing

#### Requirements

* Node.JS v16.0.0+
* npm v8.1.2

There is a few options for testing within the application, these have been configured on GitLab CI. Testing uses [mocha](https://github.com/mochajs/mocha), [chai](https://github.com/chaijs/chai) and [istanbul](https://gotwarlost.github.io/istanbul/).

Setup:
```
npm install
```

Unit tests:
```
npm run test
```

Code coverage:
```
npm run quality
```

repository: dwp/gysp-customer-frontend

gha_language: JavaScript

repo_name: dwp/gysp-customer-frontend


text:
# Relevant xkcd

Inspiration: https://twitter.com/adithya_balaji/status/1330287375327563781?s=20

## Installation

```shell
pip install -r requirements.txt
```

## Instructions

Tested on python 3.8

- Setup virtualenv / install requirements
- Run `get_xkcd_data.py`
- [Setup GoogleCloudAPI Credentials](https://cloud.google.com/bigquery/docs/reference/libraries#setting_up_authentication)
- Add credentials to `~/.config/gcloud_creds.json`
- Run `get_reddit_data.py`

    - NOTE: run this at your own risk (it should fall under the free tier, but no
      guarantees)

## Plan

- [x] Get Data
- [ ] Figure out how to get main topics of a random piece of text
  * Use this to be able to benchmark eventual solution
- [ ] Look into search metrics for suggestion relevance which you can use to
measure the later steps
- [ ] Build simple version of idea that uses just cosine similarity with title
- [ ] Build more complex version that uses simple machine learning model to
predict relevance using NLP techniques
- [ ] Try GPT-3 semantic search approach


text:
# Blockz
A clone of the mobile game "Ballz"

-------------------------------------

## About Ballz

![Ballz logo](ref_imgs/ballz_logo.jpg)

Ballz is a mobile game created by the game studio Ketchapp,
where the objective is to collect ballz and use them to
destroy squares of differing health values.

-------------------------------------

The goal of this project is to recreate the game in its
entirety, save the ads and cosmetic upgrade system.

This game uses cookies to save your high score or progress.

-------------------------------------

## Known bugs
* There are a lot

-------------------------------------

## TODO
* Figure out music that should play in menu and in game
* Add tutorial to main menu if needed later
* Rework aim line to be more faithful
* Implement go faster button by increasing speed and fps
* Tighten up collision engine
* Fix sometimes absolutely annihilating blocks
* Maybe add more empty squares to BlockzGame
* Add note about low power mode

-------------------------------------
## Contact me
Email me at<EMAIL_ADDRESS>
-------------------------------------
## Images

![Gameplay](ref_imgs/ballzimg.jpg)
![Homescreen](ref_imgs/ballz_homescreen.jpg)

repository: jamescommons/blockz

repo_name: jamescommons/blockz


text:
### Movie'N'Chill

Search for new movie releases or find some old ones with my movie search application that will give you all the information you need.

Live preview: [Movie'N'Chill](https://www.sekenikola.com/movienchill/)

### Prerequisites

What things you need to install the software and how to install them

- npm

```
npm install npm@latest -g
```

### Installing

1. Clone the repo

2. Run npm install inside project root

```
npm install or npm i
```

3. Start the server

```
npm start
```

## Built With

* [React](https://reactjs.org/) - The JavaScript framework used
* [Redux](https://redux.js.org/) - State Management
* [SASS](https://sass-lang.com/) - CSS Pre-Processor

[![build status](https://img.shields.io/travis/reduxjs/react-redux/master.svg?style=flat-square)](https://travis-ci.org/reduxjs/react-redux) [![npm version](https://img.shields.io/npm/v/react-redux.svg?style=flat-square)](https://www.npmjs.com/package/react-redux)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/react)


text:
---
published: false
title: "Day 1"
excerpt: "May 25th - Stepping on the road of my challenge"
header:
  teaser: "teaser_unsplash_road.jpg"
  image: "header_unsplash_road.jpg"
  caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
categories:
  - Personal
tags:
  - diary
  - meditation

---

{% include base_path %}

*Day One* of my [challenge]({{ base_path }}/personal/planning/)! I could hardly have picked a tougher day to start. I was very tired in the morning after staying up late yesterday. But therefore I am even more proud, that I sticked to my planned dedicated training sessions.

Since I was greeted with drizzle when getting up I only spend half of my morning session outdoors with swinging and a round of focus shifting between near and distance points. Even on this cloudy day  I could hardly manage in the last repetition using both eyes to keep the focus on the horizon for long. It feels like being
dazzled by the bright sky and I have to blink a lot and can only stay with it for a short period of time using my hands to provide some shadow for my eyes.

I continued inside with a lamp to simulate sun bathing. I much prefer doing this exercise on a sunny morning outdoors, but it still helped to feeling more awake after finishing the morning routine with a 15 minutes meditation using [Headspace](https://www.headspace.com){:target="_blank" rel="nofollow"}. I really love this app for building up a daily meditation practise. Combining the eye relaxation with calming your mind feels double beneficial, especially if you are already used to the concept.

In the afternoon I decided once more to stay indoors for focus shifting and a colour therapy cycle. Seeing the afterglow worked really well today working with green and magenta.


text:
#### A Study of WebRTC Security
#### http://webrtc-security.github.io/
##### Excerpts:
```A signaling protocol is not specified within WebRTC, allowing developers to implement their own choice of protocol. This allows for a deeper degree of flexibility in adapting a WebRTC app for a specific use case or scenario.```

gha_language: HTML


text:
## Getting started on Alibaba Cloud with the Batch Compute Service

### Prerequisites

This tutorial page relies on completing the previous tutorials:

- [Configuration Files](ConfigurationFiles.md)

### Goals

In this tutorial you'll learn to run the first workflow against the Batch Compute service on Alibaba Cloud.

### Let's get started!

####

#### Configuring Alibaba Cloud

- Go to Alibaba Cloud and activate Alibaba Cloud OSS and Alibaba Cloud BatchCompute services.
- Follow AccessKey Guide to retrieve an access-id and access-key pair. We will refer to this pair as `<test-access-id>` and `<test-access-key>`, respectively.
- Log on to the OSS console and choose a region to create a new bucket. We will use `<test-region>` and `<test-bucket>` to refer the chosen region and bucket.
- Find the corresponding OSS endpoint in OSS region and endpoint. We will refer to it as `<test-oss-endpoint>`.

#### Preparing workflow source files

Copy over the sample `echo.wdl` and `echo.inputs` files to the same directory as the Cromwell jar.
This workflow takes a string value as an output file name and writes "Hello World!" to the file.

***echo.wdl***

```
task echo {
  String out

  command {
    echo Hello World! > ${out}
  }

  output {
    File outFile = "${out}"
    Array[String] content = read_lines(outFile)
  }
}

workflow wf_echo {
  call echo
  output {
    echo.outFile
    echo.content
  }
}
```

***echo.inputs***

```
{
  "wf_echo.echo.out": "output"
}
```

#### Configuration file for Alibaba Cloud

Copy over the sample `bcs.conf` file to the same directory that contains your sample WDL, inputs and the Cromwell jar. Replace `<test-bucket>`, `<test-region>`, `<test-access-id>`, `<test-access-key>`, `<test-oss-endpoint>` in the configuration file with actual values.

***bcs.conf***

```
include required(classpath("application"))

backend {
  default = "BCS"

  providers {
    BCS {
      actor-factory = "cromwell.backend.impl.bcs.BcsBackendLifecycleActorFactory"
      config {
        root = "oss://<test-bucket>/cromwell-dir"
        region = "<test-region>"
        access-id = "<test-access-id>"
        access-key = "<test-access-key>"

        filesystems {
          oss {
            auth {
              endpoint = "<test-oss-endpoint>"
              access-id = "<test-access-id>"
              access-key = "<test-access-key>"
            }
          }
        }

        default-runtime-attributes {
          failOnStderr: false
          continueOnReturnCode: 0
          cluster: "OnDemand ecs.sn1ne.large img-ubuntu"
          vpc: "<IP_ADDRESS>/16"
        }
      }
    }
  }
}
```

#### Run workflow

`java -Dconfig.file=bcs.conf -jar cromwell.jar run echo.wdl --inputs echo.inputs`

#### Outputs

The end of your workflow logs should report the workflow outputs.

```
[info] SingleWorkflowRunnerActor workflow finished with status 'Succeeded'.
{
  "outputs": {
    "wf_echo.echo.outFile": "oss://<test-bucket>/cromwell-dir/wf_echo/38b088b2-5131-4ea0-a161-4cf2ca8d15ac/call-echo/output",
    "wf_echo.echo.content": ["Hello World!"]
  },
  "id": "38b088b2-5131-4ea0-a161-4cf2ca8d15ac"
}
```

repository: EpamLifeSciencesTeam/cromwell

branch_name: refs/heads/develop

gha_language: Scala

gha_license_id: NOASSERTION

repo_name: EpamLifeSciencesTeam/cromwell


text:
---
title: "Fly Reference Guide"
layout: docs
sitemap: false
nav: firecracker
---

In the Fly Reference Section, you will find the definitive documentation for Fly features and Fly tools.

## _About Fly_

* [**Architecture**](/docs/reference/architecture/):
A detailed view of Fly's implementation of Firecracker VMs, Scaling, Anycast networking, Proxies, and the Backhaul network, all of which come together to create Fly's infrastructure.

* [**Regions**](/docs/reference/regions/):
Fly's global locations are listed here so you can stay up to date with the expanding list.

## _Creating and Deploying Applications_

* [**App Configuration (fly.toml)**](/docs/reference/configuration/):
Each App on Fly.io has a configuration file called `fly.toml` which determines how the App is built, how its networking is configured, how the App scales and more. This section covers all the settings you can use.

* [**Builders**](/docs/reference/builders/):
Fly supports multiple ways of assembling applications into deployable images. These are the builders and this section covers the four builders that currently exist on Fly.

* [**Runtime Environment**](/docs/reference/runtime-environment/):
This section covers the environment variables set when an App runs on Fly and the request headers which provide Apps with information about incoming connections.

* [**Scaling**](/docs/reference/scaling/):
Fly is able to scale an App in various dimensions. This section looks at each and how to configure them for your App.

* [**Secrets**](/docs/reference/secrets/):
Every App has a store for secrets. The secrets are exported to the running App through environment variables. Learn how to set and use secrets in this section and find out how they work with deployments to help secure your App.

## _Network Services_

* [**Public Networking**](/docs/reference/services/):
This section looks at Fly's networking and its support for IPv4 and IPv6 addresses via Anycast, automated TLS and HTTP middleware, proxies, and TCP passthrough.

* [**Private Networking**](/docs/reference/privatenetwork/):
Fly's Private Networking provides secure connections between your applications and a VPN option that allows you to connect into your Fly organization and do the same from your desktop or mobile device. It uses WireGuard and DNS to provide connectivity and discoverability. Find out how to use it in your applications, and how to install and configure the VPN in this section.

* [**Redis**](/docs/reference/redis/):
The Redis key/value store is integrated into the Fly infrastructure and this section covers how you can access it to enable hashing and caching.

repository: SpaYco/docs

repo_name: SpaYco/docs


text:
## 6.5.0

- CSP: Remove source expression deduplication. (@lgarron) https://github.com/github/secure_headers/pull/499

## 6.4.0

- CSP: Add support for trusted-types, require-trusted-types-for directive (@JackMc): https://github.com/github/secure_headers/pull/486

## 6.3.4

- CSP: Do not deduplicate alternate schema source expressions (@keithamus): https://github.com/github/secure_headers/pull/478

## 6.3.3

Fix hash generation for indented helper methods (@rahearn)

## 6.3.2

Add support for style-src-attr, style-src-elem, script-src-attr, and script-src-elem directives (@ggalmazor)

## 6.3.1

Fixes deprecation warnings when running under ruby 2.7

## 6.3.0

Fixes newline injection issue

## 6.2.0

Fixes semicolon injection issue reported by @mvgijssel see https://github.com/twitter/secure_headers/issues/418

## 6.1.2

Adds the ability to specify `SameSite=none` with the same configurability as `Strict`/`Lax` in order to disable Chrome's soon-to-be-lax-by-default state.

## 6.1.1

Adds the ability to disable the automatically-appended `'unsafe-inline'` value when nonces are used #404 (@will)

## 6.1

Adds support for navigate-to, prefetch-src, and require-sri-for #395

NOTE: this version is a breaking change due to the removal of HPKP. Remove the HPKP config, the standard is dead. Apologies for not doing a proper deprecate/major rev cycle :pray:

## 6.0

- See the [upgrading to 6.0](docs/upgrading-to-6-0.md) guide for the breaking changes.

## 5.0.5

- A release to deprecate `SecureHeaders::Configuration#get` in prep for 6.x

## 5.0.4

- Adds support for `nonced_stylesheet_pack_tag` #373 (@paulfri)

## 5.0.3

- Add nonced versions of Rails link/include tags #372 (@steveh)

## 5.0.2

- Updates `Referrer-Policy` header to support multiple policy values

## 5.0.1

- Updates `Expect-CT` header to use a comma separator between directives, as specified in the most current spec.

## 5.0.0

Well this is a little embarassing. 4.0 was supposed to set the secure/httponly/samesite=lax attributes on cookies by default but it didn't. Now it does. - See the [upgrading to 5.0](docs/upgrading-to-5-0.md) guide.

## 4.0.1

- Adds support for `worker-src` CSP directive to 4.x line (https://github.com/twitter/secureheaders/pull/364)

## 4.0

- See the [upgrading to 4.0](docs/upgrading-to-4-0.md) guide. Lots of breaking changes.

## 3.7.2

- Adds support for `worker-src` CSP directive to 3.x line (https://github.com/twitter/secureheaders/pull/364)

## 3.7.1

Fix support for the sandbox attribute of CSP. `true` and `[]` represent the maximally restricted policy (`sandbox;`) and validate other values.

## 3.7.0

Adds support for the `Expect-CT` header (@jacobbednarz: https://github.com/twitter/secureheaders/pull/322)

## 3.6.7

Actually set manifest-src when configured. https://github.com/twitter/secureheaders/pull/339 Thanks @carlosantoniodasilva!

## 3.6.5

Update clear-site-data header to use current format specified by the specification.

## 3.6.4

Fix case where mixing frame-src/child-src dynamically would behave in unexpected ways: https://github.com/twitter/secureheaders/pull/325

## 3.6.3

Remove deprecation warning when setting `frame-src`. It is no longer deprecated.

## 3.6.2

Now that Safari 10 supports nonces and it appears to work, enable the nonce feature for safari.

## 3.6.1

Improved memory use via minor improvements clever hacks that are sadly needed.
Thanks @carlosantoniodasilva!

## 3.6.0

Add support for the clear-site-data header

## 3.5.1

* Fix bug that can occur when useragent library version is older, resulting in a nil version sometimes.
* Add constant for `strict-dynamic`

## 3.5.0

This release adds support for setting two CSP headers (enforced/report-only) and management around them.

## 3.4.1 Named Appends

### Small bugfix

If your CSP did not define a script/style-src and you tried to use a script/style nonce, the nonce would be added to the page but it would not be added to the CSP. A workaround is to define a script/style src but now it should add the missing directive (and populate it with the default-src).

### Named Appends

Named Appends are blocks of code that can be reused and composed during requests. e.g. If a certain partial is rendered conditionally, and the csp needs to be adjusted for that partial, you can create a named append for that situation. The value returned by the block will be passed into `append_content_security_policy_directives`. The current request object is passed as an argument to the block for even more flexibility.

```ruby
def show
  if include_widget?
    @widget = widget.render
    use_content_security_policy_named_append(:widget_partial)
  end
end

SecureHeaders::Configuration.named_append(:widget_partial) do |request|
  if request.controller_instance.current_user.in_test_bucket?
    SecureHeaders.override_x_frame_options(request, "DENY")
    { child_src: %w(beta.thirdpartyhost.com) }
  else
    { child_src: %w(thirdpartyhost.com) }
  end
end
```

You can use as many named appends as you would like per request, but be careful because order of inclusion matters. Consider the following:

```ruby
SecureHeader::Configuration.default do |config|
  config.csp = { default_src: %w('self')}
end

SecureHeaders::Configuration.named_append(:A) do |request|
  { default_src: %w(myhost.com) }
end

SecureHeaders::Configuration.named_append(:B) do |request|
  { script_src: %w('unsafe-eval') }
end
```

The following code will produce different policies due to the way policies are normalized (e.g. providing a previously undefined directive that inherits from `default-src`, removing host source values when `*` is provided. Removing `'none'` when additional values are present, etc.):

```ruby
def index
  use_content_security_policy_named_append(:A)
  use_content_security_policy_named_append(:B)
  # produces default-src 'self' myhost.com; script-src 'self' myhost.com 'unsafe-eval';
end

def show
  use_content_security_policy_named_append(:B)
  use_content_security_policy_named_append(:A)
  # produces default-src 'self' myhost.com; script-src 'self' 'unsafe-eval';
end
```

## 3.4.0 the frame-src/child-src transition for Firefox.

Handle the `child-src`/`frame-src` transition semi-intelligently across versions. I think the code best descibes the behavior here:

```ruby
if supported_directives.include?(:child_src)
  @config[:child_src] = @config[:child_src] || @config[:frame_src]
else
  @config[:frame_src] = @config[:frame_src] || @config[:child_src]
end
```

Also, @koenpunt noticed that we were [loading view helpers](https://github.com/twitter/secureheaders/pull/272) in a way that Rails 5 did not like.

## 3.3.2 minor fix to silence warnings when using rake

[@dankohn](https://github.com/twitter/secureheaders/issues/257) was seeing "already initialized" errors in his output. This change conditionally defines the constants.

## 3.3.1 bugfix for boolean CSP directives

[@stefansundin](https://github.com/twitter/secureheaders/pull/253) noticed that supplying `false` to "boolean" CSP directives (e.g. `upgrade-insecure-requests` and `block-all-mixed-content`) would still include the value.

## 3.3.0 referrer-policy support

While not officially part of the spec and not implemented anywhere, support for the experimental [`referrer-policy` header](https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-header) was [preemptively added](https://github.com/twitter/secureheaders/pull/249).

Additionally, two minor enhancements were added this version:
1. [Warn when the HPKP report host is the same as the current host](https://github.com/twitter/secureheaders/pull/246). By definition any generated reports would be reporting to a known compromised connection.
1. [Filter unsupported CSP directives when using Edge](https://github.com/twitter/secureheaders/pull/247). Previously, this was causing many warnings in the developer console.

## 3.2.0 Cookie settings and CSP hash sources

### Cookies

SecureHeaders supports `Secure`, `HttpOnly` and [`SameSite`](https://tools.ietf.org/html/draft-west-first-party-cookies-07) cookies. These can be defined in the form of a boolean, or as a Hash for more refined configuration.

__Note__: Regardless of the configuration specified, Secure cookies are only enabled for HTTPS requests.

#### Boolean-based configuration

Boolean-based configuration is intended to globally enable or disable a specific cookie attribute.

```ruby
config.cookies = {
  secure: true, # mark all cookies as Secure
  httponly: false, # do not mark any cookies as HttpOnly
}
```

#### Hash-based configuration

Hash-based configuration allows for fine-grained control.

```ruby
config.cookies = {
  secure: { except: ['_guest'] }, # mark all but the `_guest` cookie as Secure
  httponly: { only: ['_rails_session'] }, # only mark the `_rails_session` cookie as HttpOnly
}
```

#### SameSite cookie configuration

SameSite cookies permit either `Strict` or `Lax` enforcement mode options.

```ruby
config.cookies = {
  samesite: {
    strict: true # mark all cookies as SameSite=Strict
  }
}
```

`Strict` and `Lax` enforcement modes can also be specified using a Hash.

```ruby
config.cookies = {
  samesite: {
    strict: { only: ['_rails_session'] },
    lax: { only: ['_guest'] }
  }
}
```

#### Hash

`script`/`style-src` hashes can be used to whitelist inline content that is static. This has the benefit of allowing inline content without opening up the possibility of dynamic javascript like you would with a `nonce`.

You can add hash sources directly to your policy :

```ruby
::SecureHeaders::Configuration.default do |config|
   config.csp = {
     default_src: %w('self')

     # this is a made up value but browsers will show the expected hash in the console.
     script_src: %w(sha256-123456)
   }
 end
 ```

 You can also use the automated inline script detection/collection/computation of hash source values in your app.

 ```bash
 rake secure_headers:generate_hashes
 ```

 This will generate a file (`config/secure_headers_generated_hashes.yml` by default, you can override by setting `ENV["secure_headers_generated_hashes_file"]`) containing a mapping of file names with the array of hash values found on that page. When ActionView renders a given file, we check if there are any known hashes for that given file. If so, they are added as values to the header.

```yaml
---
scripts:
  app/views/asdfs/index.html.erb:
  - "'sha256-yktKiAsZWmc8WpOyhnmhQoDf9G2dAZvuBBC+V0LGQhg='"
styles:
  app/views/asdfs/index.html.erb:
  - "'sha256-SLp6LO3rrKDJwsG9uJUxZapb4Wp2Zhj6Bu3l+d9rnAY='"
  - "'sha256-HSGHqlRoKmHAGTAJ2Rq0piXX4CnEbOl1ArNd6ejp2TE='"
```

##### Helpers

**This will not compute dynamic hashes** by design. The output of both helpers will be a plain `script`/`style` tag without modification and the known hashes for a given file will be added to `script-src`/`style-src` when `hashed_javascript_tag` and `hashed_style_tag` are used. You can use `raise_error_on_unrecognized_hash = true` to be extra paranoid that you have precomputed hash values for all of your inline content. By default, this will raise an error in non-production environments.

```erb
<%= hashed_style_tag do %>
body {
  background-color: black;
}
<% end %>

<%= hashed_style_tag do %>
body {
  font-size: 30px;
  font-color: green;
}
<% end %>

<%= hashed_javascript_tag do %>
console.log(1)
<% end %>
```

```
Content-Security-Policy: ...
 script-src 'sha256-yktKiAsZWmc8WpOyhnmhQoDf9G2dAZvuBBC+V0LGQhg=' ... ;
 style-src 'sha256-SLp6LO3rrKDJwsG9uJUxZapb4Wp2Zhj6Bu3l+d9rnAY=' 'sha256-HSGHqlRoKmHAGTAJ2Rq0piXX4CnEbOl1ArNd6ejp2TE=' ...;
```

## 3.1.2 Bug fix for regression

See https://github.com/twitter/secureheaders/pull/239

This meant that when header caches were regenerated upon calling `SecureHeaders.override(:name)` and using it with `use_secure_headers_override` would result in default values for anything other than CSP/HPKP.

## 3.1.1 Bug fix for regression

See https://github.com/twitter/secureheaders/pull/235

`idempotent_additions?` would return false when comparing `OPT_OUT` with `OPT_OUT`, causing `header_hash_for` to return a header cache with `{ nil => nil }` which cause the middleware to blow up when `{ nil => nil }` was merged into the rack header hash.

This is a regression in 3.1.0 only.

Now it returns true. I've added a test case to ensure that `header_hash_for` will never return such an element.

## 3.1.0 Adding secure cookie support

New feature: marking all cookies as secure. Added by @jmera in https://github.com/twitter/secureheaders/pull/231. In the future, we'll probably add the ability to whitelist individual cookies that should not be marked secure. PRs welcome.

Internal refactoring: In https://github.com/twitter/secureheaders/pull/232, we changed the way dynamic CSP is handled internally. The biggest benefit is that highly dynamic policies (which can happen with multiple `append/override` calls per request) are handled better:

1. Only the CSP header cache is busted when using a dynamic policy. All other headers are preserved and don't need to be generated. Dynamic X-Frame-Options changes modify the cache directly.
1. Idempotency checks for policy modifications are deferred until the end of the request lifecycle and only happen once, instead of per `append/override` call. The idempotency check itself is fairly expensive itself.
1. CSP header string is produced at most once per request.

## 3.0.3

Bug fix for handling policy merges where appending a non-default source value (report-uri, plugin-types, frame-ancestors, base-uri, and form-action) would be combined with the default-src value. Appending a directive that doesn't exist in the current policy combines the new value with `default-src` to mimic the actual behavior of the addition. However, this does not make sense for non-default-src values (a.k.a. "fetch directives") and can lead to unexpected behavior like a `report-uri` value of `*`. Previously, this config:

```
{
  default_src => %w(*)
}
```

When appending:

```
{
  report_uri => %w(https://report-uri.io/asdf)
}
```

Would result in `default-src *; report-uri *` which doesn't make any sense at all.

## 3.0.2

Bug fix for handling CSP configs that supply a frozen hash. If a directive value is `nil`, then appending to a config with a frozen hash would cause an error since we're trying to modify a frozen hash. See https://github.com/twitter/secureheaders/pull/223.

## 3.0.1

Adds `upgrade-insecure-requests` support for requests from Firefox and Chrome (and Opera). See [the spec](https://www.w3.org/TR/upgrade-insecure-requests/) for details.

## 3.0.0

secure_headers 3.0.0 is a near-complete, not-entirely-backward-compatible rewrite. Please see the [upgrade guide](https://github.com/twitter/secureheaders/blob/main/docs/upgrading-to-3-0.md) for an in-depth explanation of the changes and the suggested upgrade path.

## 2.5.1 - 2016-02-16 18:11:11 UTC - Remove noisy deprecation warning

See https://github.com/twitter/secureheaders/issues/203 and https://github.com/twitter/secureheaders/commit/cfad0e52285353b88e46fe384e7cd60bf2a01735

>> Upon upgrading to secure_headers 2.5.0, I get a flood of these deprecations when running my tests:
> [DEPRECATION] secure_header_options_for will not be supported in secure_headers

/cc @bquorning

## 2.5.0 - 2016-01-06 22:11:02 UTC - 2.x deprecation warning release

This release contains deprecation warnings for those wishing to upgrade to the 3.x series. With this release, fixing all deprecation warnings will make your configuration compatible when you decide to upgrade to the soon-to-be-released 3.x series (currently in pre-release stage).

No changes to functionality should be observed unless you were using procs as CSP config values.

## 2.4.4 - 2015-12-03 23:29:42 UTC - Bug fix release

If you use the `header_hash` method for setting your headers in middleware and you opted out of a header (via setting the value to `false`), you would run into an exception as described in https://github.com/twitter/secureheaders/pull/193

```
     NoMethodError:
       undefined method `name' for nil:NilClass
     # ./lib/secure_headers.rb:63:in `block in header_hash'
     # ./lib/secure_headers.rb:54:in `each'
     # ./lib/secure_headers.rb:54:in `inject'
     # ./lib/secure_headers.rb:54:in `header_hash'
```

## 2.4.3 - 2015-10-23 18:35:43 UTC - Performance improvement

@igrep reported an anti-patter in use regarding [UserAgentParser](https://github.com/ua-parser/uap-ruby). This caused UserAgentParser to reload it's entire configuration set *twice** per request. Moving this to a cached constant prevents the constant reinstantiation and will improve performance.

https://github.com/twitter/secureheaders/issues/187

## 2.4.2 - 2015-10-20 20:22:08 UTC - Bug fix release

A nasty regression meant that many CSP configuration values were "reset" after the first request, one of these being the "enforce" flag. See https://github.com/twitter/secureheaders/pull/184 for the full list of fields that were affected. Thanks to @spdawson for reporting this https://github.com/twitter/secureheaders/issues/183

## 2.4.1 - 2015-10-14 22:57:41 UTC - More UA sniffing

This release may change the output of headers based on per browser support. Unsupported directives will be omitted based on the user agent per request. See https://github.com/twitter/secureheaders/pull/179

p.s. this will likely be the last non-bugfix release for the 2.x line. 3.x will be a major change. Sneak preview: https://github.com/twitter/secureheaders/pull/181

## 2.4.0 - 2015-10-01 23:05:38 UTC - Some internal changes affecting behavior, but not functionality

If you leveraged `secure_headers` automatic filling of empty directives, the header value will change but it should not affect how the browser applies the policy. The content of CSP reports may change if you do not update your policy.

before
===

```ruby
  config.csp = {
    :default_src => "'self'"
  }
```
would produce `default-src 'self'; connect-src 'self'; frame-src 'self' ... etc.`

after
===

```ruby
  config.csp = {
    :default_src => "'self'"
  }
```

will produce `default-src 'self'`

The reason for this is that a `default-src` violation was basically impossible to handle. Chrome sends an `effective-directive` which helps indicate what kind of violation occurred even if it fell back to `default-src`. This is part of the [CSP Level 2 spec](http://www.w3.org/TR/CSP2/#violation-report-effective-directive) so hopefully other browsers will implement this soon.

Workaround
===

Just set the values yourself, but really a `default-src` of anything other than `'none'` implies the policy can be tightened dramatically. "ZOMG don't you work for github and doesn't github send a `default-src` of `*`???" Yes, this is true. I disagree with this but at the same time, github defines every single known directive that a browser supports so `default-src` will only apply if a new directive is introduced, and we'd rather fail open. For now.

```ruby
  config.csp = {
    :default_src => "'self'",
    :connect_src => "'self'",
    :frame_src => "'self'"
    ... etc.
  }
```

Besides, relying on `default-src` is often not what you want and encourages an overly permissive policy. I've seen it. Seriously. `default-src 'unsafe-inline' 'unsafe-eval' https: http:;` That's terrible.

## 2.3.0 - 2015-09-30 19:43:09 UTC - Add header_hash feature for use in middleware.

See https://github.com/twitter/secureheaders/issues/167 and https://github.com/twitter/secureheaders/pull/168

tl;dr is that there is a class method `SecureHeaders::header_hash` that will return a hash of header name => value pairs useful for merging with the rack header hash in middleware.

## 2.2.4 - 2015-08-26 23:31:37 UTC - Print deprecation warning for 1.8.7 users

As discussed in https://github.com/twitter/secureheaders/issues/154

## 2.2.3 - 2015-08-14 20:26:12 UTC - Adds ability to opt-out of automatically adding data: sources to img-src

See https://github.com/twitter/secureheaders/pull/161

## 2.2.2 - 2015-07-02 21:18:38 UTC - Another option for config granularity.

See https://github.com/twitter/secureheaders/pull/147

Allows you to override a controller method that returns a config in the context of the executing action.

## 2.2.1 - 2015-06-24 21:01:57 UTC - When using nonces, do not include the nonce for safari / IE

See https://github.com/twitter/secureheaders/pull/150

Safari will generate a warning that it doesn't support nonces. Safari will fall back to the `unsafe-inline`.

This opts out safari and IE users from the inline script protection. I haven't verified any IE behavior yet, so I'm just assuming it doesn't work.

## 2.2.0 - 2015-06-18 22:01:23 UTC - Pass controller reference to callable config value expressions.

https://github.com/twitter/secureheaders/pull/148

Facilitates better per-request config:

 `:enforce => lambda { |controller| controller.current_user.beta_testing? }`

**NOTE** if you used `lambda` config values, this will raise an exception until you add the controller reference:

bad:

`lambda { true }`

good:

`lambda { |controller| true }`
`proc { true }`
`proc { |controller| true }`

## v2.1.0 - 2015-05-07 18:34:56 UTC - Add hpkp support

Includes https://github.com/twitter/secureheaders/pull/143 (which is really just https://github.com/twitter/secureheaders/pull/132) from @thirstscolr

## v2.0.2 - 2015-05-05 03:09:44 UTC - Add report_uri constant value

Just a small change that adds a constant that was missing as reported in https://github.com/twitter/secureheaders/issues/141

## v2.0.1 - 2015-03-20 18:46:47 UTC - View Helpers Fixed

Fixes an issue where view helpers (for nonces, hashes, etc) weren't available in views.

## 2.0.0 - 2015-01-23 20:23:56 UTC - 2.0

This release contains support for more csp level 2 features such as the new directives, the script hash integration, and more.

It also sets a new header by default: `X-Permitted-Cross-Domain-Policies`

Support for hpkp is not included in this release as the implementations are still very unstable.

:rocket:

## v.2.0.0.pre2 - 2014-12-06 01:55:42 UTC - Adds X-Permitted-Cross-Domain-Policies support by default

The only change between this and the first pre release is that the X-Permitted-Cross-Domain-Policies support is included.

## v1.4.0 - 2014-12-06 01:54:48 UTC - Deprecate features in preparation for 2.0

This removes the forwarder and "experimental" feature. The forwarder wasn't well maintained and created a lot of headaches. Also, it was using an outdated certificate pack for compatibility. That's bad. The experimental feature wasn't really used and it complicated the codebase a lot. It's also a questionably useful API that is very confusing.

## v2.0.0.pre - 2014-11-14 00:54:07 UTC - 2.0.0.pre - CSP level 2 support

This release is intended to be ready for CSP level 2. Mainly, this means there is direct support for hash/nonce of inline content and includes many new directives (which do not inherit from default-src)

## v1.3.4 - 2014-10-13 22:05:44 UTC -

* Adds X-Download-Options support
* Adds support for X-XSS-Protection reporting
* Defers loading of rails engine for faster boot times

## v1.3.3 - 2014-08-15 02:30:24 UTC - hsts preload confirmation value support

@agl just made a new option for HSTS representing confirmation that a site wants to be included in a browser's preload list (https://hstspreload.appspot.com).

This just adds a new 'preload' option to the HSTS settings to specify that option.

## v1.3.2 - 2014-08-14 00:01:32 UTC - Add app tagging support

Tagging Requests

It's often valuable to send extra information in the report uri that is not available in the reports themselves. Namely, "was the policy enforced" and "where did the report come from"
```ruby
{
  :tag_report_uri => true,
  :enforce => true,
  :app_name => 'twitter',
  :report_uri => 'csp_reports'
}
```
Results in
```
report-uri csp_reports?enforce=true&app_name=twitter
```


text:
## Nuwini Chamindi

You can use the [editor on GitHub](https://github.com/Nuwini/nuwini.github.io/edit/master/index.md) to maintain and preview the content for your website in Markdown files.
### Academic Qualifications

### Achievements

Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for

For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/).

### Support or Contact

Having trouble with Pages? Check out our [documentation](https://help.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we’ll help you sort it out.


text:
[![Install directly with Stylus][badge]][style]

Dark-ProtonMail is opinionated, dark and light, very customizable
[Stylus][] theme for ProtonMail.

[Stylus]: https://github.com/openstyles/stylus
[style]: https://gitlab.com/vednoc/dark-protonmail/raw/master/pm.user.styl
[badge]: https://img.shields.io/badge/Install%20directly%20with-Stylus-116b59.svg?longCache=true&style=for-the-badge

## Setup

1. Install Stylus for [Firefox][], [Chrome][] or [Opera][].
2. Install the userstyle by clicking on the badge or [this link][style]:
    - Installs directly from this repository.
    - Only available using Stylus (see the [docs][]). :tada:
3. Customizing colors and other options:
    - Open Stylus popup, click on the configure button (cogwheel icon)
    - Choose your own preferences, hit save, and you're done!

[Firefox]: https://addons.mozilla.org/en-US/firefox/addon/styl-us/
[Chrome]: https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne
[Opera]: https://addons.opera.com/en-gb/extensions/details/stylus/
[docs]: https://github.com/openstyles/stylus/wiki/Usercss

## Contributing

Any contribution is greatly appreciated. If you find my work useful, consider
supporting me on [ko-fi][] or on [LiberaPay][].

[ko-fi]: https://ko-fi.com/vednoc
[LiberaPay]: https://liberapay.com/vednoc

## Contributors

- [vednoc](https://gitlab.com/vednoc) - creator, maintainer

repository: vednoc/dark-protonmail

repo_name: vednoc/dark-protonmail


text:
# Foreword

> __Disclaimer:__ This is the opinion of Shomari Prince (nyusternie) and __DOES NOT__ represent the view of Modenero Corp.

### Purpose

To offer an efficient mobile solution for Shuffling and Fusing Bitcoin Cash.

Due to the nature of the CashShuffle and CashFusion "blame" specifications; it would be problamatic to centralize a service to act as a proxy for mobile users.

Instead, our approach will be to create a pay-to-play scheme, whereby participants (players) will spend a nominal fee (eg. 1,000 satoshis) to participate in a single round of shuffling/fusing.

### Current Anonymity Protocols

I am especially fond of the cleverness in the specification for __[CashShuffle](https://github.com/cashshuffle/spec/blob/master/SPECIFICATION.md)__, however __NOT__ so much with __[CashFusion.](https://github.com/cashshuffle/spec/blob/master/CASHFUSION.md)__

### Non-custodial

In an effort to remain compliant with AML/KYC policies; Nito Exchange will remain 100% non-custodial. In order to achieve this, participants will remain in complete control of their private keys throughout the shuffle/fusion process.

In order to avoid our cloud servers from being banned from CashShuffle and CashFusion servers, due to the efforts of malicious participants, we will utilize the "pay-to-play" feature of the Nito Exchange Server, which runs on an independent network built on IPFS Orbit DB.

### IMPORTANT NOTICE

> According to a report by blockchain analysis firm Chainalysis, a mere 10% of funds sent to mixers come from criminal activities, while the rest were mixed for personal privacy reasons.

Nito Cash Exchange is NOT a laundering service. Unlike dark market mixing services, ALL of our transaction are visible on-chain; meaning that law enforcement services such as Chainalysis and Amberdata WILL be able to ascertain, with a high probability, the source of coins in question.

__DO NOT USE THIS SERVICE FOR ILLEGAL ACTIVITY, AS IT IS NOT SAFE__

### Fees

1% of transaction amount, plus (estimated transaction) fees.

0.5% is returned at the end of the 7 shuffles OR 3 fuses.

0.5% is sent to Pay-It-Forward.

### Mobile vs Desktop

> In 2018, mobile phones generated 52.2% of worldwide website traffic. The expected mobile internet usage in 2019 is 80%.

As per global projections, an estimated 63.4% of global internet users will be accessing the web through their mobile devices in 2019.

China has a total of 802 million internet users, of which 98% use mobile devices. India is right behind having 502 million internet users, of which 80% use different forms of mobile device uses.

63% of online traffic in the US happens with smartphones

By 2020 e-commerce sales through mobile devices will touch 45% of total e-commerce sales in the US and will reach $284 billion. It shows a steep increase from 2014, where the contribution of mobile devices was only 11.6%.

Mobile market share worldwide is 52.1% compared to desktop market share of 44.2%.