text:
# EpochTalk [![Circle CI](https://circleci.com/gh/epochtalk/epochtalk.svg?circle-token=:circle-token)](https://circleci.com/gh/epochtalk/epochtalk) [![Gitter chat](http://img.shields.io/badge/gitter-slickage%2Fepochtalk-1dce73.svg?style=flat)](https://gitter.im/slickage/epochtalk)

####**Warning this project is under active development, design is subject to change**

Next generation forum software. EpochTalk is a forum frontend designed to be paired with EpochCore [Backend](https://github.com/epochtalk/core-pg). The EpochTalk frontend utilizes technologies such as [AngularJS](https://angularjs.org), [Browserify](https://www.npmjs.org/package/browserify) and [Foundation](http://foundation.zurb.com) for improved performance and user experience as compared to existing forum software.

## Features
* EpochTalk is a single page web application created with [AngularJS](https://angularjs.org)
* Web/Mobile ready responsive design using [Foundation](http://foundation.zurb.com)
* JavaScript and CSS is bundled and minimized for performance using [Browserify](https://www.npmjs.org/package/browserify) and [Uglify-js](https://www.npmjs.org/package/uglify-js)
* Designed with performance in mind. EpochTalk's backend, [EpochCore](https://github.com/epochtalk/core-pg), utilizes [Postgres](http://www.postgresql.org/) as a database.

## Dependencies
* [node](http://nodejs.org)
* [npm](https://www.npmjs.org/doc/README.html) (pre-packaged with node)
* [Postgres](http://www.postgresql.org/)

## Installation

1) Checkout repository using git:
```sh
$ git clone git@github.com:epochtalk/frontend.git
```

2) Change directories and install dependencies using [npm](https://www.npmjs.org/doc/README.html)
```sh
$ cd frontend
$ npm install
```

3) Set Required Environment Variables

One way of doing this is using [foreman](http://ddollar.github.io/foreman/) and a `.env` file. Example `.env` file for EpochTalk:
```sh
SMTP_HOST=smtp.example.com
<EMAIL_ADDRESS>SMTP_PASS=password
<EMAIL_ADDRESS>EMAILER_LOG_ENABLED=true
```

4) Seed Test Data **(Optional)**

EpochTalk is currently in alpha release, the easiest way to view the state of the software is to seed the forum with test data using the EpochTalk [admin tool](https://github.com/epochtalk/admin). While still within the `frontend` directory run the following commands:
```sh
$ npm install<EMAIL_ADDRESS>-g
$ epoch --seed
```

4a) Initialize DB on first run

Before running EpochTalk for the first time, it is essential that these command are run first to ensure that the DB has created the correct tables.
```sh
$ npm run db-create
$ npm run db-migrate
```

5) Start the EpochTalk Server

```sh
$ npm run serve
```
Upon running the `serve` command EpochTalk will start its webserver and compile all JavaScript and css. Once compilation is complete the forum can be viewed at `http://localhost:8080`

## API
The EpochTalk API can be accessed at `http://localhost:8080/api/` when the server is running. The following api routes are supported:

###Boards
| Route | Type | Params | Description |
|-------|------|--------|-------------|
|`/api/boards`|POST| Board Obj |Used to create a new board|
|`/api/boards`|GET|N/A|Returns a categorized list of all boards with categories|
|`/api/boards/all`|GET|N/A|Returns an uncategorized list of all boards|
|`/api/boards/{id}`|POST|Updated Board Obj|Used to update a specific board|
|`/api/boards/{id}`|GET|N/A|Returns a specific board|
|`/api/boards/{id}`|DELETE|N/A|Used to delete a specific board|
All POST parameters must follow the [Board Schema](https://github.com/epochtalk/core#board-schema)

###Threads
| Route | Type | Params | Description |
|-------|------|--------|-------------|
|`/api/threads`|POST|Thread Obj|Used to create a new thread|
|`/api/threads`|GET|board_id, limit, page|Returns a list of threads by board|
|`/api/thread/{id}`|GET|N/A|Returns a specific thread|
All POST parameters must follow the [Thread Schema](https://github.com/epochtalk/core#thread-schema)

###Posts
| Route | Type | Params | Description |
|-------|------|--------|-------------|
|`/api/posts`|POST|Post Obj|Used to create a new post|
|`/api/posts`|GET|thread_id, limit, page|Returns a list of posts by thread|
|`/api/posts/{id}`|GET|N/A|Returns a specific post|
|`/api/posts/{id}`|POST|Updated Post Obj|Used to update a specific post|
|`/api/posts/{id}`|DELETE|N/A|Used to delete a specific post|
All POST parameters must follow the [Post Schema](https://github.com/epochtalk/core#post-schema)

###Users
| Route | Type | Params | Description |
|-------|------|--------|-------------|
|`/api/users`|POST|User Obj|Used to create a new user|
|`/api/users/{id}`|GET|N/A|Returns a specific user|
All POST parameters must follow the [User Schema](https://github.com/epochtalk/core#user-schema)

##Editor
![Editor](http://i.imgur.com/kNoyjeL.png)

Each post is crafted through a unique editor that can parses BBCode.

As for BBCode, the codes that are parsed is based off the SMF 1.0 BBCode spec but with some modifications as per the BitcoinTalk forum. Because BBCode differs from forum to forum, a preview window is provided to the right of the main user input to show what the post would like once it has been sent to the server. The editor itself will parse the user input in real time with a 250 millisecond debounce. So user can continue to type and the text will not be parsed until 250 millisecond after the last keypress.

### Security

All user typed HTML is escaped using their decimal encoding while any other HTML is cleaned using [punkave's](https://github.com/punkave) [sanitize-html](https://github.com/punkave/sanitize-html) library. All BBCode input is parsed through our modified [BBCode-Parser](https://github.com/epochtalk/bbcode-parser) library. This ensures that all content passed to the server is sanitized from any malicious code. Also, Angular's sanitization library also ensures that anything missed through the above process is yet again cleaned before it is shown on the client's browser.

*All inputs on the forum is cleaned to different degrees.*

Title like inputs are stripped of all html while description like inputs are allowed only formatting based html tags (```<b>```, ```<em>```, ```<table>``` but not ```<div>```, ```<img>```, and ```<span>```). Posts and Signatures are given the full treatment as described as above but allow more html like ```<img>```.

### Planned Features:
* Markdown Support
* Medium Based Editor
* Hiding the preview window
* Moving the preview window to another location
* Full Screen Editor
* Full feature compatibility across all input methods (BBCode, Medium, Markdown)

##TODO (Planned Changes)
* Redesign of frontend user interface (Current UI is temporary). Design is currently a low priority until the EpochCore backend is in a more stable state.
* Functionality to create Boards/Threads/Posts via the UI (Currently supported via the API)
* Implementation of Admin and User Views

See our github issues flagged with the [TODO label](https://github.com/epochtalk/frontend/issues?q=is%3Aopen+is%3Aissue+label%3ATODO)

To see planned backend changes, visit the EpochCore [issues page](https://github.com/epochtalk/core/issues?q=is%3Aopen+is%3Aissue+label%3ATODO)

##Feedback
Please leave us feedback using [github issues](https://github.com/epochtalk/frontend/issues)

##License
The MIT License (MIT)

Copyright (c) 2014 EpochTalk

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

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

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

repository: wiz/epochtalk

repo_name: wiz/epochtalk


text:
# WC - Wifi Connect

For now only for ZX Spectrum Next and ESP01 Wifi module.

Usage:

.wc status  - show status on wifi connection
.wc - run gui to connect ;)

Copy file of wc to directory /dot/

![alt text](http://mb-maniax.cz/wp-content/uploads/2021/06/20210629_132245.jpg)

![alt text](http://mb-maniax.cz/wp-content/uploads/2021/06/20210628_201006.jpg)

license: MIT

branch_name: refs/heads/main

extension: md

gha_license_id: MIT

license_type: permissive


text:
# Node Circuit Breaker

by [Ben Nadel][bennadel] (on [Google+][googleplus])

This is a **Node.js** implementation of the **Circuit Breaker** pattern as popularized
in [Michael T. Nygard's book - Release It!][release-it]. The Circuit Breaker is intended
to proxy the consumption of upstream resources such that failures in the upstream resource
propagate to the current system in a predictable manner. To be clear, the Circuit Breaker
doesn't prevent failures; rather, it helps your application manage failures proactively,
failing fast and / or providing fallback values when applicable.

The Circuit Breaker proxies the consumption of upstream resources; but, it does not have
intimate knowledge of the upstream resource. As such, the scope of the Circuit Breaker
can be as course or as granular as you think is appropriate. For example, you can have
one Circuit Breaker that represents an entire upstream resource. Or, you can create an
individual Circuit Breaker _for each method_ in an upstream resource. The more granular
your Circuit Breakers, the less likely you are to get false positives.

## Default Usage

Each Circuit Breaker is a composition of several objects that work together to provide
the tracking and the fail-fast functionality. Fortunately, you don't have to know about
this unless you are building custom implementations. All you have to do is ask the
Circuit Breaker Factory for an instance with the given settings.

The easiest way to create a Circuit Breaker is to create one with no settings at all.
Doing so will create a Circuit Breaker with "good" defaults:

```js
var CircuitBreakerFactory = require( "@bennadel/circuit-breaker" ).CircuitBreakerFactory;

var circuitBreaker = CircuitBreakerFactory.create();

// Invoke as closure.
circuitBreaker.execute(
    function() {
        return( upstreamResource.load() );
    }
);

// Invoke as closure with context and arguments.
circuitBreaker.executeInContext(
    upstreamResource,
    function( param1, param2 ) {
        return( this.load( param1, param2 ) );
    },
    [ "arg1", "arg2" ]
);

// Invoke as method on an object.
circuitBreaker.executeMethod( upstreamResource, "load", [ "arg1", "arg2" ] );
```

As you can see, there are three ways to run commands through a Circuit Breaker:

* `execute( command [, fallback ] )`
* `executeInContext( context, command [, args [, fallback ] ] )`
* `executeMethod( context, methodName [, args [, fallback ] ] )`

Each `execute*` method returns a Promise that will be fulfilled in resolution if the
execution was successful; or, fulfilled in rejection if the execution threw an error (or
was bypassed based on the state of the Circuit Breaker). The underlying method / function
that is being invoked should return a Promise or a synchronous value. Or, it can omit a
return if none is needed.

## Configuration Usage

The `.create()` method of the Circuit Breaker Factory works without any arguments; but,
you can provide a hash of settings that will be used to generate the Circuit Breaker.
Every one of the following settings is _optional_:

* `id` - The unique identifier of the underlying state instance, which is used for
  logging.
* `requestTimeout` - The time (in milliseconds) that a pending request is allowed to hang
  (ie, not complete) before being timed-out in error.
* `volumeThreshold` - The number of requests that have to be completed (within the
  rolling metrics window) before failure percentages can be calculated.
* `failureThreshold` - The percent (in whole numbers) of failures that can occur in the
  rolling metrics window before the state of the Circuit Breaker switches to _opened_.
* `activeThreshold` - The number of concurrent requests that can hang (ie, not complete)
  before the state of the Circuit Breaker switches to _opened_.
* `isFailure` - The function that determines if the given failure is an error; or, if
  it should be classified as a success (such as a 404 response).
* `fallback` - The global fallback to be used for all executions in the Circuit Breaker
  (which can be overridden locally with each execution).
* `monitor` - The monitor -- Function or instance -- for external logging (ex, StatsD logging).
* `bucketCount` - The number of buckets to be used to collect rolling stats in the
  rolling metrics window.
* `bucketDuration` - The duration (in milliseconds) of each bucket within the rolling
  metrics window.

_**NOTE**: The duration of the rolling metrics window will be `bucketCount * bucketDuration`.
This is also the amount of time that the Circuit Breaker will **remain opened** after
failing before allowing a "health check" request to execute._

```js
var CircuitBreakerFactory = require( "@bennadel/circuit-breaker" ).CircuitBreakerFactory;

var circuitBreaker = CircuitBreakerFactory.create({
    id: "Remote API",
    requestTimeout: 5000,
    volumeThreshold: 10,
    failureThreshold: 10, // Percent (as in 1 failure in 10 responses trips the circuit).
    activeThreshold: 50,
    isFailure: function( error ) {
        return( ! is404( error ) );
    },
    fallback: { /* Fallback value. */ },
    monitor: function( eventType, eventData ) {
        console.log( eventType, eventData );
    },
    bucketCount: 30,
    bucketDuration: 1000
});
```

## Fallback Values

The primary goal of the Circuit Breaker is to "fail fast" if the upstream resource
appears to be unhealthy. However, the secondary goal of the Circuit Breaker is to provide
a better user experience. That means that if a meaningful fallback value can be provided
in the case of error, the Circuit Breaker will facilitate this approach.

The fallback value can be a Function, a Promise, or any static value. If it's a Function,
it should return either a Promise or a static value. Fallback values can be defined when
the Circuit Breaker is created:

```js
var CircuitBreakerFactory = require( "@bennadel/circuit-breaker" ).CircuitBreakerFactory;

var circuitBreaker = CircuitBreakerFactory.create({
    id: "Remote API",
    fallback: { /* Fallback value. */ }
});
```

But, they can also be provided at the time of execution (regardless of whether or not a
global fallback value was provided):

```js
var CircuitBreakerFactory = require( "@bennadel/circuit-breaker" ).CircuitBreakerFactory;

var circuitBreaker = CircuitBreakerFactory.create({
    id: "Remote API",
    fallback: { /* Fallback value. */ }
});

circuitBreaker
    .execute(
        function() {
            throw( new Error( "Network Error" ) );
        },
        { /* Local fallback value. */ }
    )
    .then(
        function( result ) {
            console.log( result ); // Will be LOCAL fallback value.
        }
    )
;
```

If the fallback value is a Function and the execution was provided with a _context_ and
_arguments_, the same _context_ and _arguments_ will be used to invoke the Fallback.

## Circuit Breakers Are Scary -- What If I Get It Wrong?

To be honest, it can be scary - the idea of putting something into production that
will purposefully block calls to proxied systems. If you pick an error threshold that's
too low, you may start blocking requests too quickly. If you pick an active threshold
that's too high, you may clobber the upstream resource.

Luckily, you don't have to dive right into the deep-end. Instead, you can deploy a
**passive Circuit Breaker** that will log all of the traffic; but, _will never fail open_,
no matter how unhealthy the upstream resource becomes. This way, you can spend some time
passively gathering metrics about your API usage (including counts, durations, and
errors) before switching over to an active Circuit Breaker with tailored settings.

Since this is a passive Circuit Breaker (that never opens), there are fewer settings:

* `id` - The unique identifier of the underlying state instance, which is used for
  logging.
* `isFailure` - The function that determines if the given failure is an error; or, if
  it should be classified as a success (such as a 404 response).
* `fallback` - The global fallback to be used for all executions in the Circuit Breaker
  (which can be overridden locally with each execution).
* `monitor` - The monitor -- Function or instance -- for external logging (ex, StatsD
  logging).

```js
var CircuitBreakerFactory = require( "@bennadel/circuit-breaker" ).CircuitBreakerFactory;

var circuitBreaker = CircuitBreakerFactory.createPassive({
    id: "Remote API",
    monitor: function logEvent( eventType, eventData ) {
        // Log statsD metrics about count and duration.
        // Log errors.
    }
});

// This error will result in a rejected promise; but, the Circuit Breaker will always
// remain closed, allowing requests to be executed.
circuitBreaker.execute(
    function() {
        throw( new Error( "Network Error" ) );
    }
);
```

Once you've had a chance to monitor your Circuit Breakers, you can start switching your
`.createPassive()` factory calls with `.create()` factory calls using settings that you
know correspond to the collected base-line of metrics. And, you can sleep well at night.

## Logging And Monitoring

By default, the Circuit Breaker quietly discards all internal events. However, you will
probably want to log Errors and record StatsD metrics in your application. To do this,
you can provide a logging Function as the `monitor` argument:

```js
var CircuitBreakerFactory = require( "@bennadel/circuit-breaker" ).CircuitBreakerFactory;

var circuitBreaker = CircuitBreakerFactory.create({
    id: "Remote API",
    monitor: function logEvent( eventType, eventData ) {
        console.log( eventType, eventData );
    }
});
```

This logging Function will be called with the following `eventType`values:

* `closed` passing `eventData` properties `{ stateSnapshot }`
* `execute` passing `eventData` properties `{ stateSnapshot }`
* `emit` passing `eventData` properties `{ stateSnapshot }`
* `failure` passing `eventData` properties `{ stateSnapshot, duration, error }`
* `fallbackEmit` passing `eventData` properties `{ stateSnapshot }`
* `fallbackFailure` passing `eventData` properties `{ stateSnapshot, error }`
* `fallbackMissing` passing `eventData` properties `{ stateSnapshot }`
* `fallbackSuccess` passing `eventData` properties `{ stateSnapshot }`
* `opened` passing `eventData` properties `{ stateSnapshot }`
* `shortCircuited` passing `eventData` properties `{ stateSnapshot, error }`
* `success` passing `eventData` properties `{ stateSnapshot, duration }`
* `timeout` passing `eventData` properties `{ stateSnapshot, duration, error }`

Under the hood, this is actually using your `logEvent()` Function to complete a concrete
implementation of the `AbstractLoggingMonitor`. If you don't provide a Function, you can
provide a Class that extends either the `Monitor` class or the `AbstractLoggingMonitor`
class. If you extend the `AbstractLoggingMonitor` base class, you only have to override
the `logEvent()` method:

```js
var AbstractLoggingMonitor = require( "@bennadel/circuit-breaker" ).AbstractLoggingMonitor;
var CircuitBreakerFactory = require( "@bennadel/circuit-breaker" ).CircuitBreakerFactory;

class MyMonitor extends AbstractLoggingMonitor {

    constructor( statsD ) {

        super();
        this._statsD = statsD;

    }

    logEvent( eventType, eventData ) {

        stats.increment( `circuit-breaker.${ eventType }` );

    }

}

// ....

var circuitBreaker = CircuitBreakerFactory.create({
    id: "Remote API",
    monitor: new MyMonitor( stats )
});
```

However, if you extend the `Monitor` class, you can override any of the `log*` methods:

```js
var CircuitBreakerFactory = require( "@bennadel/circuit-breaker" ).CircuitBreakerFactory;
var Monitor = require( "@bennadel/circuit-breaker" ).Monitor;

class MyMonitor extends Monitor {

    logClosed( stateSnapshot ) {
        /* ... */
    }

    logOpened( stateSnapshot ) {
        /* ... */
    }

}

// ....

var circuitBreaker = CircuitBreakerFactory.create({
    id: "Remote API",
    monitor: new MyMonitor()
});
```

The `Monitor` class provides the following default, no-op (No Operation) methods, which
means you only have to override the ones that are meaningful to your application:

* `logClosed( stateSnapshot )` -- I log the point at which the Circuit Breaker state
  moves from opened to closed.
* `logExecute( stateSnapshot )` -- I log the point at which the execution is accepted by
  the state of the Circuit Breaker and the underlying command is about to be invoked.
* `logEmit( stateSnapshot )` -- I log the point at which the request has entered the
  Circuit Breaker but has not yet been approved for execution.
* `logFailure( stateSnapshot, duration, error )` -- I log the point at which the
  execution has ended in error. This only accounts for non-Circuit Breaker errors
  (see, logTimeout() and logShortCircuited() events).
* `logFallbackEmit( stateSnapshot )` -- I log the point at which a non-successful
  execution (due to error, timeout, or short-circuiting) is being evaluated for a
  fallback response.
* `logFallbackFailure( stateSnapshot, error )` -- I log the point at which an existing
  fallback function resolved in error.
* `logFallbackMissing( stateSnapshot )` -- I log the point at which a failed execution
  has no fallback defined.
* `logFallbackSuccess( stateSnapshot )` -- I log the point at which a fallback value has
  successfully stood-in for a failed or bypassed execution.
* `logOpened( stateSnapshot )` -- I log the point at which the Circuit Breaker state
  moves from closed to opened.
* `logShortCircuited( stateSnapshot, error )` -- I log the point at which an execution
  is bypassed because the Circuit Breaker is currently in an opened state.
* `logSuccess( stateSnapshot, duration )` -- I log the point at which an execution has
  resolved successfully.
* `logTimeout( stateSnapshot, duration, error )` -- I log the point at which a long-
  running execution has been explicitly timed-out in error.

The `stateSnapshot` object passed to the `Monitor` methods (and to the
`AbstractLoggingMonitor` `logEvent()` method) contains identification and metric
information about the State being used to power the Circuit Breaker. Since one Circuit
Breaker can share state with another Circuit Breaker, there's not too much sense in
identifying the Circuit Breakers themselves; as such, the State becomes the meaningful
information for logging and monitoring. Each `stateSnapshot` provided by the default
implementation uses the following structure:

```json
{
	"id": "Circuit Breaker for API",
	"closed": true,
	"settings": {
		"requestTimeout": 0,
		"volumeThreshold": 0,
		"failureThreshold": 0,
		"activeThreshold": 0
	},
	"metrics": {
		"emit": 0,
		"execute": 0,
		"success": 0,
		"failure": 0,
		"timeout": 0
	},
	"totalMetrics": {
		"emit": 0,
		"execute": 0,
		"success": 0,
		"failure": 0,
		"timeout": 0
	},
	"current": {
		"activeRequestCount": 0
	}
}
```

## Building Your Own `State` Implementation

The Circuit Breaker is designed to be a composite of several different classes all
working together to accomplish one goal. The reason for this composition was to allow
custom implementations to be designed if desired. Ideally, if you want a custom
implementation, the only class you should have to provide is the `State` class. The
`CircuitBreaker` class manages the control-flow; but, it uses the `State` implementation
to power that control-flow. If you want to provide your own `State` implementation, you
have to provide a class that exposes the following methods:

* `canPerformHealthCheck()`
* `getSnapshot()`
* `isOpened()`
* `isClosed()`
* `getTimeout()`
* `trackExecute()`
* `trackEmit()`
* `trackFailure( duration, error )`
* `trackFallbackEmit()`
* `trackFallbackFailure( error )`
* `trackFallbackMissing()`
* `trackFallbackSuccess()`
* `trackShortCircuited( error )`
* `trackSuccess( duration )`
* `trackTimeout( duration, error )`

What you do inside these methods is completely up to you. But, they have to exist since
the `CircuitBreaker` is going to call them. The general control-flow for the
`CircuitBreaker` follows this plan:

* Top-level `execute*()` method is called.
* Call `trackEmit()`.
* Check to see if `isOpened()`.
* If opened:
* * Check to see if `canPerformHealthCheck()`
* * * If can perform health check, proceed to execution.
* If can execute command:
* * Call `trackExecute()`.
* * Setup timeout timer using `getTimeout()`.
* * Invoke underlying command.
* On resolution:
* * Call `trackSuccess()`.
* On rejection:
* * Check type of error:
* * * If `OpenError` call `trackShortCircuited()`.
* * * If `TimeoutError` call `trackTimeout()`.
* * * Otherwise call `trackFailure()`.
* * Call `trackFallbackEmit()`.
* * Check to see if a fallback was provided (locally or globally).
* * * If fallback was provided:
* * * * Execute fallback.
* * * * On resolution:
* * * * * Call `trackFallbackSuccess()`.
* * * * On rejection:
* * * * * Call `trackFallbackFailure()`.
* * * If no fallback was provided:
* * * * Call `trackFallbackMissing()`.

Once you have a custom `State` implementation, you can construct a `CircuitBreaker`:

```js
var CircuitBreaker = require( "@bennadel/circuit-breaker" ).CircuitBreaker;

var state = new CustomStateImplementation();

var circuitBreaker = new CircuitBreaker( state [, globalFallback] );
```

### Guarantees Around Synchronous State Tracking

Since the Circuit Breaker generates and returns Promises around the execution of black-
boxed commands, many of the methods on the `State` instance will be invoked
asynchronously. However, the following series of methods are _guaranteed to be invoked
synchronously_ within the same tick of the Node.js event loop:

* `trackEmit()`
* `isOpened()`
* `canPerformHealthCheck()` - called only if `isOpened()` returns `true`.
* `trackExecute()`

Since Node.js runs in a single process, you can assume that these four methods will be
called without any race conditions.

### All Metrics Should Be Stored In-Memory

If you are building your own `State` implementation, you may be tempted to share metrics
across different Node.js processes (or machines). For example, you may be tempted to
store metrics in a shared Redis instance that can be consumed be every instance of a
Circuit Breaker that proxies a single resource. **DO NOT DO THIS**. Not only does the
Circuit Breaker expect `State` methods to run synchronously; but, trying to share state
offers no real value-add. Since the failure-tracking is based on _percentages_, sharing
state won't make the percentages more accurate. In fact, sharing state across processes
could lead to false-positives if a particular process or machine is having issues (such
as configuration issues that don't affect other processes or machines).

## Package Exports

This Circuit Breaker package exports the following public members:

* `OpenError`
* `StateError`
* `TimeoutError`
* `Metrics`
* `AbstractLoggingMonitor`
* `Monitor`
* `State`
* `CircuitBreaker`
* `CircuitBreakerFactory`

[bennadel]: http://www.bennadel.com
[googleplus]: https://plus.google.com/108976367067760160494?rel=author
[release-it]: https://www.bennadel.com/blog/3162-release-it-design-and-deploy-production-ready-software-by-michael-t-nygard.htm


text:
European Space Agency
==============

The European Space Agency (ESA) is Europe's gateway to space. Its mission is to shape the development of Europe's space capability and ensure that investment in space continues to deliver benefits to the citizens of Europe and the world.

ESA is an international organisation with 22 Member States. By coordinating the financial and intellectual resources of its members, it can undertake programmes and activities far beyond the scope of any single European country.

ESA's activities are:

* Observing the Earth
* Human and Robotic Exploration
* Space Transportation
* Navigation
* Space Science
* Space Engineering & Technology
* Operations
* Space Safety
* Telecommunications & Integrated Applications
* Preparing for the Future

For more information visit ESA's [website](http://www.esa.int/ESA)

branch_name: refs/heads/master


text:
# "Terrain Generation Test"

## Description

This is a "terrain generator" I created in September of 2018. It is very
 primitive.

You can view it here: https://newbytee.github.io/terrain-gen-test/

## Controls

- Pan with arrow keys
- Hold shift to increase pan speed
- Press R to generate a new world

license: Zlib

repository: Newbytee/terrain-gen-test

repo_name: Newbytee/terrain-gen-test


text:
# TaaS \(Tezos as a Service\)

### About TaaS

TaaS provides real-time updates to various applications based on the events happening on Tezos by leveraging SignalR \(WebSocket\).

### Documentation

[https://docs.tezoslive.io/docs-welcome](https://docs.tezoslive.io/docs-welcome)

## Table of contents

* [How to use](#how-to-use)
* [Solution description](#solution-description)
* [Sample Client Applications](#sample-client-applications)

## How to use

### Option \#1 - Running [Pusher.Web](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.Pusher.Web) in Docker

Ready-to-use docker image is available from Docker Hub here: [https://hub.docker.com/r/tezoslive/agileventurestezpusherweb](https://hub.docker.com/r/tezoslive/agileventurestezpusherweb).

You can start the container by using the following command

```text
docker run --rm -it -p 80:80 \
--env Tezos:NodeUrl="http://<IP_ADDRESS>:8732" \
tezoslive/agileventurestezpusherweb
```

This will expose port `80` to the host and set your Tezos Node RPC to `http://<IP_ADDRESS>:8732`.

{% hint style="warning" %}
**Do not forget to replace the NodeUrl per your environment!**
{% endhint %}

Please make sure to check the [documentation](https://docs.tezoslive.io/docs-getting-started/docs-using-docker) for additional information.

#### Configuration needed

Provide a configuration for `Pusher.Web` project in

* the `ENV` variable `Tezos:NodeUrl` has to be set. Configured Tezos RPC endpoint ****must support following calls
  * `monitor/heads/main`
  * `/chains/main/blocks/{hash}`

For client side instructions please see [Subscribing to events from the client - Option 1 or 2](./#i-am-using-option-1-or-2).

### Option \#2 - Running [Pusher.Web](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.Pusher.Web) as a standalone ASP.NET Core app

Provide a configuration for `Pusher.Web` project in

* `appsettings.json` file. You will need to fill in this value `"NodeUrl": ""` . Configured Tezos RPC endpoint must support following calls
  * `monitor/heads/main`
  * `/chains/main/blocks/{hash}`

For client side instructions please see [Subscribing to events from the client - Option 1 or 2](./#i-am-using-option-1-or-2).

### Option \#3 - Using Azure Functions and TezPusher.ConsoleApp

#### ConsoleApp Configuration

Provide a configuration for `ConsoleApp` project in the `appsettings.json` file if you are running from compiled sources or `ENV` variables if you are running from Docker.

{% hint style="warning" %}
Be sure to configure the following keys correctly per your environment

* `Tezos:NodeUrl` - Tezos RPC endpoint URL
* `Azure:AzureFunctionUrl` - URL of your deployed function app
* `Azure:AzureFunctionKey` - Access key for your message function of your deployed function app
{% endhint %}

#### Function App Configuration

Provide a configuration for `Function` project in the `local.settings.json` file if you are running it locally or Azure Applications Settings if you are running in Azure. There is a pre-filled endpoint which is hosted on Azure Free plan, so it might be already above daily threshold. You can create a SignalR Service on Azure for free on [Azure](https://azure.microsoft.com/en-us/) and provide your own SignalR connection string.

* `"AzureSignalRConnectionString": ""`

For client side instructions please see [Subscribing to events from the client - Option 3 or 4](./#i-am-using-option-3-or-4).

### Option \#4 - Using the endpoint from [TezosLive.io](https://tezoslive.io)  \(most convenient\)

Sign in using your GitHub account on [TezosLive.io](https://tezoslive.io) and request your endpoint.

{% hint style="info" %}
You don't need to host anything on server side.
{% endhint %}

API is currently limited to

* 20 000 messages per account per day \(1 message is counted for each 64kB in case message has more than 64kB\)
* 20 concurrent connection per account

Please make sure to check the [documentation](https://docs.tezoslive.io/docs-getting-started/docs-using-tezoslive.io-endpoint) for additional information.

For client side instructions please see [Subscribing to events from the client - Option 3 or 4](./#i-am-using-option-3-or-4).

If you need more messages or concurrent connections please contact us _hello AT tezoslive.io._

## Subscribing to events from the client

### I am using option \#1 or \#2

You can connect to the hub for example like this \(see `signalr.service.ts`\)

```typescript
private  connect():  Observable<any> {
    this.hubConnection  = new signalR.HubConnectionBuilder()
        .withUrl(`${this._baseUrl}/tezosHub`)
        .configureLogging(signalR.LogLevel.Information)
        .build();
    return  from(this.hubConnection.start());
}
```

You can then subscribe to transactions like this.

```typescript
this.hubConnection.send("subscribe", {
   transactionAddresses: ['all'],
   delegationAddresses: ['all'],
   originationAddresses: ['all']
});
```

Note: `transactionAddresses`, `delegationAddresses` and `originationAdresses` are `string[]`.

{% hint style="info" %}
Specifying **'all'** will subscribe the client to all transactions/delegations/originations respectively.
{% endhint %}

For reference please take a look at [AgileVentures.TezPusher.SampleClient.Web](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.SampleClient.Web) specifically [`signalr.service.ts`](https://github.com/agile-ventures/TaaS/blob/84fe386b38f5e488a194a2aa531b109c7dc435d6/AgileVentures.TezPusher.SampleClient.Web/src/app/signalr.service.ts#L65).

### I am using option \#3 or \#4

You will need to provide a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) in a custom HTTP header named `x-tezos-live-userid` to identify a client during the initial call to `negotiate` endpoint. In the sample client application we are using the [npm uuid package](https://www.npmjs.com/package/uuid) to generate random UUIDs.

You can see how the subscription to all transactions is being made by looking at the `signalr.service.ts` [here](https://github.com/agile-ventures/TaaS/blob/master/AgileVentures.TezPusher.SampleClient/src/app/signalr.service.ts) by making a `POST` request to `subscribe` endpoint with the following parameters

* userId is `string` - this is the UUID you have used for the `negotiate` call
* `transactionAddresses`, `delegationAddresses` and `originationAddresses`are `string[]` - this is the array of the addresses that you want to subscribe to. You can subscribe to all addresses by sending `['all']`

You can also subscribe only to a subset of addresses, that you are interested in by providing them as a parameter to `subscribe` call. You need to provide the generated UUID that you used in the `negotiate` call along with the array of the addresses.

For reference please take a look at [AgileVentures.TezPusher.SampleClient](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.SampleClient).

Or you can check out deployed version of this app available here [https://client-staging.tezoslive.io/](https://client-staging.tezoslive.io/).

## Solution Description

Solution consists of several projects described bellow

* [AgileVentures.TezPusher.Function](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.Function) Azure Function getting the updates from Pusher.ConsoleApp and sending the updates to SignalR hub.
* [AgileVentures.TezPusher.Model](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.Model) Simple Model for the updates. This will be extended heavily based on the different subscriptions.
* [AgileVentures.TezPusher.Pusher.ConsoleApp](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.Pusher.ConsoleApp) Small Console Application in .NET Core used to monitor Tezos Node and push updates to the Azure Function.
* [AgileVentures.TezPusher.Pusher.Web](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.Pusher.Web) ASP.NET Core Application, that monitors Tezos Node and also provides updates to clients through SignalR hub over WebSocket transport.

  **Docker supported!** To try-out docker version you can also get it from Docker Hub here [https://hub.docker.com/r/tezoslive/agileventurestezpusherweb](https://hub.docker.com/r/tezoslive/agileventurestezpusherweb). See instructions for [Option \#1](./#option-1---running-pusherweb-in-docker-most-convenient-at-the-moment).

* [AgileVentures.TezPusher.SampleClient](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.SampleClient) Sample Client application written in Angular consuming the updates provided by the Azure SignalR hub.
* [AgileVentures.TezPusher.SampleClient.Web](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.SampleClient.Web) Sample Client application written in Angular consuming the updates provided by the ASP.NET Core SignalR hub.

### Sample Client Applications

* For [Option \#1](./#option-1---running-pusherweb-in-docker-most-convenient-at-the-moment) & [Option \#2](./#option-2---running-pusherweb-as-a-standalone-aspnet-core-app) - [AgileVentures.TezPusher.SampleClient.Web](https://github.com/agile-ventures/TaaS/tree/master/AgileVentures.TezPusher.SampleClient.Web)
* For  [Option \#3](./#option-3---using-azure-functions-and-tezpusherconsoleapp) & [Option \#4](./#option-4---using-the-endpoint-from-tezosliveio) at [https://client-staging.tezoslive.io/](https://client-staging.tezoslive.io/)

repository: agile-ventures/TaaS

gha_language: C#

repo_name: agile-ventures/TaaS


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/stefanzweifel/laravel-stats/compare/v1.0.0-beta...HEAD)

## [v1.0.0-beta](https://github.com/stefanzweifel/laravel-stats/releases/tag/v1.0.0-beta)

### Added

- Add support to identify a class as a Laravel "Component"
- Add support to ignore certain folders and files through a config file
- Add `ComponentSort` to sort declared classes into `Component`
- Add Statistics Classes to retrieve number of classes, methods and lines of code

repository: tysweezy/laravel-stats

repo_name: tysweezy/laravel-stats


text:
## Effortless .Net Encryption

### Project Description

Effortless .Net Encryption is a library that is written in C# and provides:

*   Rijndael encryption/decryption.
*   Hashing and Digest creation/validation.
*   Password and salt creation.

### Give a Star! :star:
If you like or are using this project please give it a star. Thanks!

### Nuget

[https://nuget.org/packages/Effortless.Net.Encryption/](https://nuget.org/packages/Effortless.Net.Encryption/ "https://nuget.org/packages/Effortless.Net.Encryption/")

To install Effortless.Net.Encryption, run the following command in the [ Package Manager Console](http://docs.nuget.org/docs/start-here/using-the-package-manager-console)

`PM> Install-Package Effortless.Net.Encryption`

### Overview

The project is split into four main areas

*   Strings – Encryption/Decryption/Password and Salt generation
*   Hash – Creation and verification of hashes using MD5, SHA1, SHA256, SHA384, SHA512.
*   Digest – Creation and verification of digests (data + hash). Plus two handy ToString() and CreateFromString() functions which come in handy if you want to store data in a Cookie.
*   Bytes – The core of the library. This uses the Rijndael algorithm and works at the byte[] level for most functions.

### Some examples

```c#
// Creating passwords & salts
string password = Strings.CreatePassword(15, true);
string salt = Strings.CreateSalt(20);

// Encrypting/decrypting strings
byte[] key = Bytes.GenerateKey();
byte[] iv = Bytes.GenerateIV();
string encrypted = Strings.Encrypt("Secret", key, iv);
string decrypted = Strings.Decrypt(encrypted, key, iv);
Assert.AreEqual("Secret", decrypted);

// Hashes
string hash = Hash.Create(HashType.SHA512, "Hello", string.Empty, false);

// Digests
var d1 = Digest.Create(HashType.MD5, "Hello", string.Empty);
string cookieString = d1.ToString();
var d2 = Digest.CreateFromString(cookieString, string.Empty);
Assert.AreEqual(d1.Data, d2.Data);
Assert.AreEqual(d1.Hash, d2.Hash);

// Bytes
byte[] key = Bytes.GenerateKey();
byte[] iv = Bytes.GenerateIV();
var data = new byte[1024];
new RNGCryptoServiceProvider().GetBytes(data); // Random data
byte[] encrypted = Bytes.Encrypt(data, key, iv);
byte[] decrypted = Bytes.Decrypt(encrypted, key, iv);
Assert.AreEqual(data, decrypted);

// Digital Signatures
var hash = Hash.Create(HashType.SHA256, "Hello", string.Empty)
var ds = new DigitalSignature();
ds.AssignNewKey();
var signature = ds.SignData(hash);
var result = ds.VerifySignature(hash, signature);
Assert.IsTrue(result);

// Diffie Hellman
var alice = new DiffieHellman();
var bob = new DiffieHellman();
// Bob uses Alice's public key to encrypt his message.
var secretMessage = bob.Encrypt(alice, "Hello");
// Alice uses Bob's public key and IV to decrypt the secret message.
var decryptedMessage = alice.Decrypt(bob, secretMessage);
Assert.AreEqual("Hello", decryptedMessage);
```


text:
# Sessions

Sessions allow you to persist a user's data between multiple requests. Sessions work by creating and returning a unique cookie alongside the HTTP response when a new session is initialized. Browsers will automatically detect this cookie and include it in future requests. This allows Vapor to automatically restore a specific user's session in your request handler.

Sessions are great for front-end web applications built in Vapor that serve HTML directly to web browsers. For APIs, we recommend using stateless, [token-based authentication](../security/authentication.md) to persist user data between requests.

## Configuration

To use sessions in a route, the request must pass through `SessionsMiddleware`. The easiest way to achieve this is by adding this middleware globally.

```swift
app.middleware.use(app.sessions.middleware)
```

If only a subset of your routes utilize sessions, you can instead add `SessionsMiddleware` to a route group.

```swift
let sessions = app.grouped(app.sessions.middleware)
```

The HTTP cookie generated by sessions can be configured using `app.sessions.configuration`. You can change the cookie name and declare a custom function for generating cookie values.

```swift
// Change the cookie name to "foo".
app.sessions.configuration.cookieName = "foo"

// Configures cookie value creation.
app.sessions.configuration.cookieFactory = { sessionID in
    .init(string: sessionID.string, isSecure: true)
}
```

By default, Vapor will use `vapor_session` as the cookie name.

## Drivers

Session drivers are responsible for storing and retrieving session data by identifier. You can create custom drivers by conforming to the `SessionDriver` protocol.

!!! warning
	The session driver should be configured _before_ adding `app.sessions.middleware` to your application.

### In-Memory

Vapor utilizes in-memory sessions by default. In-memory sessions require zero configuration and do not persist between application launches which makes them great for testing. To enable in-memory sessions manually, use `.memory`:

```swift
app.sessions.use(.memory)
```

For production use cases, take a look at the other session drivers which utilize databases to persist and share sessions across multiple instances of your app.

### Fluent

Fluent includes support for storing session data in your application's database. This section assumes you have [configured Fluent](../fluent/overview.md) and can connect to a database. The first step is to enable the Fluent sessions driver.

```swift
import Fluent

app.sessions.use(.fluent)
```

This will configure sessions to use the application's default database. To specify a specific database, pass the database's identifier.

```swift
app.sessions.use(.fluent(.sqlite))
```

Finally, add `SessionRecord`'s migration to your database's migrations. This will prepare your database for storing session data in the `_fluent_sessions` schema.

```swift
app.migrations.add(SessionRecord.migration)
```

Make sure to run your application's migrations after adding the new migration. Sessions will now be stored in your application's database allowing them to persist between restarts and be shared between multiple instances of your app.

## Session Data

Now that sessions are configured, you are ready to persist data between requests. New sessions are initialized automatically when data is added to `req.session`. The example route handler below accepts a dynamic route parameter and adds the value to `req.session.data`.

```swift
app.get("set", ":value") { req -> HTTPStatus in
    req.session.data["name"] = req.parameters.get("value")
    return .ok
}
```

Use the following request to initialize a session with the name Vapor.

```http
GET /set/vapor HTTP/1.1
content-length: 0
```

You should receive a response similar to the following:

```http
HTTP/1.1 200 OK
content-length: 0
set-cookie: vapor-session=123; Expires=Fri, 10 Apr 2020 21:08:09 GMT; Path=/
```

Notice the `set-cookie` header has been added automatically to the response after adding data to `req.session`. Including this cookie in subsequent requests will allow access to the session data.

Add the following route handler for accessing the name value from the session.

```swift
app.get("get") { req -> String in
    req.session.data["name"] ?? "n/a"
}
```

Use the following request to access this route while making sure to pass the cookie value from the previous response.

```http
GET /get HTTP/1.1
cookie: vapor-session=123
```

You should see the name Vapor returned in the response. You can add or remove data from the session as you see fit. Session data will be synchronized with the session driver automatically before returning the HTTP response.

To end a session, use `req.session.destroy`. This will delete the data from the session driver and invalidate the session cookie.

```swift
app.get("del") { req -> HTTPStatus in
    req.session.destroy()
    return .ok
}
```

repository: micezhao/docs-cn

repo_name: micezhao/docs-cn


text:
---
title: "fast_coils:"
---

# fast_coils:

--8<-- "config_section.md"

| Valid in | |
|-----|:----:|
|[machine](instructions/machine_config.md) config files |**NO** :no_entry_sign:|
|[mode](instructions/mode_config.md) config files|**NO** :no_entry_sign:|

The `fast_coils:` section of your config is where you configure platform
specific settings for coils in the FAST platform.

## Optional settings

The following sections are optional in the `fast_coils:` section of your
config. (If you don't include them, the default will be used).

### connection:

Single value, type: one of the following options: network, local, auto.
Default: `auto`

How is your coil connected? For WPC this might be `local` otherwise
`network`.

### recycle_ms:

Single value, type: `time string (ms)`
([Instructions for entering time strings](instructions/time_strings.md)).

The cooldown time of a coil after each pulse. Any pulse during that time
will be ignored to prevent overheating the coil.

## Related How To guides

* [How to configure MPF for FAST Pinball hardware](../hardware/fast/index.md)

repository: missionpinball/mpf-docs

gha_language: Python

repo_name: missionpinball/mpf-docs


text:
# rita
> Repo template for my own projects.

## Description
`rita` is a initial package for my own personal use. It is intended to contain all the
necessary infrastructure for a standard Python package as per best recommended practices.

## Meta

Alexandre Ribeiro – [@engribeiroale](https://twitter.com/engribeiroale) –<EMAIL_ADDRESS>
Distributed under the MIT License. See ``LICENSE`` for more information.

[https://github.com/ribeiroale/rita](https://github.com/ribeiroale/rita)

repository: ribeiroale/rita

repo_name: ribeiroale/rita


text:
# Colory

![Swift 3, 4](https://img.shields.io/badge/Swift-3%2C%204-orange.svg)
[![Build Status](https://img.shields.io/travis/crazytonyli/Colory.svg)](https://travis-ci.org/crazytonyli/Colory)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Colory.svg)](https://cocoapods.org/pods/Colory)
![Carthage](https://img.shields.io/badge/carthage-compatible-blue.svg)
[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/crazytonyli/Colory/blob/master/LICENSE)

A `UIControl` for picking color from HSB color palette.

![Screenshot](Example/Colory.gif)

P.S. Gradient looks way smoother on device than this gif.

## Installation

### CocoaPods

To install Colory using [CocoaPods](https://cocoapods.org), add following line to your Podfile:

    pod 'Colory'

### Carthage

To install Colory using [Carthage](https://github.com/Carthage/Carthage), add following line to your Cartfile:

    github "crazytonyli/Colory"

## Usage

Colory has very simple API.

Register action with `valueChanged` event to receive picked color changes.

```swift
let pickerView = ColorPickerView()
pickerView.addTarget(self, action: #selector(colorChanged(_:)), for: .valueChanged)
```

Use `color` property to get and set currently picked color.

```swift
@objc func colorChanged(_ pickerView: ColorPickerView) {
    update(with: pickerView.color)
}
```

Use `layoutMargins` to customize palette margins.
```swift
pickerView.layoutMargins = UIEdgeInsets(top: pickerView.layoutMargins.top,
                                        left: 20,
                                        bottom: pickerView.layoutMargins.bottom,
                                        right: 20)
```

## LICENSE

This library is released under [MIT License](LICENSE).

repository: crazytonyli/Colory

repo_name: crazytonyli/Colory


text:
# OryClient::ManagedIdentitySchema

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **blob_name** | **String** | The gcs file name  This is a randomly generated name which is used to uniquely identify the file on the blob storage |  |
| **blob_url** | **String** | The publicly accessible url of the schema |  |
| **content_hash** | **String** | The Content Hash  Contains a hash of the schema's content. | [optional] |
| **created_at** | **Time** | The Schema's Creation Date | [readonly] |
| **id** | **String** | The schema's ID. | [readonly] |
| **name** | **String** | The schema name  This is set by the user and is for them to easily recognise their schema |  |
| **updated_at** | **Time** | Last Time Schema was Updated | [readonly] |

## Example

```ruby
require 'ory-client'

instance = OryClient::ManagedIdentitySchema.new(
  blob_name: null,
  blob_url: null,
  content_hash: null,
  created_at: null,
  id: null,
  name: CustomerIdentity,
  updated_at: null
)
```

repository: ory/sdk

repo_name: ory/sdk


text:
# image recovery - Absolute Smile

Application scans patient imaging directory and restores image files from `/OriginalImages.XVA` created when windows 10 and imaging software have discrepencies.

single threaded


text:
# Galvatron

Library for transforming, tracing and concatenating CommonJS files.

## Installing

```sh
npm install galvatron
```

## Including

```js
require('galvatron');
```

## Usage

The most common usage for Galvatron is to take a single file and transform it into a concatenated JavaScript file that includes the content of that file and all of its dependencies.

```js
var fs = require('fs');
var galvatron = require('galvatron');

fs.writeFile('dist/*.js', galvatron.bundle('src/index.js').compile());
```

### Multiple File Transformation

If you want to take multiple files and transform them into a single file you can do that too. It will still trace each file's dependencies in the proper order and will additionally make sure that none are duplicated. Both a path, glob pattern or an array of a mixture of either are supported.

```js
var compiled = galvatron.bundle([
  'bower_components/jquery/jquery.js',
  'src/*.js'
]).compile();
```

### Dependency Resolution

Dependencies are resolved in a couple different ways depending on the path that is given. First off, the files you specify to get traced and concatenated are resolved relative to the current working directory. Internally Galvatron will inspect the path and determine if the path is:

1. A module name.
2. An absolute path.
3. A relative path.

Module names are resolved in several different ways.

It will go up the directory tree - starting with the directory which the `require()` call originated in - and look for a `bower_components` folder and a `node_modules` folder, in that order. It first looks to see if there is a `bower.json` or a `package.json` depending on the package manager and if it contains a `main` definition, it will use that. If it doesn't find a main, it will look for an `index.js` or a file with the same name as the module but with a `js` extension in the component root, `src`, `lib` or `dist` directories (in that order).

You can also use module names instead of paths when specifying files to Galvatron:

```js
var underscoreAndDepenendies = galvatron.bundle('underscore').compile();
```

### Transforms

Galvatron has a notion of both `pre` and `post` transorms. The `pre` transforms happen prior to tracing dependencies. This means that if you need to transform your code prior to tracing it for its dependencies, then you can do so. The `post` transforms happen after tracing and are intended to transform your source before it is concatenated.

There are three built-in transformers:

1. `babel`
2. `globalize`
3. `unamd`

Built-in transformers can be specified by their name:

```js
galvatron.transform.post('babel', options);
```

Or be used directly:

```js
var babel = require('galvatron/transform/babel');
galvatron.transform.post(babel(options));
```

#### Babel

The `babel` transformer will transpile your code from ES6 to ES5 using [Babel](https://babeljs.io/). Simply tell Galvatron to use it:

```js
galvatron.tranform.post('babel');
```

#### Globalize

The `globalize` transform transforms your code from CommonJS into browser globals that won't conflict with any other globals. If they do, then you should probably reassess how you name your global variables. They're *hardly* global.

The great part about this is that there's no need for a shim, so code bloat is kept to a minimum. Since there's no shim, you'll never have any module loader conflicts and globals will work even if you've split up your concatenated source into separate files and they reference each other's dependencies.

This is especially useful when you're writing an open source library and you've got zero control over what your consumer is including with your library or framework. If you use Browserify you have to be careful because their shim will use whatever `require` is on the page if it's there before the shim. This means that it could potentially break the world. The solution according to an [open issue](https://github.com/substack/node-browserify/issues/790) is to change the AMD code. This doesn't help if you don't have control over other code on the page.

#### UnAMD

The `unamd` transform will no-op any AMD code that is traced by Galvatron. This might change in the future to only no-op anonymous modules. This is useful when you don't want to put your code through `r.js` just to make the `define` calls happy. If you're using CommonJS, you've probably got no use for them anyways.

#### Custom Transformers

You can also write custom transformers. A transformer is simply a function that takes two arguments.

```js
galvatron.transformer.pre(function (code, data) {
  return doSomeTransformationsTo(code);
});
```

The `code` argument is a string representing the current form of the code. It may have been altered by a previous transformer, or if this is the first transformation step, it may be the exact contents of the file.

The `data` argument is an object containing information about the file. Depending on the type of transformer, this will contain different information.

As a `pre` transformer:

- `path` The file path.

As a `post` transformer:

- `path` The file path.
- `imports` Dependency paths as they are defined in the import statement (`import`, `require()`, etc.).
- `dependencies` Absolute dependency paths resolved from their respective import path.

### Streams

Streams are super useful if you want to integrate your build into a stream system such as Gulp.

```js
var bundle = galvatron.bundle('src/*.js');
gulp.src(bundle.files)
  .pipe(bundle.stream())
  .pipe(gulp.dest('dist'));
```

The `stream()` method returns a `vinyl` stream created by `vinylTransform`, so it can be used anywhere a `vinyl` stream can be used, not just with Gulp.

You can create watch streams, too:

```js
var bundle = galvatron.bundle('src/*.js');
gulp.src(bundle.files)
  .pipe(bundle.watch())
  .pipe(bundle.stream())
  .pipe(gulp.dest('dist'));
```

repository: wbinnssmith/galvatron

gha_language: JavaScript

repo_name: wbinnssmith/galvatron


text:
# BD ICT Portal

**Contents:** 1. Introduction 2. Features 3. Technologies 4. Screenshots

## Introduction
This is a web based project for providing all kind of tools and resources for learning programming.

## Features

- Programming related post
- Olympiad: National and International
-   Programming Practice
-   Online and onsite programming contest schedule
-   Programming learning resources- Books, websites, youtube channel, blog, facebook group and page

## Technologies

HTML, CSS, Bootstrap4, Javascript, PHP,Ajax

## Screeenshots

**1. Information for School Programming Contest**

![Screenshot (215)](https://user-images.githubusercontent.com/23233774/64377416-382bd780-d04c-11e9-9d0d-2bd933462d73.png)

**2. Sites, books, channel, and pages for learning programming**

![Screenshot (222)](https://user-images.githubusercontent.com/23233774/64377417-39f59b00-d04c-11e9-9752-18621d748fc5.png)

**3. Peoples who are inspired programming**

![Screenshot (221)](https://user-images.githubusercontent.com/23233774/64377420-3b26c800-d04c-11e9-8e54-6e9d134724c0.png)

**4.  Software Engineers' Profile**

![Screenshot (220)](https://user-images.githubusercontent.com/23233774/64377426-3cf08b80-d04c-11e9-8b74-3484f1f568f5.png)

**5. Practice Programming**

![Screenshot (219)](https://user-images.githubusercontent.com/23233774/64377427-3d892200-d04c-11e9-945f-7b4c67180d2c.png)

**6. Programming Contest Schedule (Online & Onsite)**

![Screenshot (218)](https://user-images.githubusercontent.com/23233774/64377431-40841280-d04c-11e9-81bd-2ef2e2468f1c.png)

**7. Information of Olympiads (International)**

![Screenshot (217)](https://user-images.githubusercontent.com/23233774/64377435-424dd600-d04c-11e9-8344-be18e4b52caf.png)

**8. Information of Olympiads (National)**

![Screenshot (216)](https://user-images.githubusercontent.com/23233774/64377438-44179980-d04c-11e9-915f-81b3bc28a1c2.png)


text:
---
title: Opcode FinishWindow
searchTitle: Lua Opcode FinishWindow
weight: 1
hidden: true
menuTitle: Opcode FinishWindow
---
## FinishWindow

This represents a FinishWindow opcode
```lua
Opcode.FinishWindow
```

repository: xackery/eqquestapi

repo_name: xackery/eqquestapi


text:
# clienttimezone
Gets the clients timezone difference from UTC in minutes using Javascript.

## How it works
If the client timezone is not stored in the session, the javascript will fire a POST ajax
request, sending the clients current time offset in minutes from the UTC time. This offset
is then stored in session and the users browser reloads the current page. Javascript will
then only have to do this once, or until a new session is started.

## Installation

1. Add ClientTimezone to your composer.json file under `require`:

  `"kevinorriss\clienttimezone": "1.2.*"`

2. Add the ClientTimezoneServiceProvider to your app.php file:

  `KevinOrriss\ClientTimezone\ClientTimezoneServiceProvider::class,`

3. Add the ClientTimezone alias to your app.php file:

  `'ClientTimezone' => KevinOrriss\ClientTimezone\ClientTimezone::class,`

4. Run `composer update`

## Usage

In order to use this package, you need to setup your application so that Ajax calls send the
CSRF token.

1. Add the following meta tag to your main blade layout file

  `<meta name="csrf-token" content="{{ csrf_token() }}" />`

2. Add the javascript ajax setup code using jquery, you could create `public/js/main.js` and add this script to you main layout

  ```
  $(document).ready(function()
  {
    $.ajaxSetup(
    {
      headers:
      {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
      }
    });
  });
  ```
3. In your main layout add the following line AFTER your jQuery script tag

  `@include('clienttimezone::javascript')`

## Example

### Carbon

ClientTimezone is best used with Carbon to display the users current time.

```
$carbon = Carbon::now();
$carbon->addMinutes(ClientTimezone::getOffset());
```

### Skipping

There may be times when you do not want javascript to check the client timezone. An example
of this is when the client creates a new session on your application by following a URL
to verify their email address, this page displays a flash message, but will be shown briefly
until Javascript reloads the page. Upon the page reload, the flash message will have expired.

To prevent Javascript from checking the client timezone and reloading the page if it needs to,
just add this line to your controller before returning a view.

`ClientTimezone::skip();`

### Overrides

You can override any of the ClientTimezone constant values by simply adding a value of the same
name inside the .env file, for example:

```
CLIENT_TIMEZONE_SESSION=myexample
CLIENT_TIMEZONE_POST=newurl
CLIENT_TIMEZONE_SKIP=skipkey
```

## Authors

* **Kevin Orriss** - [Website](http://kevinorriss.com)

See also the list of [contributors](https://github.com/kevinorriss/clienttimezone/graphs/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details

repository: kevinorriss/laravel-clienttimezone

repo_name: kevinorriss/laravel-clienttimezone


text:
# Synapse

A Deep Learning library.

Synapse is currently a hobby project. Its not ready for production. I am building this project to test RbCUDA.

## Installation

```sh
git clone https://github.com/prasunanand/synapse
cd synapse
rake compile
rake test

```

```ruby
gem 'synapse'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install synapse

## Usage

TODO: Write usage instructions here

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` 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/prasunanand/synapse. 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.

## Code of Conduct

Everyone interacting in the Synapse project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/synapse/blob/master/CODE_OF_CONDUCT.md).

# LICENSE

This software is distributed under the [BSD 3-Clause License](LICENSE).

Copyright (c) 2017-2018, Prasun Anand

repository: prasunanand/synapse

repo_name: prasunanand/synapse


text:
# TwoFactorAuthenticationMethod

## Example TwoFactorAuthenticationMethod Object

```
{
  "id": 1,
  "method_type": "sms",
  "name": "My Verizon Phone",
  "phone_number": "+15555555555",
  "phone_number_country": "US",
  "phone_number_national_format": "+15555555555",
  "setup_expired": true,
  "setup_complete": true,
  "setup_expires_at": "2000-01-01 01:00:00 UTC",
  "totp_provisioning_uri": "https://...",
  "u2f_app_id": "app id",
  "u2f_registration_requests": [

  ]
}
```

* `id` (int64): 2fa ID
* `method_type` (string): Type of 2fa
* `name` (string): 2fa method name
* `phone_number` (string): 2fa phone number (if SMS)
* `phone_number_country` (string): 2fa phone number country (if SMS)
* `phone_number_national_format` (string): 2fa phone number national format (if SMS)
* `setup_expired` (boolean): 2fa setup expired?
* `setup_complete` (boolean): 2fa setup complete?
* `setup_expires_at` (date-time): 2fa setup expires at this date/time (typically 10 minutes after a new method is created)
* `totp_provisioning_uri` (string): TOTP provisioning URI (if TOTP)
* `u2f_app_id` (string): U2F app ID (if U2F)
* `u2f_registration_requests` (array): U2F registration requests (if U2F)
* `otp` (string): Current value of OTP, Yubikey string, or U2F response value.  U2F response value requires a json stringified object containing fields `clientData`, `keyHandle`, and `signatureData`.

---

## List current user's 2FA methods

```
Files::TwoFactorAuthenticationMethod.get(
  page: 1,
  per_page: 1
)
```

### Parameters

* `page` (int64): Current page number.
* `per_page` (int64): Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.

---

## Create 2FA method on current user

```
Files::TwoFactorAuthenticationMethod.create(
  method_type: "sms",
  name: "My Verizon Phone",
  phone_number: "+15555555555"
)
```

### Parameters

* `method_type` (string): Required - Type of 2fa
* `name` (string): 2fa method name
* `phone_number` (string): 2fa phone number (if SMS)

---

## Generate (and send if applicable) a one time password for current user's primary 2FA method

```
Files::TwoFactorAuthenticationMethod.send_code(
  u2f_only: true
)
```

### Parameters

* `u2f_only` (boolean): Set to `true` to only generate an OTP for U2F (FIDO) keys and skip things like SMS.

---

## Update 2fa

```
Files::TwoFactorAuthenticationMethod.update(id,
  otp: "123456",
  name: "My Verizon Phone"
)
```

### Parameters

* `id` (int64): Required - 2fa ID.
* `otp` (string): Current value of OTP, Yubikey string, or U2F response value.  U2F response value requires a json stringified object containing fields `clientData`, `keyHandle`, and `signatureData`.
* `name` (string): 2fa method name

---

## Delete 2fa

```
Files::TwoFactorAuthenticationMethod.delete(id)
```

### Parameters

* `id` (int64): Required - 2fa ID.

---

## Update 2fa

```
two_factor_authentication_method = Files::TwoFactorAuthenticationMethod.find(1)
two_factor_authentication_method.update(
  otp: "123456",
  name: "My Verizon Phone"
)
```

### Parameters

* `id` (int64): Required - 2fa ID.
* `otp` (string): Current value of OTP, Yubikey string, or U2F response value.  U2F response value requires a json stringified object containing fields `clientData`, `keyHandle`, and `signatureData`.
* `name` (string): 2fa method name

---

## Delete 2fa

```
two_factor_authentication_method = Files::TwoFactorAuthenticationMethod.find(1)
two_factor_authentication_method.delete
```

### Parameters

* `id` (int64): Required - 2fa ID.

repository: zeisler/files-sdk-ruby

repo_name: zeisler/files-sdk-ruby


text:
## AttractorMotion

This demonstrates several aspects of the `Fuse.Motion` package as exposed through the `Attractor`. Each cell in the grid is a distinct test with instructions at the top.

repository: rbtech/fuse-samples

gha_language: Shell

repo_name: rbtech/fuse-samples


text:
---
title: "Accessibility"
description: "Accessibility guidelines."
---

# Accessibility

> AA accessibility (WCAG) guidelines, typography / contrast information, and interaction hit-sizes.

According to the WCAG, there are four categories of user impairment:

- [visual](#visual)
- [auditory](#auditory)
- [motor](#motor)
- [cognitive](#cognitive)

Each category requires its own set of considerations in both design and the technical implementation.

## Visual

- Designs should meet minimum contrast requirements
- typography should be a sufficient size
- alt text and visually hidden elements are provided as alternatives where relevant
- aria landmarks are provided
- aria roles on interactive UI elements

## Auditory

## Motor

Users with impaired motor skills will have no fun trying to click buttons or links that are too small or clustered
together. As such, we enforce the recommended minimum dimensions of an interactive UI elements (per the WCAG), which
can be summarized as:

- UI elements maintain a target hit size of at least 44px x 44px (currently, we have 48px set as a default)
  - note: this does not apply to inline links, while for rows of buttons or navigation (for example), there are guidelines for maintaining sufficient space above and below according to the above values -- even if the UI itself is not of sufficient height. See the WCAG reference below for details.
  - note: the key is the _spacing_ between adjacent UI elements. For example, the target size may be circular or square so long as it is sufficiently distanced from neigboring UI and meets minimum size criteria.

References:
[https://www.w3.org/WAI/WCAG21/Understanding/target-size.html](WCAG target size)
[https://www.w3.org/WAI/WCAG22/Understanding/pointer-target-spacing](WCAG target spacing)

## Coginitive

This last category is usually the most difficult to define or make allowances for. In general though, we should assume that our UX, or particular aspects of it, may not be immediately understood.

For example, the function of a particular button or the consequences of a particular action may not be obvious. While the result of clicking a 📄 icon might be understood by some users, consider that for others it may not be immediately obvious. Users will have different contexts and experiences from which to draw. The more context and "hints" around intent that we can provide, the better. What does a thing or action do? Will my data be safe? Did I mean to do that? Is it okay to click?

To address the example above, we should ensure that all icon buttons provide help text on hover.

An icon button providing additional hints to a user

repository: apathetic/zigzag-ui

repo_name: apathetic/zigzag-ui


text:
Suggested Schedule
==================

### Books

* Week 1-2: HTML and CSS by Duckett
* Week 3-4: Learn to Program by Chris Pine, Eloquent Ruby (Chapters 1-5, 9)
* Week 5-11: Rails tutorial by Michael Hartl
* Week 12-13: Javascript book, not sure, eloquent javascript?
* Week 14-15: jQuery book, not sure, jQuery in Action? Headfirst jQuery?
* Week 16: Wrapup

### Daily Warmup Exercises

* Weeks 1-11: exercism.io for 30 minutes in ruby
* Weeks 12-15: exercism.io for 1 hr in ruby and javascript (30 min each)

### Longer exercises

* Week 2: Redo bike website from Duckett without looking at source code
* Week 3: Wireframes of Portfolio
* Week 4: EventManager? http://tutorials.jumpstartlab.com/projects/eventmanager.html
* Week 8: Completed Portfolio (HTML/CSS, maybe some Sinatra)
* Week 11: Finish Rails tutorial
* Week 13: Javascript EventManager or something like that
* Week 15: Connect4 game or LightsOut game
* Week 16: Wrapup

### Networking

* Weeks 1-4: Hack+Help or some weekly outing with a friend
* Weeks 5-8: Any event once a week with friend, collect business cards
* Weeks 9-12: Schedule informational interviews with Ruby shops in town, also one event each week
* Weeks 13-16: Meaningful contribution to public tech events each week. Organizers get jobs.

### Things to ask

* How will you stay motivated for 16 weeks?
* How will you afford to study for 16 weeks without pay? (you really can't work during this time, if you do double or quadruple the duration of everything)
* How will we work together (we == you + friend)
* How will you get a job? How will you learn to network? How will you learn to interview?

## Specific assessment criteria (am I done yet?)

### Command-line objectives

* Development machine setup and functional
* Able to navigate to folders, cp/mv/ls files, open sublime from command line
* Able to set $EDITOR and $PATH
* Able to start a new git project and push to Github
* Able to work within an existing git project, push to Github, and handle merges and merge conflicts
* Able to use rvm to manage ruby installs
* Able to use homebrew to install new packages

### HTML/CSS objectives

* Able to speak intelligently about HTML and CSS syntax
* Able to quickly create a site using Bootstrap
* Able to use a custom "site" theme from themeforest.com
* Understand the chrome inspector
* Understand css selectors

### Javascript objectives

* Able to find DOM elements with jQuery using css selectors
* Able to change DOM elements and their properties
* Able to append new DOM elements to the page
* Able to use AJAX to request data from a server (locally and remote via JSON-P)
* Able to use namespacing patterns to keep code tidy
* Able to use jQuery-UI or bootstrap.js to create all the effects contained in bootstraps docs
* Able to use a jQuery plugin
* Have at least 4 javascript problems accepted on exercism.io
* Able to use coffeescript
* OPTIONAL: Able to use some JSMVC framework
* OPTIONAL: Able to use d3.js to describe data visually

### Ruby objectives

* Create well-formed ruby files using: classes, attr_accessor et al, class and instance methods, instance and local variables
* Create well-tested ruby scripts using both minitest and rspec
* Create ruby scripts that use hashes and arrays
* Create ruby scripts that use iterators and blocks
* Create ruby scripts for the command-line using standard command-line flags
* Create ruby scripts that download data from an API and put it into a database
* Have at least 4 ruby problems accepted on exercism.io
* Create middleman apps and deploy to heroku
* Create sinatra applications to expose some data for consumption via AJAX
* Able to use nokogiri and either httparty or faraday to query APIs

### Rails objectives

* Create rails projects quickly from the command line
* Able to scaffold models from the command line
* Able to create static controllers from the command line
* Create well-tested rails apps using rspec and capybara
* Understand when to use unit tests and when to use integration tests
* Able to create forms using default rails form builder or simple_form
* Able to deploy rails apps to heroku
* Able to link two models together with 1-to-1, 1-to-many, or many-to-many relationships
* Able to create scopes and class methods that act like scopes
* Able to use ActiveRecord to query a Postgres database
* Able to integrate devise or some authentication strategy
* Able to use CanCan to authorize users
* Able to send emails via ActiveMailer or Pony
* Able to create background tasks
* Able to use turbolinks or disable it

### SQL objectives

* Able to install/configure a Postgres and a MySQL database
* Able to query pg, mysql, and sqlite from the command line
* Able to select and insert data
* Able to use joins and inner joins to link to tables
* Able to use migrations or rake files to change the database


text:
# Uredo hypericorum DC., 1807 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mém. Agric. Soc. Agric. Dép. Seine 10: 235 (1807)

#### Original name
Uredo hypericorum DC., 1807

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Melampsoraceae/Melampsora/Melampsora hypericorum/ Syn. Uredo hypericorum/README.md

repo_name: mdoering/backbone


text:
# Expected place in the queue for buy order

In order to get the expected place in the queue for a new buy order without creating a buy order, you need to call the function:

```csharp
BitSkinsApi.BuyOrder.PlaceInQueue.GetExpectedPlaceInQueue(BitSkinsApi.Market.AppId.AppName app, string name, double price);
```

## GetExpectedPlaceInQueue()

### Is in class:

```csharp
BitSkinsApi.BuyOrder.PlaceInQueue
```

### Function:

```csharp
BitSkinsApi.BuyOrder.PlaceInQueue.GetExpectedPlaceInQueue(BitSkinsApi.Market.AppId.AppName app, string name, double price);
```

### Function parameters:

* BitSkinsApi.Market.AppId.AppName app - game, which owns the purchased items.
* string name - item name.
* double price - price.

### Returns:

```csharp
int? placeInQueue
```

placeInQueue - expected place in queue for new buy order, may be null.

### Possible exceptions
```ArgumentException``` - in case of transfer to the function incorrect data, the message contains detailed information.
\
```BitSkinsApi.Server.RequestServerException``` - in case of transfer to the function incorrect data or problems on the BitSkins server.

## Example

```csharp
BitSkinsApi.Market.AppId.AppName app = BitSkinsApi.Market.AppId.AppName.CounterStrikGlobalOffensive;
int placeInQueue = BitSkinsApi.BuyOrder.PlaceInQueue.GetExpectedPlaceInQueue(app, "CS:GO Weapon Case 2", 0.01);
Console.WriteLine(placeInQueue);
```

[<Create buy order](https://github.com/dmitrydnl/BitSkinsApi/blob/master/docs/eng/buy_order/create_buy_order.md)      [Cancel buy orders>](https://github.com/dmitrydnl/BitSkinsApi/blob/master/docs/eng/buy_order/cancel_buy_orders.md)

repository: dmitrydnl/BitSkinsApi

repo_name: dmitrydnl/BitSkinsApi


text:
# Forkwell Coronavirus Hack: Drug Discovery

[Fork](https://guides.github.com/activities/forking/) this repository to start participating!

## About

Welcome to [Forkwell Coronavirus Hack](https://www.forkwell.io/events/forkwell-coronavirus-hack)!

This repository contains the hackathon kit for you to get started on solving **topic 1: Drug
Discovery** and eventually a place where you host all your submission artifacts as your own fork.

## Sponsors

| [![Microsoft](https://user-images.githubusercontent.com/19421765/77505763-ff940400-6e9e-11ea-8c47-cafdf6b3b2d6.png)](https://microsoft.com/) | [![DigitalOcean](https://user-images.githubusercontent.com/19421765/77505756-f9058c80-6e9e-11ea-9968-01fcd23a3e6f.png)](https://do.co/forkwell) | [![Sunway iLabs](https://user-images.githubusercontent.com/19421765/77505745-f440d880-6e9e-11ea-99c8-087a37b9cd5b.png)](https://innovationlabs.sunway.edu.my/) |
|----------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![Runcloud](https://user-images.githubusercontent.com/19421765/77505775-06bb1200-6e9f-11ea-8c30-ae3547432a69.png)](https://runcloud.io/)    | [![AI Geeks](https://user-images.githubusercontent.com/19421765/77505782-0a4e9900-6e9f-11ea-9b68-e54697881f64.png)](http://aigeeks.org/)        |                                                                                |

## Background

A few studies have shown that HIV antivirals offer promising results, but this is still an open
field of discovery.

Finding a new drug or validating an existing drug are both suitable approaches, we will be donating
samples of the winning compound to the Ministry of Health Malaysia for further analysis.

## Goal

Find a candidate drug (ligand) with a high binding affinity with the COVID-19 main protease.

1. Use machine learning to identify a potential candidate, then use docking software to get the
   binding affinity between it and the main protease.
2. Write a report that describes your process and results in detail in the form of a jupyter
   notebook.

## Submission

You are required to submit a 15-minute presentation video of your report. However, to ensure the
legitimacy of your submission, you are required to submit your project artifacts (code, datasets,
documents) as a [fork](https://guides.github.com/activities/forking/) to this repository.

After creating your own [fork](https://guides.github.com/activities/forking/)
of this repository, clone the repository:

```sh
git clone git@github.com:<your-github-username>/fch-drug-discovery
```

Change to the directory:

```sh
cd fch-drug-discovery
```

Set upstream:

```sh
git remote add upstream git@github.com:forkwell-io/fch-drug-discovery
```

...and start Hacking!!

Once you are ready to submit, create a pull request from your
[fork](https://guides.github.com/activities/forking/) to us and submit your submission form here,
we'll take care of the rest.

Please remember that your code will be publicly available, open-sourced licesed and free for the
internet to use. Please ensure that you don't commit any sensitive information!

## Resources

### Presentations

[![Thomas MacDougall](https://user-images.githubusercontent.com/19421765/77504390-26e8d200-6e9b-11ea-811e-02aaf1f8adc9.png)](https://drive.google.com/open?id=1pHy9Cm4_w4Ri8lVbcN2XC637_7BaLL9P)

*Virus Primer - Target a Virus*

**Thomas MacDougall - Graduate Student in Computer Science at the University of Montreal**

*[slides](https://drive.google.com/drive/folders/1YsyUQQBAIxq_syXzE6wxSPaifAwmNxxF)*

</br>

### Databases

| Name                    | Link                                         |
|-------------------------|----------------------------------------------|
| COVID-19 main protease  | https://www.wwpdb.org/pdb?id=pdb_00006lu7    |
| ChemBL                  | https://www.ebi.ac.uk/chembl/                |
| DrugBank                | https://www.drugbank.ca/                     |
| Folding@Home            | https://github.com/FoldingAtHome/coronavirus |
| Formatted ZINC Database | https://github.com/molecularsets/moses       |
| NextStrain              | https://nextstrain.org/                      |
| ZINC Database           | https://zinc.docking.org/                    |

### Docking Tools

| Name                  | Link                                              |
|-----------------------|---------------------------------------------------|
| AutoDock VINA         | http://vina.scripps.edu/                          |
| PyRX                  | https://pyrx.sourceforge.io/                      |

### Deep Reinforcement Learning Networks

| Name    | Link                                       |
|---------|--------------------------------------------|
| DrugEx  | https://github.com/XuhanLiu/DrugEx         |
| GENTRL  | https://github.com/insilicomedicine/GENTRL |
| ReLeaSE | https://github.com/isayev/ReLeaSE          |

## Awesome perks from our sponsors!

Deployment
- [DigitalOcean](https://do.co/forkwell)

## Help us organize better

Feel free to open issues if you find anything lacking and we appreciate your feedback greatly!

## Community

Join the community!
- [Forkwell Facebook Group](https://facebook.com/groups/forkwell.io)
- [Forkwell Coronavirus Hack Microsoft Teams Channel](https://ms-teams-invite)

repository: gitter-badger/fch-drug-discovery

repo_name: gitter-badger/fch-drug-discovery


text:
# Unscented Kalman Filter Project
Self-Driving Car Engineer Nanodegree Program

* Screenshots of final stage of simulation

![alt text](./images/forward.PNG)

* NIS plot for Radar

![alt text](./images/nis_radar.png)


text:
# ClassicalHMM
An implementation of the Classical Hidden Markov model for i-order Markov chains.

### class `ClassicalHMM.HMM`:

This is the class responsible for computing the Hidden Markov model for a given list of sequences.

#### Parameters:

- **Data** (*pandas.DataFrame*) - Dataframe with sequence data. Each row of the dataframe must contain a list of strings. The dataframe must contain 2 columns labeled `x` and `y`. The class will report an error if the length of a datapoint from `x` is not equal to length of the corresponding datapoint from `y` - 2.
- **Order** (*int, Defaults to 1*) - Number indicating the order of the markov model.
- **Vocab_x** (*list*) - List of unique tokens in the `x` sequence.
- **Vocab_y** (*list*) - List of unique tokens in the `y` sequence.

#### Usage:

```
import HMM from ClassicalHMM
hmm = HMM(df, order, vocab_x, vocab_y)
```

#### Requirements:

- Pandas
-

#### License:

[MIT](https://github.com/OmegAshEnr01n/ClassicalHMM/blob/main/LICENSE)


text:
# Password_Generator
# Created by Vinny Otach
# Description
 This is an application where users create accounts together with passwords and can be stored together with their details.
 As a user the following is what you can do with the application.

Create an account

Log in to your account

store my credentials

Generate a password

# Specs
In the terminal you can run the following commands to execute.

python3.6 ./run.py - This welcomes you to your application where you input your name to continue

 SU - this is for sign up

 DA - this displays your account

 LN - this is for logging to your account

 EX - this is for exiting your application

 NC - create a new credential

 DC - this prints the list of credentials

 EX - this is for logging out of your account

# Technologies Used

 Python3.6

 VS Code

# License
MIT @ 2018 VINNY OTACH


text:
## Distributed-Key-Value-Store
The key value store has been implemented in Python. The code is compatible with both python2
and python3. Though python3 is recommended due to better unicode support and handling.

### Communication Atomicity
Atomicity is maintained by using Two-phase-commit

### Master/Slave configuration
By Default the server is designed to run as master.

However, if server is started with "-m" or "--mhost", then it automatically becomes a slave and sends a registration request to
the master.

After the registration is successful, master will send requests to the new peer and wait for ack for vote/commit operation in
case of any write/update to the server.

### Running on cluster
To Run the project on cluster, samples/deploy.sh can be used. The script assumes that the ssh keys have already ben placed and
the server can execute a command without a password.

Also there needs to be a file called hostlist with server addresses/qualified names in it.

Server supports dynamic registration and more clients can be connected manually at any point of time.

### Code Organization
The code is organized as following

| File | Function |
|------|----------|
|client.py         |main wrapper function for client|
|lib/client.py     |exchange operation details and data for both tcp/udp|
|lib/handler.py    |server program handling request|
|lib/\__init\__.py |dummy file, to mark library in python
|lib/logger.py     |universal logger, accepts 0error, 1info, 2debug
|lib/operations.py |lambda functions for operations
|lib/tcp_client.py |Initiate tcp connection
|lib/tcp_handler.py|Server library to create and listen in TCP mode
|lib/tpc.py        |Two Phase Commit negotiator
|lib/udp_client.py |Initiate udp connection
|lib/udp_handler.py|Server library to create and listen in UDP mode
|server.py         |main wrapper function for server|
|test.sh           |test script for UNIX environment to start server and then run random put/delete and finally close server|

## Starting server and running tests
To test the project, ./test.sh can be used. It has a function that initiates server first in UDP mode and tests with instances
of clients and then in TCP mode. At the end of the test it sends kill signal to server instances that were started in
background.

The bash script is written in a way that starts both server and client in debug mode by default.

A prt of test has been written to generate random values using openssl, which should be present in majority of UNIX like
operating systems and Windows if it were any more considerate.

"Executing test”
$ ./test.sh

### Help
Server and client can be started independently and have been incorporated with detailed help option.

./server --help

./client --help


text:
# Welcome to Selba Ward!
- **_"check in to check it out"_**

![Selba Ward](http://i.imgur.com/0k0um5B.jpg)

A collection of SFML drawables
by [Hapaxia](http://github.com/Hapaxia)

Contents: **Bitmap Text**, **Console Screen**, **Crosshair**, **Elastic Sprite**, **Gallery Sprite**, **Line**, **Nine Patch**, **Pie Chart**, **Pixel Display**, **Polygon**, **Progress Bar**, **Ring**, **Spinning Card**, **Spline**, **Sprite 3D**, **Starfield**, **Tile Map**

## For information, view the [Wiki].

Feedback and suggestions for new objects always welcome...

[Selba Ward thread on the SFML forum][SFMLForumSelbaWard]

[Wiki]: https://github.com/Hapaxia/SelbaWard/wiki
[SFMLForumSelbaWard]: http://en.sfml-dev.org/forums/index.php?topic=19496.0

repository: Hapaxia/SelbaWard

gha_license_id: NOASSERTION

repo_name: Hapaxia/SelbaWard


text:
# HashmapAnalyticsFramework
Repository fo the analytics framework work.

## Introduction
Hashmap Analytics framework is collection of multiple independent microservices which utilizes API Gateway pattern for communication.

### Service
1. **api-discovery**: Eureka discovery server which acts as a reistry for all microservices
2. **api-gateway** : Zuul api gateway which acts as a proxy for all client-service and service-service communication
3. **auth-service**: Authentication and Authorization service which provides adapters for different authentication mechanisms and for authorization it depends on JWt token.
4. **functions-api**: Responsible for scanning newly added functions and registering them in database which in turn can be requested by client application wo create a workflow and by workflow executor while executing workflow
5. **workflow**: It's a co-ordinator service which can be used to Create/Update/Delete workflow from client
6. **workflow-executor**: Workflow Executor service which uses dexecutor to create a task dependency graph to execute it on ignite.
7. **scheduler**: Holds a schedule for every workflow and schedules execution of workflow depending upon schedule.

Details about each service and libraries is added in Individual Readme of each service.

repository: Mallik-G/HashmapAnalyticsFramework

repo_name: Mallik-G/HashmapAnalyticsFramework


text:
Welcome to my-vue-boilerplate 👋

> Simple typescript web application boilerplate

## Install

```sh
yarn install
```

## Usage

```sh
yarn serve
```

### Run your unit tests
```
yarn test:unit
```

### Run your end-to-end tests
```
yarn test:e2e
```

### Lints and fixes files
```
yarn lint
```

## Author

👤 **William G. (rap0so)**

* Website: https://github.com/rap0so
* Github: [@rap0so](https://github.com/rap0so)

## Show your support

Give a ⭐ if this project helped you!

***
_This README was generated with ❤ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_


text:
# PH2129: Return immutable collections

| Property | Value  |
|--|--|
| Package | [Philips.CodeAnalysis.MaintainabilityAnalyzers](https://www.nuget.org/packages/Philips.CodeAnalysis.MaintainabilityAnalyzers) |
| Diagnostic ID | PH2129 |
| Category  | [Maintainability](../Maintainability.md) |
| Analyzer | [ReturnImmutableCollectionsAnalyzer](https://github.com/philips-software/roslyn-analyzers/blob/main/Philips.CodeAnalysis.MaintainabilityAnalyzers/Maintainability/ReturnImmutableCollectionsAnalyzer.cs)
| CodeFix  | Yes |
| Severity | Error |
| Enabled By Default | Yes |

## Introduction

Returned objects from public methods should be protected against mutation from outside your class. Therefore, return only immutable or [readonly collections](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.asreadonly?view=net-7.0#remarks) from a public method, otherwise these collections can be changed by the caller without your code noticing.

The list of mutable collections that are checked are:
* `System.Collections.Generic.List<>`
* `System.Collections.Generic.Queue<>`
* `System.Collections.Generic.SortedList<>`
* `System.Collections.Generic.Stack<>`
* `System.Collections.Generic.Dictionary<>`
* `System.Collections.Generic.IList<>`
* `System.Collections.Generic.IDictionary<>`

## How to solve

Returned collection types from public methods should be either:
1. `IEnumerable`
2. one of the `IReadOnly` interfaces for these collections
3. Immutable collections

The code fixer replaces the return type to the correct `IReadOnly` interface (option 2).

## Example

Code that triggers a diagnostic:
``` cs
using System.Collections.Generic;
public class BadExample {
  public List<string> GetList() {}
}
```

And the replacement code:
``` cs
using System.Collections.Generic;
public class GoodExample {
  public IReadOnlyList<string> GetList() {}
}
```

## Configuration

This analyzer does not offer any special configuration. The general ways of [suppressing](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/suppress-warnings) diagnostics apply.

repository: philips-software/roslyn-analyzers

repo_name: philips-software/roslyn-analyzers


text:
# Plotting Mitochondrial haplogroup defining SNPs

Mitochondrial haplogroups represent sets of similar haplotypes defined by SNVs that arrose as a result of sequential accumulation of mutations during prehistoric human migrations. Here we plot haplogroup defining SNPs on the mitochondrial genome.

![Image of mtHg SNPs](plots/mtDNA.png)
_SNPs defining European mitochondiral haplogroups._

## Installation

```
git clone https://github.com/sjfandrews/mtHg-SNPs-plot.git
```

Dependencies include: `tidyverse`, `ggplot2`, `ggnewscale`, `pals`

```
install.packages('tidyverse', 'ggplot2', 'ggnewscale', 'pals')
```

Haplgroup defining SNPs were obtained from [Hi-MC](https://github.com/vserch/himc) (Smieszek, S. et al. [2018. Peerj](https://doi.org/10.7717/peerj.5149)) and [FamilyTreeDNA](https://www.familytreedna.com/mtDNA-Haplogroup-Mutations.aspx), and are are avaliable in `data/HiMC_mtSNPs.csv` and `scripts/FamilyTreeDNA_mtSNPs.R`. These are not an exhaustive list of all haplogroup defining mtSNPs, but are focused on the major macro haplogroups used by Hi-MC.

Gene boundries for the Mitochondrial geneome were obtained from the [Revised Cambridge Reference Sequence](https://www.mitomap.org/MITOMAP/HumanMitoSeq)(rCRS) and are generated by `scripts/mtDNAbdries.R`.

## Usage
Main plotting functions are avaliable in `mtHgSNPs.R`.

---

Code base was inspired by Stephen Turners [Mitochondrial Solar Plot](https://github.com/stephenturner/solarplot) and by the [GWAS Catalog ideogram](https://www.ebi.ac.uk/gwas/diagram).

repository: sjfandrews/mtHg-SNPs-plot

repo_name: sjfandrews/mtHg-SNPs-plot