text:
# LoopingThread

Looping thread is a header-only library using only standard C++11 libraries providing a utility class that periodically calls a function and cleanly exits when destroyed without waiting for timeouts.

The typical implementation of a periodically called routine is a thread that executes the routine and sleeps for a period of time, then either exits if its parent thread set a variable to tell it to exit or runs the routine again. This implementation has a problem that there's no way to make it immediately and cleanly exit while it's sleeping, so longer waiting periods make the program take time to exit and shorter ones can be a waste of resources.

This library solves the problem by using thread synchronisation mechanisms to signal it to exit. Also, its clean interface saves programs from the boilerplate code required to implement this.

The period takes the execution time into consideration and tries to ensure that the period remains the same regardless of the time the routine takes. The routine can change the waiting period during its execution to adjust its waiting time dynamically.

I have tested it on MSVC and GCC to make sure there are no busy waits or weird situations.

## How does it work?

The parent thread holds a mutex that signals that the worker thread cannot exit yet. After every iteration, the worker thread waits for the mutex to unlock for a given period of time and exits if it succeeds at obtaining the mutex. If the mutex is unlocked during the execution of the routine, it's grabbed before the wait starts and the thread exits. Because the regular mutex doesn't allow waiting on it with a deadline, `std::timed_mutex` is used instead.

## Example

```C++
LoopingThread loop(std::chrono::seconds(2), [] {
	std::cout << "(worker) Waiting for 1s" << std::endl;
	std::this_thread::sleep_for(std::chrono::seconds(1));
	std::cout << "(worker) Waited for 1s" << std::endl;
});
std::cout << "(main) Waiting for 5s" << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(7000));
std::cout << "(main) Waited for 5s" << std::endl;

```

## Troubleshooting

Error message `undefined reference to 'pthread_create'` means that you need to add `-lpthread` to the compiler options.


text:
# WaybackArchiver
[![Code Climate](https://codeclimate.com/github/buren/wayback_archiver.png)](https://codeclimate.com/github/buren/wayback_archiver) [![Docs badge](https://inch-ci.org/github/buren/wayback_archiver.svg?branch=master)](http://www.rubydoc.info/github/buren/wayback_archiver/master)
 [![Dependency Status](https://gemnasium.com/buren/wayback_archiver.svg)](https://gemnasium.com/buren/wayback_archiver) [![Gem Version](https://badge.fury.io/rb/wayback_archiver.svg)](http://badge.fury.io/rb/wayback_archiver)

Send URLs to [Wayback Machine](https://archive.org/web/) from [/sitemap.xml](http://www.sitemaps.org), single URL or file with URLs. You can also ask `WaybackArchiver` to crawl your website for URLs.

## Installation
Install the gem:
```bash
gem install wayback_archiver
```

## Usage

Command line usage:

```bash
wayback_archiver example.com          # Defaults to crawl
wayback_archiver example.com crawl    # Crawl all found links on page that has with example.com domain
wayback_archiver example.com sitemap  # Send each URL defined in example.com/sitemap.xml
wayback_archiver example.com/path url # Only send example.com/path
wayback_archiver /path/to/file file   # With an URL on each line
```

Ruby usage:

```ruby
require 'wayback_archiver'
WaybackArchiver.archive('example.com', :crawl)   # Crawl all found links on page that has with example.com domain
WaybackArchiver.archive('example.com', :sitemap) # Send each URL defined in example.com/sitemap.xml
WaybackArchiver.archive('example.com', :url)     # Only send http://example.com/some/path
WaybackArchiver.archive('/path/to/file', :file)  # With an URL on each line
```

View archive: [https://web.archive.org/web/*/http://example.com](https://web.archive.org/web/*/http://example.com)

## Docs

You can find the docs online on [RubyDoc](http://www.rubydoc.info/github/buren/wayback_archiver/master).

This gem is documented using `yard` (run from the root of this respository).

```bash
yard # Generates documentation to doc/
```

## Contributing

Contributions, feedback and suggestions are very welcome.

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## License

[MIT License](LICENSE)

---------

* Don't know what the Wayback Machine is? [Wayback Machine](https://archive.org/web/)
* Don't know what a sitemap is? [http://sitemaps.org](http://www.sitemaps.org)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# @aiteq/messenger-bot

[![npm version](https://badge.fury.io/js/%40aiteq%2Fmessenger-bot.svg)](https://badge.fury.io/js/%40aiteq%2Fmessenger-bot)  [![Dependency Status](https://david-dm.org/aiteq/messenger-bot.svg)](https://david-dm.org/aiteq/messenger-bot)  [![Build Status](https://travis-ci.org/aiteq/messenger-bot.svg?branch=master)](https://travis-ci.org/aiteq/messenger-bot)  [![Coverage Status](https://coveralls.io/repos/github/aiteq/messenger-bot/badge.svg?branch=master)](https://coveralls.io/github/aiteq/messenger-bot?branch=master)  [![Codacy Badge](https://api.codacy.com/project/badge/Grade/292b507c8c744281ba35a2cb821a7104)](https://www.codacy.com/app/tomasklima/messenger-bot?utm_source=github.com&utm_medium=referral&utm_content=aiteq/messenger-bot&utm_campaign=Badge_Grade)

#### A TypeScript coded Node.js package for effective building and managing Facebook Messenger Bots.

Features
Technologies
Getting started
Usage
Chat extensions
CLI
API Doc

```typescript
new BotServer({
    verifyToken: "hasta-la-vista-baby",
    accessToken: "open-sesame",
    appSecret: "too-secret-to-say"
})
.hear("order", async (chat: Chat) => {
    await chat.say("Well, let's order some Botcoins. I'll just ask you a few details.");
    botcoinMachine.placeOrder({
        amount: await chat.ask("How many Botcoins you want to buy?"),
        wallet: await chat.ask("What's the address of your Botcoin wallet?"),
        email: await chat.ask("And finally, tell me your email where I should send instructions.")
    });
    chat.say("Thank you for your order!");
})
.start();
```

## Major features

* Express.js based, **event-driven bot server** handling both **[Webhook](https://developers.facebook.com/docs/messenger-platform/webhook-reference)** and **[Chat Extension](https://developers.facebook.com/docs/messenger-platform/guides/chat-extensions)** requests.
* **Subscribing** to incoming text messages using regular expresions or to events emitted by the webhook middleware.
* Support for synchronous **conversations** between the bot and users.
* **Utilities** for calling [Messenger Platform API](https://developers.facebook.com/docs/messenger-platform) functions from code **outside** chatbot flow.
* Standalone **CLI** for instant access to backing functions of the Messenger API.
* Complete **type definitions** so the package is ready to be used in both **JavaScript** and **TypeScript** projects.

## Technologies used

#### Node.js
[Node](https://nodejs.org/) is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code server-side. Fot its event-driven architecture capable non-blocking I/O it is perfectly fitting platform for **building chatbots**.

#### TypeScript
A syntactical superset of JavaScript adding static typing, implementing object-oriented principles and adopting latest ES features like generics, decorators or reflection. For Node projects the [TypeScript](http://www.typescriptlang.org/) especially brings a **higher level of maintainability**.

#### Express
[Express](https://expressjs.com/) is a helpful framework built around Node.js for performing actions as a web server. The package uses the Express for **handling webhook** requests (incoming chat messages) as well as providing access to **Chat Extensions**.

#### Axios
[Axios](https://github.com/mzabriskie/axios) provides fully Promise based HTTP client functionality, so it was a clear choice for implementation of **calling Facebook Graph APIs**.

#### Embedded JavaScript Templates
[EJS](http://ejs.co/) is a very simple templating language that helps to create HTML for the pages to be shown in a programmatic way with injecting values. The package uses the EJS for **rendering Chat Extensions**.

#### Jest
[Jest](https://facebook.github.io/jest/) is yet another unit testing framework by Facebook. It covers all needed unit testing areas: tests definition, assertion and code coverage measuring and reporting. In addition the Jest supports TypeScript and Promises. It's interface is just right balanced between descriptiveness and verbosity, so its using is very intuitive..

#### Grunt
As a task runner the [Grunt](https://gruntjs.com/) helps to organize building, releasing and maintaining the package.

## Getting started

### Prerequisites
- [Node](https://nodejs.org/en/download/) installed
- [TypeScript](http://www.typescriptlang.org/index.html#download-links) installed
- [Facebook developers account](https://developers.facebook.com)
- «optional» [ngrok](https://ngrok.com/download) (or any other tunnel tool) for developing and debuging locally

### Install
```bash
npm install @aiteq/messenger-bot --save
```

### Facebook application
Create and setup a Facebook application using [Quick Start Guide](https://developers.facebook.com/docs/messenger-platform/guides/quick-start) and find out *access token* and *app secret*.

### Bot code
Create ```index.ts``` and let's go to start coding:
```typescript
import { BotServer, Chat } from "@aiteq/messenger-bot";
```

Create an instance of [BotServer](doc/classes/botserver.md):
```typescript
let bot: BotServer = new BotServer({
    name: "MyBot",
    port: process.env.PORT || 8080,
    verifyToken: "hasta-la-vista-baby",
    accessToken: "open-sesame",
    appSecret: "too-secret-to-say"
});
```

Subscribe for some text:
```typescript
bot.hear("hello", (chat: Chat) => {
    chat.say("Hello! I'm Emil, the Bot. How are you?");
});
```

Start the server:
```typescript
bot.start();
```

### Build and start
Add some scripts to ```package.json```:
```json
"scripts": {
    "compile": "tsc -p .",
    "start": "node ./dist/index.js"
},
```

Create ```tsconfig.json```:
```json
{
    "compilerOptions":
    {
        "module": "commonjs",
        "target": "es6",
        "rootDir": "src",
        "outDir": "bin"
    },
    "include": [ "src/**/*" ]
}
```

Transpile the source:
```bash
npm run compile
```

Now the bot is ready and you can bring it to live:
```bash
npm run start
```

Start ngrok:
```bash
ngrok http 8080
```
and copy the provided https:// URL for the following step.

### Setup the webhook
Follow [the guide](https://developers.facebook.com/docs/messenger-platform/guides/quick-start#steps), paste the previously copied URL to *Callback URL* and add ```/webhook```. So, if the URL provided by ngrok is e.g. ```https://54d4f722.ngrok.io```, the Callback URL will be ```https://54d4f722.ngrok.io/webhook```.

Set ```hasta-la-vista-baby``` (see [creating the bot above](#createinstance)) as *Verify Token* and click *Verify and Save*.

### It's alive!
Now the bot is listening for messages sent to your page. Try to send message "hello".

## Use cases

### Hooking text
You can subscribe to specific content of incoming text messages in two ways: exact *commands* and *regular expressions*. The subscribing is done using the [BotServer.hear()](doc/classes/botserver.md#hear) method.

#### Commands
Hooking exact words or phrases can be useful when your bot is supposed to listen for commands like a CLI. Commands are specified as strings or arrays of strings and are considered to be case-insensitive.
```typescript
bot.hear("wait", (chat: Chat) => {
    chat.say("I'm waiting ...");
})
.hear(["sleep", "go sleep", "go to sleep"], (chat: Chat) => {
    chat.say("Well, good night");
});
```

#### Regular expressions
Subscribing to specific content using regular expressions is much more flexible than listing exact words. Like commands, regular expressions can be specified as an array or single. If the regular expression contains capturing groups they are passed to the callback as third argument.
```typescript
bot.hear(/^good (night|morning)$/i, (chat: Chat, text: string, captured: string[]) => {
    chat.say(`Hi, good ${captured[0]}!`);
});
```
In addition, you can mix commands and regular expressions in the same array.

**Note**: The regular expressions are used exactly as given, so if you want to test the text in case-insensitive manner you must explictily indicate it (the `i` flag).

### Hooking events
Besides searching for specific text you can also subscribe to a number of events emitted while the bot is receiving messages through webhook. The subscribing is done using the [BotServer.on()](doc/classes/botserver.md#on) method.

Check the [Webhook.Event](doc/enums/webhook.event.md) enum for complete set of available events.

#### Identified Postback events
When subscribing to Postback based events
- [Postback button](doc/enums/webhook.event.md#postback_button)
- [Persistent Menu item](doc/enums/webhook.event.md#persistent_menu)
- [Quick Reply button](doc/enums/webhook.event.md#text_quick_reply)

you have two options:
1. subscribe to the **type** of the event and receive all events of this type (e.g. Persistent Menu item selected):
```typescript
bot.on(Webhook.Event.PERSISTENT_MENU, (chat: Chat) => {
    chat.say("You've selected some menu item, but I really don't know what you want to do...");
});
```

2. subscribe to the specific **ID** in addition to the type, what is much more useful way:
```typescript
bot.on(Webhook.Event.PERSISTENT_MENU, "menu-item-about", (chat: Chat) => {
    chat.say("What can I say about myself... I'm a bot.");
});
```

### Conversation
Conversation is synchronous message exchange between users and the bot by setting a flow of questions and answers. It's a useful way to get conventional UI tasks, like form filling, closer to interpersonal communication.

In order to ensure execution of steps of the conversation synchronously, all methods of the [Chat](doc/classes/chat.md) class return Promises. So you can call next step after resolving the current. And when you add a little bit of syntactic sugar using the ```async```/```await``` concept, the conversation flow will look much more readable, almost like a real dialog.

There are two methods for interaction with the user:
* [ask()](doc/classes/chat.md#ask) - asking with plain text question
* [askWithMessage()](doc/classes/chat.md#askwithmessage) - asking with structured message

**Note:** No events are emitted and no hear handlers called when the bot receives an answer to the question asked.

```typescript
bot.on(Webhook.Event.PERSISTENT_MENU, "menu-item-song", async (chat: Chat) => {
    profile.favSong = await chat.ask("What's your favourite song?");
});
```

Or more complex flow:

```typescript
bot.on(Webhook.Event.PERSISTENT_MENU, "menu-item-order", async (chat: Chat) => {
    await chat.say("Well, let's order some Botcoins. I'll just ask you a few details.");
    order.amount = await chat.ask("How many Botcoins you want to buy?");
    order.wallet = await chat.ask("What's the address of your Botcoin wallet?");
    order.email = await chat.ask("And finally, tell me your email where I should send instructions for payment.");
    chat.say("Thank you for your order!");
});
```

#### Input validation
As with classic forms, even in the case of a conversation, we need to validate user inputs. Therefore, the interface offers the ability to call a validation function wich you can pass when calling the [ask()](./doc/classes/chat.md#ask) method. As a validator you can conveniently use functions from [validator.js](https://github.com/chriso/validator.js) package:
```typescript
import * as validator from "validator";

bot.on(Webhook.Event.PERSISTENT_MENU, "menu-item-form", async (chat: Chat) => {
    //...
    let email: string = await chat.ask("Give me your email address, please", validator.isEmail)
    //...
});
```
The bot will automatically repeat the question until the user enters a valid email address.

#### Unanswered questions
The questions asked using the [ask()](doc/classes/chat.md#ask) or [askWithMessage()](doc/classes/chat.md#askwithmessage) method may remain unanswered by the user. In order to avoid pending Promises these questions are set to automatically expire. The expiration period is set to 5 minutes by default but you can override it using [BotConfig.askTimeout](doc/interfaces/botconfig.md#asktimeout) parameter. The unanswered question is rejected after its expiration. If you want to react to this situation you may catch the rejection:

```typescript
bot.on(Webhook.Event.PERSISTENT_MENU, "menu-item-name", async (chat: Chat) => {
    try {
        let name = await chat.ask("What's your name?");
        chat.say(`Hello, ${name}. My name is Emil.`);
    } catch (error) {
        chat.say("I'm so sorry you have no name.");
    }
});
```
If you won't catch the expiration the bot will swallow it without consequences. Don't worry about it.

### Media reusing

When you're about to send a message with a media attached you can indicate wheather the media should be reused. The bot stores all reusable attachment ID's. When you try to send the same attachment (with the same URL and `reusable` set to `true`) twice or more times the bot replace media's URL with stored attachment ID.

### BotUtils

The [Facebook Messenger Platform API](https://developers.facebook.com/docs/messenger-platform) contains not only interactive functions for message exchange between the bot and users. There are a lot of services in the API backing the communication like activating [Get Started button](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button), installing [Persistent Menu](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu) or generating [Messenger Code](https://developers.facebook.com/docs/messenger-platform/messenger-code).

Sometimes, we also want to send a *push message* - a message sent to the user proactively, not just as a response to some incoming message.

The above cases are not quite bot-aware functions. Thus, in order to keep [BotServer](doc/classes/botserver.md)'s interface clean, these services are made available through the [BotUtils](doc/classes/botutils.md) class.

An instance of the [BotUtils](doc/classes/botutils.md) is initialized passing the the ```accessToken```.
```typescript
let utils: BotUtils = new BotUtils("open, sesame");
```

#### Example: send push message
```typescript
utils.sendText("123450987643", "RATE ALERT: Botcoin price has reached $1,000");
```
See [BotUtils.sendText()](doc/classes/botutils.md#sendtext)

#### Example: activate Get Started button
```typescript
utils.setGetStartedButton();
```
See [BotUtils.setGetStartedButton()](doc/classes/botutils.md#setgetstartedbutton)

#### Example: generate Messenger Code
```typescript
utils.generateMessengerCode("my-m-code.png");
```
See [BotUtils.generateMessengerCode()](doc/classes/botutils.md#generatemessengercode)

## Server monitoring

The bot server supports responding for *ping* requests. By default, the ping service is attached to `/ping` path and may be overrided by [BotConfig.pingPath](doc/interfaces/botconfig.md#pingpath) configuration parameter. The ping request must use the GET method. If all goes well the `"OK"` string is returned with 200 HTTP code.

The ping feature is useful with conjunction with up-time monitoring services like [Uptime Robot](https://uptimerobot.com/).

## Chat extensions

The package supports [Embedded JavaScript Templates (EJS)](http://ejs.co/) for rendering Chat Extension views. For creating a new extension follow these steps.

#### 1. Implement [ChatExtension](doc/interfaces/chatextension.md) interface
```typescript
import { ChatExtension } from "@aiteq/messenger-bot";

export class MyExtension implements ChatExtension {

    constructor() {
        // name your extension - the name will be a part of extension's URL
        super("my");
    }

    // implement abstract method getModel()
    public getModel(): any {
        return {
            name: "Captain Nemo"
        };
    }
}
```
The chat extension class must implement abstract method `getModel()` that provides data to be used in the view.

The `getModel` is called every time an extension is requested.

#### 2. Create view

In your project root create `views` folder (default for placing views in Express application) and `my.ejs` file within it.

```html
<!DOCTYPE html>
<html>
    <head>
        <title>My Extension</title>
    </head>
    <body>
        <div>Greetings, <%= name %>!</div>
    </body>
</html>
```
#### 3. Add the extension

At last you have to register the extension to the bot server using the [addChatExtension](doc/classes/botserver.md#addchatextension) method.

```typescript
bot.addChatExtension(new MyExtension());
```

Now the extension is ready to use and you can test it pointing to `<your-bot-url>/ext/my`.

*Note that the default path for extensions is `/ext` and you can chanage it by setting the `extensionPath` property of [BotConfig](doc/interfaces/botconfig.md).*

## CLI

The [BotUtils](doc/classes/botutils.md) class is useful if you need non-interactive functions of the Messenger API to be called within your application. More often, however, you will need to use these features one-time, operatively, or as a part of such automated workflow like shell script. There is a Command Line Interface ready for these cases.

#### General usage

```bash
mbutil <group> [command] [options]
```

A *group* represents a specific part of the Messenger API. Available groups are:

Group|Functions
---|---
```send```|Send text or attachment message
```getstarted```|Manage Get Started button
```greeting```|Manage page's localized greetings
```menu```|Manage Persistent Menu
```domains```|Manage Domain Whitelist
```audience```|Manage Target Audience settings
```accountlinking```|Manage Account Linking settings
```chatext```|Manage Chat Extensions settings
```code```|Generate Messenger Code

For each group, you can view help by:
```bash
mbutil <group> --help
```

Global options:

Option|Function
---|---
```--config <path>```|path to the config JSON file; must contain the ```accessToken``` property
```--accessToken <token>```|*access token* (one of ```--config``` or ```--accessToken``` must be specified)
```--help```|display help for the group

#### Group: ```send```
Send plain text or attachment push message.

Usage:
```bash
mbutil send "<text>" --recipient <id> [options]
mbutil send image|audio|video|file --url <url> --recipient <id> [options]
```

Options:
Option|Function
---|---
```--recipient <id>```|ID of the recipient
```--url <url>```|URL of the file to be attached

#### Group: ```getstarted```
Manage [Get Started button](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button).

Display current setting:
```bash
mbutil getstarted get [options]
```

Activate the button with optional data:
```bash
mbutil getstarted set [--data "<data>"] [options]
```

Remove the button:
```bash
mbutil getstarted delete [options]
```

Options:
Option|Function
---|---
```--data "<data>"```|text or JSON to be send when the user tapped the button

#### Group: ```greeting```
Manage page's localized [Greeting](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text).

Display current setting:
```bash
mbutil greeting get [options]
```

Add localized greeting text:
```bash
mbutil greeting add "<text>" [--locale <locale>] [options]
```

Remove greeting text:
```bash
mbutil greeting delete [options]
```

Options:
Option|Function
---|---
```--locale <locale>```|greeting's locale ([supported locales](https://developers.facebook.com/docs/messenger-platform/messenger-profile/supported-locales)); if omitted the text will be set as default

#### Group: ```menu```
Manage [Persistent Menu](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu).

Display current setting:
```bash
mbutil menu get [options]
```

Set Persistent Menu according to definition in a JSON file:
```bash
mbutil menu set --file <path> [--locale <locale>] [options]
```

Remove Persistent Menu:
```bash
mbutil menu delete [options]
```

Options:
Option|Function
---|---
```--file <path>```|path to menu definition JSON file

Required structure of the JSON menu definition file is clear from the following example (object contains two variants of the menu for `"default"` and `"cs_CZ"` locales):
```json
{
    "default": {
        "composerInputDisabled": false,
        "items": [
            {
                "title": "Show exchange rate",
                "id": "menu-rate"
            },
            {
                "title": "Buy Botcoins",
                "id": "menu-buy"
            },
            {
                "title": "Aiteq International, Ltd.",
                "url": "http://www.aiteq.international"
            }
        ]
    },
    "cs_CZ": {
        "composerInputDisabled": false,
        "items": [
            {
                "title": "Aktuální kurz",
                "id": "menu-rate"
            },
            {
                "title": "Koupit Botcoiny",
                "id": "menu-buy"
            },
            {
                "title": "Aiteq Reloaded, s.r.o.",
                "url": "http://www.aiteq.com"
            }
        ]
    }
}
```

#### Group: ```domains```
Manage [Domain Whitelist](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting).

Display current whitelisted domains:
```bash
mbutil domains get [options]
```

Add one or more domains (space separated list) to the whitelist:
```bash
mbutil domains add <domain> [domains] [options]
```

Delete the domain whitelist:
```bash
mbutil domains delete [options]
```

#### Group: ```audience```
Manage [Target Audience](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience) settings.
Countries are identified by [ISO 3166 Alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).

Display current setting:
```bash
mbutil audience get [options]
```

Open Target Audience for all countries:
```bash
mbutil audience open [options]
```

Close Target Audience for all countries:
```bash
mbutil audience close [options]
```

Add one or more countries (space separated list) to the whitelist:
```bash
mbutil audience whitelist <country> [countries] [options]
```

Add one or more countries (space separated list) to the blacklist:
```bash
mbutil audience blacklist <country> [countries] [options]
```

Remove all Target Audience settings:
```bash
mbutil audience delete [options]
```

#### Group: ```accountlinking```
Manage [Account Linking URL](https://developers.facebook.com/docs/messenger-platform/messenger-profile/account-linking-url).

Display currently set Account Linking URL:
```bash
mbutil accountlinking get [options]
```

Set Account Linking URL:
```bash
mbutil accountlinking set <url> [options]
```

Delete currently set Account Linking URL:
```bash
mbutil accountlinking delete [options]
```

#### Group: ```chatext```
Manage [Chat Extension URL](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url).

Display currently set Chat Extension URL and settings:
```bash
mbutil chatext get [options]
```

Set Chat Extension URL:
```bash
mbutil chatext set <url> [options]
```

Delete currently set Chat Extension URL:
```bash
mbutil chatext delete [options]
```

Options:
Option|Value|Function
---|---|---
```--inTest```| |controls whether public users can see the Chat Extension
```--shareButton```| |controls whether the share button in the webview is enabled

#### Group: ```code```
Generate [Messenger Code](https://developers.facebook.com/docs/messenger-platform/messenger-code).

Set Chat Extension URL:
```bash
mbutil code generate [options]
```

Options:
Option|Value|Function
---|---|---
```--out```|path|output file's path and name (default: ```./code.png```)
```--size```|number between ```100``` - ```2000```|size of generated image, in pixels (default: ```1000```)
```--ref```|text|data to be received when user scans the code (optional)

## API documentation
Package's [reference API documentation](doc/README.md) is located in [doc](doc/README.md) folder.

## Credits
Tomáš Klíma, [Aiteq](http://www.aiteq.com) & [Aiteq](http://www.aiteq.international)

## License
MIT

repository: AliceZoemem/MessangerBot

repo_name: AliceZoemem/MessangerBot


text:
---
external help file: Microsoft.Tools.WindowsInstaller.PowerShell.dll-Help.xml
Module Name: MSI
online version:
schema: 2.0.0
---

# Get-MSIFileHash

## SYNOPSIS
Gets a hash of a file in a Windows Installer-compatible format.

## SYNTAX

### Path (Default)
```
Get-MSIFileHash [-PassThru] [[-Path] <String[]>] [<CommonParameters>]
```

### LiteralPath
```
Get-MSIFileHash [-PassThru] -LiteralPath <String[]> [<CommonParameters>]
```

## DESCRIPTION
Get-MSIFileHash returns a 128-bit file hash in 4 separate parts, compatible with columns in the MsiFileHash table in Windows Installer packages.
All non-versioned files should contain this hash.

You can optionally add these HashPart1, HashPart2, HashPart3, and HashPart4 properties to FileSystem items.

## EXAMPLES

### EXAMPLE 1
```
get-msifilehash -path * | format-table -auto
```

This command outputs the file hash of every file in the current directory as a table.

### EXAMPLE 2
```
get-childitem | where-object {$_.PSIsContainer -eq $False} | get-msifilehash -passthru | format-table Name, MSI* -auto
```

This command outputs the name and hash parts of each file in the current directory.

## PARAMETERS

### -LiteralPath
The path to the item or items which must resolve to a file system path.
The value of -LiteralPath is used exactly as typed.
No characters are interpreted as wildcards.

```yaml
Type: String[]
Parameter Sets: LiteralPath
Aliases: PSPath

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -PassThru
Passes the item or items passed into this cmdlet through the pipeline with additional properties for the file hash.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Path
The path to the item or items which must resolve to a file system path.
You can specify * in any part of the path to select all matching files.

```yaml
Type: String[]
Parameter Sets: Path
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: True
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### Microsoft.Tools.WindowsInstaller.FileHash

### System.IO.DirectoryInfo

### System.IO.FileInfo

## NOTES

## RELATED LINKS

[Get-MSIFileType](get-msifilehash)

repository: laudarch/psmsi

repo_name: laudarch/psmsi


text:
# spotty-curses
_Terminal-based UI for remote controlling Spotify(d) and other players_

## Why

FreeBSD has no native Spotify client, but has Spotifyd.
However, there are no UI's that can interact with players that work properly on FreeBSD either.

Also, terminal applications are cool.

## Installing

## Configuring

The main configuration file is stored in `~/.config/spotty-curses/config.json`.
Look at [lib/config.default.js](lib/config.default.js) for available options.

### App Registration

You need to specify a clientID and clientSecret, attained by registering an
app with Spotify. These should be put in the authentication object in you
config at ~/.config/spotty-curses/config.json. See default config in
lib/config.default.js for reference.

For more information on how to do this, visit:
https://developer.spotify.com/documentation/general/guides/app-settings/

### Logging in

The first time starting the application, a URL will be outputted in the terminal.
Click this to give the necessary access to your account (limited to read operations).

The token generated based on the authentication request is stored in
`~/.config/spotty-curses/.token`, and perists between sessions.

## License

Licensed under the [Simplified BSD License](LICENSE).

repository: cvasseng/spotty-curses

gha_language: JavaScript

gha_license_id: NOASSERTION

repo_name: cvasseng/spotty-curses


text:
# thtong.gocryptfs

Installs gocryptfs, encrypted overlay filesystem written in Go, for amd64 Linux. <https://github.com/rfjakob/gocryptfs>

## Requirements

None.

## Role Variables

    gocryptfs_action: install # to remove set to uninstall
    gocryptfs_version: latest # set to specific release for older versions
    gocryptfs_user: set owner of binaries - defaults to ssh user of target host
    gocryptfs_bin_dir: set to destination path of binaries - defaults to /usr/local/bin

## Dependencies

None.

## Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

    - hosts: servers
      roles:
         - { role: thtong.gocryptfs }

## License

BSD

## Author Information

An optional section for the role authors to include contact information, or a website (HTML is not allowed).

repository: thtong/ansible-role-gocryptfs

branch_name: refs/heads/main

repo_name: thtong/ansible-role-gocryptfs


text:
---
layout: default
title: Git 2 git migration script
date: 2012-06-19
category: Programming
tags:
- git
- git migration
- git2git
- ruby
type: post
excerpt: Migrate a git repository via your local machine - all branches and tags included!

---

Here's a small ruby script I wrote to help me facilitate an upcoming git to git migration.
It takes two params, first the name of the repository to be migrated, second the name of the new remote repository.
The script is simple and straightforward, it clones the remote repository to the current directory, fetches all branches, creates a new mirror, pushes all branches and pushes all tags - done.
Feel free to use and further improve it...
Note: The new remote repository must already exist (bare).

{% gist 2956098 %}

repository: danielkummer/code-n-fold

repo_name: danielkummer/code-n-fold


text:
### [CVE-2021-20232](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-20232)
![](https://img.shields.io/static/v1?label=Product&message=gnutls&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-416&color=brighgreen)

### Description

A flaw was found in gnutls. A use after free issue in client_send_params in lib/ext/pre_shared_key.c may lead to memory corruption and other potential consequences.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/GitHubForSnap/ssmtp-gael
- https://github.com/epequeno/devops-demo
- https://github.com/onzack/trivy-multiscanner

repository: trickest/cve

gha_language: HTML

gha_license_id: MIT

repo_name: trickest/cve


text:
# In-Session User Authentication Dialog

This Ash dialog is for authenticating the user during a user session. The
primary use case is WebAuthn, where a platform daemon (u2fd) receives an
authentication request from the Chrome browser, and needs to initiate a user
authentication dialog which could involve fingerprint, PIN and password. More
authentication methods, such as SmartLock and smart cards, might be added in
the future.

This dialog is designed to be reused by other projects that need to trigger
in-session user authentication from ChromeOS, such as authenticating for ARC
apps.

This dialog is controlled by ash::AuthDialogController. When the user provides
a credential, the controller talks to cryptohome via
chromeos::ExtendedAuthenticator for authentication.

repository: chromium/chromium

repo_name: chromium/chromium


text:
# Office 365 VCF Import/Export Sample #

This Ruby on Rails sample shows how to use the [Contacts API](https://msdn.microsoft.com/office/office365/APi/contacts-rest-operations) via the [ruby_outlook](http://github.com/jasonjoh/ruby_outlook) gem.

## Required software ##

- [Ruby on Rails](http://rubyonrails.org/)
- [ruby_outlook](http://github.com/jasonjoh/ruby_outlook)
- [bootstrap-sass](https://rubygems.org/gems/bootstrap-sass)
- [oauth2](https://rubygems.org/gems/oauth2)
- [carrierwave](https://rubygems.org/gems/carrierwave)
- [vcard](https://rubygems.org/gems/vcard)

## Running the sample ##

It's assumed that you have Ruby on Rails installed before starting.

1. Download or fork the sample project.
2. Open a command prompt/shell to the directory where you downloaded the project and run `bundle` to install the required gems.
3. Run `bundle exec rake db:setup` to setup the database.
4. [Register the app in Azure Active Directory](https://github.com/jasonjoh/office365-azure-guides/blob/master/RegisterAnAppInAzure.md). The app should be registered as a web app with a Sign-on URL of "http://localhost:3000", and should be given permission to "Have full access to users' contacts".
4. Edit the `.\app\helpers\auth_helper.rb` file. Copy the client ID for your app obtained during app registration and paste it as the value of the `CLIENT_ID` variable. Copy the key you created during app registration and paste it as the value of the `CLIENT_SECRET` variable. Save the file.
5. Run the server by running `rails server` from the command line.
6. User your browser and go to http://localhost:3000.
7. Click the 'Sign in with your Office 365 Account' button to use the app.

## Copyright ##

Copyright (c) Microsoft. All rights reserved.

----------
Connect with me on Twitter [@JasonJohMSFT](https://twitter.com/JasonJohMSFT)

Follow the [Exchange Dev Blog](http://blogs.msdn.com/b/exchangedev/)


text:
# Alfred workflow to integrate Todoist with Toggl Track

Simply show Todoist tasks and start Toggl Track time entries like [this integration](https://todoist.com/help/articles/use-toggl-track-with-todoist).

## How to install
Go to [release page](https://github.com/jkw552403/todoist-/releases), download the workflow, and open it on your Mac.

## Usage
- `tt:setting`: Set Todoist token and Toggl token
- `ttt`: Show Today tasks (similar to Todoist Today view).
- `tto`: Show running Toggl entry and you can click `Return` to stop it.
- In the task list,
  - You can select a task and complete it with `Command` + `Return`.
  - You can select a task and start tracking it with `Option` + `Return`. The time entry will use the same project name as the Todoist task if the project exists in Toggl.

## TODO
- [ ] Support refresh Todoist tasks manually
- [ ] Support searching by project names, labels, or filters.
- [ ] Upload to Packal

## Install Python libraries for development
```bash
# Python libraries are put to build/ directory
pip install --target=build -r requirements.txt
```

## Test for Toggl API client
A simple test case is written for Toggl APIs:
```bash
# replace the token below and make sure
API_TOKEN=XXXXXX /usr/bin/python test_toggl_client.py
```
The test will create/start a new time entry, end it, and delete it.


text:
---
layout: page
title: 'streamDM: Data Mining for Spark Streaming'
image:
  feature: screen_finance.png
---

streamDM is a new open source software for mining big data streams using [Spark Streaming](https://spark.apache.org/streaming/), developed at [Huawei Noah's Ark
Lab](http://www.noahlab.com.hk/). streamDM is licensed under Apache Software License v2.0.

## Big Data Stream Learning

Big Data stream learning is more challenging than batch or offline learning,
since the data may not keep the same distribution over the lifetime of the
stream. Moreover, each example coming in a stream can only be processed once, or
they need to be summarized with a small memory footprint, and the learning
algorithms must be very efficient.

### Spark Streaming

[Spark Streaming](https://spark.apache.org/streaming/) is an extension of the
core [Spark](https://spark.apache.org)  API that enables stream processing from
a variety of sources. Spark is a extensible and programmable framework for
massive distributed processing of datasets, called Resilient Distributed
Datasets (RDD). Spark Streaming receives input data streams and divides the data
into batches, which are then processed by the Spark engine to generate the
results.

Spark Streaming data is organized into a sequence of DStreams, represented
internally as a sequence of RDDs.

### Included Methods

In this first release of StreamDM, we have implemented:

* [SGD Learner](docs/SGD.html) and [Perceptron](docs/SGD.html#perceptron)
* [Naive Bayes](docs/NB.html)
* [CluStream](docs/CluStream.html)
* [Hoeffding Decision Trees](docs/HDT.html)
* [Bagging](docs/Bagging.html)
* [Stream KM++](docs/StreamKM.html)

We have implemented following [data generators](docs/generators.html):

* HyperplaneGenerator
* RandomTreeGenerator
* RandomRBFGenerator
* RandomRBFEventsGenerator

We have also implemented [SampleDataWriter](docs/SampleDataWriter.html), which can call data generators
to create sample data for simulation or test.

In the next releases we plan to add:

* Classification: Random Forests
* Regression: Hoeffding Regression Tree, Bagging, Random Forests
* Clustering: Clustree, DenStream
* Frequent Itemset Miner: IncMine, IncSecMine

## Going Further

For a quick introduction to running StreamDM, refer to the [Getting
Started](docs/GettingStarted.html) document. The StreamDM [Programming
Guide](docs/Programming.html) presents a detailed view of StreamDM. The full API
documentation can be consulted [here](api/index.html).

##Mailing lists

###User support and questions mailing list:
<a href="mailto:streamdm-user<EMAIL_ADDRESS>###Development related discussions:
<a href="mailto:streamdm-dev<EMAIL_ADDRESS>

repository: nhnminh/myStreamDM

repo_name: nhnminh/myStreamDM


text:
# Vipps settlements: OCR

OCR files are no longer provided by Vipps.
Invoice payments are made directly from the user to the merchant, so settlement files
are provided by the bank, not Vipps.

Documentation for the legacy invoice solution: [Vipps Faktura](ocr/vipps-invoice-api-vipps-faktura.pdf).

Details:

See the [Settlements](..) overview.

repository: phpanteon/vipps-developers

repo_name: phpanteon/vipps-developers


text:
---
hrs_structure:
  division: '5'
  volume: '14'
  title: '38'
  chapter: '835'
  section: 835-4
type: hrs_section
tags:
  - Crime
  - Criminal Proceeding
menu:
  hrs:
    identifier: HRS_0835-0004
    parent: HRS0835
    name: 835-4 Material witness order; arraignment
weight: 44020
title: Material witness order; arraignment
full_title: 835-4 Material witness order; arraignment
---
**§835-4 Material witness order; arraignment.** (a) When the prospective witness appears before the court, the court must inform the prospective witness of the nature and purpose of the proceeding, and that the prospective witness is entitled to a prompt hearing upon the issue of whether the prospective witness should be adjudged a material witness. The prospective witness possesses all the rights, and is entitled to all the court instructions, with respect to right to counsel, opportunity to obtain counsel and assignment of counsel in case of financial inability to retain such, which, pursuant to rule 5(d)(1), Hawaii rules of criminal procedure, accrue to a defendant arraigned upon a felony complaint in the district court.

(b) If the proceeding is adjourned at the prospective witness' instance, for the purpose of obtaining counsel or otherwise, the court must order the prospective witness to appear upon the adjourned date. The court may further fix bail to secure the prospective witness' appearance upon such date or until the proceeding is completed and, upon default thereof, may commit the prospective witness to the custody of the chief of police for such period. [L 1971, c 214, pt of §1; [HRS §718-4](/title-37/chapter-718/section-718-4/); ren L 1972, c 9, pt of §1; gen ch 1985]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# Monero - Simple Stagenet Environment Setup

## Linux

### Tools

```
sudo apt-get install net-tools
sudo apt-get install git
```

### Monero

1. Run the following in a terminal.

```
sudo apt update && sudo apt install build-essential cmake pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev
git clone https://github.com/monero-project/monero.git
cd monero
git checkout release-v0.17
git submodule init && git submodule update --force
make release
```

2. Copy release-v0.17 folder and rename the copy to master (`cp -R release-0.17 master`). The onion-monero-block-explorer looks for a master build path and will not configure correctly without it.

3. Enable huges pages. (This is necessary for randomx validation)

```
sudo bash -c "echo vm.nr_hugepages=$(nproc) >> /etc/sysctl.conf"
```

4. Run MoneroD from the bin folder

```
./monerod --detach --stagenet --confirm-external-bind --rpc-bind-ip put.your.ip.here --hide-my-port --log-level 1
tail -f ~/.bitmonero/stagenet/bitmonero.log
```

5. Wait for the monero stagenet blockchain will to sync.

6. Run Monero CLI Wallet from the bin folder

```
./monero-wallet-cli --stagenet
```

7. Create a new wallet through the cli, do not enable mining when prompted.

8. Set it to point to your local instance of MoneroD

```
set_daemon put.your.ip.here
```

9. Make a note of your wallet address (using the `address` command) and then `exit` the wallet.

10. Run Monero-Wallet-RPC from the bin folder

```
./monero-wallet-rpc --detach --stagenet --confirm-external-bind --rpc-bind-port 38084 --daemon-host put.your.ip.here --wallet-file /path/to/created/wallet --password put_your_wallet_password_here
```

### Monero Pool

1. Run the following in a terminal

```
sudo apt-get install liblmdb-dev libevent-dev libjson-c-dev uuid-dev
export MONERO_ROOT=/path/to/cloned/monero/repository/root
make release
```

Note:
If you encounter build errors for the pool that complains about `CONF_Modules_Unload`, then either SSL is missing or you
need to upgrade your existing SSL with the below:

```
wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz
tar -zxf openssl-1.1.1h.tar.gz && cd openssl-1.1.1h
./config
sudo make install
sudo ln -s /usr/local/bin/openssl /usr/bin/openssl
```

2 Update the `pool.conf` configuration
In `pool.conf` the following settings need to be changed to:

```
pool-wallet = your_wallet_address
rpc-host = put.your.ip.here
rpc-port = 38081
wallet-rpc-host = <IP_ADDRESS>
wallet-rpc-port = 38084
```

### Run the pool

1. To run the pool both `monerod` and `monero-wallet-rpc` need to be running.

2. Run the following in a terminal

```
./monero-pool --forked
```

### Onion Monero Blockchain Explorer

1. Run the following in a terminal

```
sudo apt-get install build-essential cmake libcurl4-openssl-dev
sudo apt install curl
git clone https://github.com/moneroexamples/onion-monero-blockchain-explorer.git
cd onion-monero-blockchain-explorer
mkdir build && cd build
cmake .. -DMONERO_DIR=/path/to/cloned/monero/repository/root
make
```

2. Run the explorer

```
./xmrblocks -s -b /path/to/monero/stagenet/lmdb/ -d put.your.ip.here --enable-randomx --enable-pusher --enable-emission-monitor --stagenet-url <IP_ADDRESS>:8081
```

### XMRig

1. Run the following in a terminal

```
sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
git clone https://github.com/xmrig/xmrig.git
mkdir xmrig/build && cd xmrig/build
cmake ..
make -j$(nproc)
```

2. Follow the wizard tool here https://xmrig.com/wizard

When you get to the pools section, select "Add Daemon" and use your ip address for the host, 38081 for the port and your_wallet_address for Wallet Address.

Download the `json.config` and place it in the same directory as the XMRig exectable.

3. Run XMRig with

```
./xmrig
```

repository: tari-project/tari

branch_name: refs/heads/development

gha_language: Rust

repo_name: tari-project/tari


text:
# BluemixExample

Welcome to the BluemixExample wiki!

Here is an example i have tried with Bluemix. It supports authentication, Speech to Text, Text to Speech and invoking RestAPI on both NodeJS and Java web services.

Once after setting up your bluemix account, Please add application route and application GUID from bluemix app to bluemixAppValues.plist file.

And add Speech to Text and Text to Speech credentials also to this plist file.

repository: FarooqMulla/BluemixExample

repo_name: FarooqMulla/BluemixExample


text:
---
layout: post
title: Input and Output
---

Programs take input and produce output. The output is the result of doing something with the input. Input, transform, output, done.

This pattern is easy to see when the program is a UNIX tool. Take a string, count the words, print out the result. But it's a lot harder to see when we're writing an iOS app with a UI, lots of different features, periodic tasks, etc.

What's the input and output?

The input is all the sources of action for your app. It's taps. It's keyboard events. It's timer triggers, GPS events, and web service responses. These things are all inputs. They all feed into the app, and the app combines them all in some way to produce a result: the output.[^1]

The output is often a change in the app's UI. A switch is toggled or a list gets a new item. Or it could be more than that. It could be a new file on the device's disk, or it could be an API request. These things are the outputs of the app.

But unlike the classic input/output design, this input and output happens more than once. It's not just a single input → work → output—the cycle continues while the app is open. The app is always consuming inputs and producing outputs based on them.

To put it another way, the output at any one time is the result of combining all inputs. The output is a _function_ of all inputs up to that time.[^2]

So **why should we care?** Because fresh perspectives are powerful and good and necessary and cool. And in this case, it gives us a fantastic new tool.

### State

There's no intrinsic idea of state from this perspective. There's just a change in an input resulting in a new output. State might be an implementation detail with how the app handles its inputs, but it's not necessary. It's not intrinsic to the idea.

Most problems worth solving have some intrinsic state. State _can_ be essential. But that's not how we treat it. We solve everything with state. Because we treat all the inputs to our app as different things—a touch event here, a web response there—we can't combine them in any meaningful way. We can't transform them uniformly. And so our only tool for dealing with all these different things is state. When our only tool is state, every problem looks like a stateful nail.

State is bad. State introduces complexity. And worse, it introduces complexity that grows more than linearly with the size of our app.[^3] We're in the habit of constantly introducing more state into our app. New feature? New state. New complexity. New bugs.[^4]

But happily this perspective of our app's output as a function of its inputs over time gives us a new tool: functional reactive programming. Functional reactive programming (FRP) is a paradigm built around the idea of time-varying values produced by time-varying functions.

### Time

"Time-varying values" might sound like a bit of sleight-of-hand. Isn't that just another way of saying "state?" They're both trying to capture the same idea—that things change as the program runs. But by formalizing and reifying time variance, we can reason about change safely.

Time-varying values can be derived from other time-varying values, which are themselves derived from the time-varying inputs to the app. So while traditional state places the burden of ensuring our app is always in a known consistent state on us, the programmers, FRP lets us define our app in terms of the time-varying values and ensures changes propagate as needed.

Before, state was discrete pieces of data all moving independently. But time-varying values are cogs all fitting together in a gear. When one turns, it turns all its connected cogs, which turns their cogs, which turns… and ends up running the entire mechanism all by themselves.

 The result of asynchronous work is really just a time-varying value that only has a value once the work is done.[^6] Or a UI element's value could be seen as a time-varying value that changes as the user interacts with it. If my app is running on a mobile device, the device's GPS coordinates is a time-varying value.

It's all time-varying values, all the way down.[^7] State, inputs, and outputs.

### Functional Reactive Programming

As the _functional_ in "functional reactive programming" suggests, FRP comes from functional programming languages.

Haskell has a [number of implementations](http://www.haskell.org/haskellwiki/Functional_Reactive_Programming), with varying levels of completeness and usability.

Racket, a Lisp-y language, has [FrTime](http://docs.racket-lang.org/frtime/).

There've also been a number of interpretations for imperative languages. The 900lb gorilla is the [Reactive Extensions](http://msdn.microsoft.com/en-us/data/gg577609.aspx) (Rx) from Microsoft. It's the first compelling example of how to bring the principles of FRP to an imperative language.

Netflix [re-implemented Rx](http://techblog.netflix.com/2013/02/rxjava-netflix-api.html) on the JVM. They have [adapters](https://github.com/Netflix/RxJava/tree/master/language-adaptors) for Clojure, Scala, Groovy, and JRuby.

There are a few different FRP-inspired libraries for Javascript. Microsoft has [RxJS](https://github.com/Reactive-Extensions/RxJS) and there's also [Flapjax](http://www.flapjax-lang.org/), and [BaconJS](https://github.com/raimohanska/bacon.js).

[Elm](http://elm-lang.org/) is a Haskell-like language that compiles to JavaScript. It's the most beautiful, practical FRP implementation I've seen.

Last but not least, myself and some of the other fine folks at GitHub brought Rx to Objective-C: [ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa).

### Example

Let's take a quick look at how this works out practically. FRP is most beautiful in a functional language, but sadly most of us don't do our everyday work in a functional language.

Let's suppose we're writing an iOS app. We're going to use ReactiveCocoa to implement a Create Account view. The user will enter their first name, last name, and email (and we'll make them re-enter their email just to be annoying) and there will be a Create button for them to tap.

Think in terms of inputs and output. What are the inputs to the view? Obviously the user will input their information. And then they'll tap the Create button. That's it. Those are all the inputs to our view. Our outputs should be defined in terms of them.

There will be a number of outputs in the form of UI changes. The Create button should only be enabled once the user has entered values for first name, last name, and the email and re-enter email fields match.

If we were writing this traditionally, we'd update the Create button manually whenever we detected that our form changed:

{% highlight objc %}

self.createButton.enabled = [self isFormValid];

{% endhighlight %}

But what we really want to do is declare the relationship between the form's validity and the Create button's enabledness across the entire lifetime of the view.

We want to derive our output from our input. ReactiveCocoa lets us do that:

{% highlight objc %}

RACSignal *formValid = [RACSignal
  combineLatest:@[
    self.firstNameField.rac_textSignal,
    self.lastNameField.rac_textSignal,
    self.emailField.rac_textSignal,
    self.reEmailField.rac_textSignal
  ]
  reduce:^(NSString *firstName, NSString *lastName, NSString *email, NSString *reEmail) {
    return @(firstName.length > 0 && lastName.length > 0 && email.length > 0 && reEmail.length > 0 && [email isEqual:reEmail]);
  }];

RAC(self.createButton.enabled) = formValid;

{% endhighlight %}

Now whenever the first name, last name, email, or re-enter email fields change, we'll reduce them down to a boolean indicating whether the form is valid and update the Create button's enabledness.

Note that last line of the example. Instead of an assignment that sets the value at one time, it's actually establishing a _relationship_. Instead of assigning it once, we're assigning it over time. The Create button's enableness is derived from the form's validity. The output is a function of the input.

When the Create is executing, we want to disable the text fields and change their text color to a light gray:

{% highlight objc %}

RACSignal *fieldTextColor = [executing map:^(NSNumber *x) {
  return x.boolValue ? UIColor.lightGrayColor : UIColor.blackColor;
}];

RAC(self.firstNameField.textColor) = fieldTextColor;
RAC(self.lastNameField.textColor) = fieldTextColor;
RAC(self.emailField.textColor) = fieldTextColor;
RAC(self.reEmailField.textColor) = fieldTextColor;

RACSignal *notProcessing = [executing map:^(NSNumber *x) {
  return @(!x.boolValue);
}];
RAC(self.firstNameField.enabled) = notProcessing;
RAC(self.lastNameField.enabled) = notProcessing;
RAC(self.emailField.enabled) = notProcessing;
RAC(self.reEmailField.enabled) = notProcessing;

{% endhighlight %}

We can wire the rest of our outputs up similarly. They're all just combinations or transformations of our inputs.

### Fin

That's a small, practical example of the principles of FRP in an imperative language. The whole example view is on GitHub: [RACSignupDemo](https://github.com/joshaber/RACSignupDemo).

Functional reactive programming offers a way to once again view our programs as simply input and output. We get to minimize state while also embracing a unified view of what our app is doing. It's all just inputs and outputs.

[^1]: This is kinda interesting itself because it means that the "meaningful" part of the app is the bit that combines all the inputs into the output.
[^2]: It might be easier to break it down on a per-view basis than thinking of the entire app at each point in time.
[^3]: See ["Out of the Tar Pit"](http://shaffner.us/cs/papers/tarpit.pdf)
[^4]: Most state is introduced simply used because it's an easy solution to a problem or because it's how we're trained to solve problems—not because it's intrinsic to the problem at hand.
[^5]: Don't hate.
[^6]: Which sounds a lot like futures. Time-varying values are a higher-level concept that encompasses futures.
[^7]: [Until you reach the turtles](http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html).


text:
# PyPDB

A Python 3 toolkit for performing searches with the RCSB Protein Data Bank (PDB). This can be used to perform advanced searches for PDB IDs matching various criteria, as well as to look up information associated with specific PDB IDs. This tool allows standard operations that can be perfomed from within the PDB website (BLAST, PFAM lookup, etc.) to be performed from within Python scripts.

If you use this module for any published work, please consider citing the accompanying paper

      Gilpin, W. "PyPDB: A Python API for the Protein Data Bank."
      Bioinformatics, Oxford Journals, 2016.

## Installation

Install using pip:

    $ pip install pypdb

To install the development version, which contains the latest features and fixes, install directly from GitHub using

    $ pip install git+https://github.com/williamgilpin/pypdb

If you need to  install directly from setup.py,

    $ python setup.py install

Test the installation, and check that the code successfully connects to the PDB, navigate to the root directory and run

    $ pytest

This code has been designed and tested for Python 3.

## Usage

### PDB Text Search
This package can be used to get lists of PDB IDs associated with specific search terms, experiment types, structures, and other common criteria. To use the simple API, see the examples in [`demos/demos.ipynb`](demos/demos.ipynb). For advanced search and query logic, see the examples in [`search/EXAMPLES.md`](pypdb/clients/search/EXAMPLES.md).

### PDB Data Fetch
Given a list of PDBs, this package can be used to fetch data associated with those PDBs, including their dates of deposition, lists of authors and associated publications, their sequences or structures, their top BLAST matches, and other query-specific attributes like lists of a ligands or chemical structure.  To use the simple API, see the examples in [`demos/demos.ipynb`](demos/demos.ipynb). For advanced search and query logic, see the examples in [`data/EXAMPLES.md`](pypdb/clients/data/EXAMPLES.md).

## Issues and Feature Requests

If you run into an issue, or if you find a workaround for an existing issue, we would very much appreciate it if you could post your question or code as a GitHub issue.

If posting a feature request, please check that your request is possible using [the current GUI on current RCSB website](https://www.rcsb.org/search/advanced). If so, please perform your search, and then click the link that says `JSON` in the upper right hand corner of the Advanced Search box. Please post that JSON code with your feature request.

repository: williamgilpin/pypdb

gha_language: Python

repo_name: williamgilpin/pypdb


text:
---
layout: project
title: Relating the Unread - Network Models in Literary History
excerpt: "Ulrik Brandes & Thomas Weitin"
modified: 2/24/2020, 9:00:24
category: blog
---

***Ulrik Brandes & Thomas Weitin***

In a mixed methods approach to literary history, we intend to use network models of text relations to study how groupings emerge relative to the way text corpora have been compiled.

Computational analysis of big data is as much about analysis as it is about the data itself. Corpora are almost never representative samples but opportunistic if not deliberate collections. Their composition is thus subject to systematic biases and affects the analysis of relations among texts, positions and status of texts relative to others, and the categorization of texts into groups.

We will develop network models that integrate stylometric, semantic, and annotation data specifically for German-speaking and European Anglophone literatures of the 18th and 19th century, concentrating on novels and narratives. Our goal is to shine a different light on the establishment of genre conventions, subgenres and epoch style within this decisive period. From a socio-historical view point we focus on those texts and authors who were marginalized in the course of literary history, paying special attention to female writers and their positions alongside canonized texts.

In addition to developing models and algorithms, we will use corpus manipulation as a heuristic method to study grouping processes and combined synchronic and diachronic corpus comparison. By detecting groups on a certain data level and watch them disappear on another, we will be able to foster our understanding of both historical and systematic text relations, and also of text groups within different periods of time.


text:
# java-email-client
A java based application that uses Java Mail API to send, receive,forward emails.

# Goals
To determine the feasibility and, if feasible, the computational requirements to manage our own mail account. The program will provide a standard graphic user interface to access email account. The interface will be intuitive enough for the users to access the email account directly without the help of browser.

# Purpose
This Application is used for sending and receiving mail to and from the recipient.

# Scope
1. This Application named alpha mail will be used to send and receive messages and attachments offline i.e. without the use of any browser.
2. Unlike the other mail servers this Application can be used for the other users who are not registered in the alpha mail.
3. Even if user lacks internet connection then also sending mails is possible.
4. Mail Server like yahoo, Gmail, Hotmail, outlook can be used for accessing the mail send by the sender.

# Deliverables
An interface capable of:
1. Retrieving Mail
2. Sending Mail.
3. Forwarding Mail.
4. Deleting Mail.

# Knowledge Areas Needed for Project
1. Software Engineering
2. Java Programming Language
3. Knowledge of Java Mail API and basic networking protocols such as POP, SMTP, IMAP.

# Product Functions
The System will allow access only to authorized users with specific role. Depending upon the users role he/she will be able to access only specific module of the system.
1. LOGIN- A Login facility for enabling only authorized access to the system.
2. SENDING MAIL- The user can send their composed mail along with the attachment using this module.
3. RECEIVING MAIL- The receiver client can view the pop-up notification using receiving module.
4. FORWARDING MAIL- The user can forward any mail which he has received.
5. Facility of latest news updates.

# User Characteristics
1. User have elementary computer knowledge and the knowledge of use of Application.
2. The user should know the details of its corresponding email account.

# General Constraints
The sender email-id and password is required. The mail will be sent to particular server chosen in the drop-down menu.

#Assumptions and Dependencies
These are some following assumptions:
1. The system is having required configuration as well as Windows operating system.
2. Full working of alpha mail Application is dependents on the availability of Internet connection.


text:
Another todo list application? Why bother...?
=============================================

All the todo list applications I've seen have the purpose of showing the "easy to use" a framework are. In this case
I simply don't want to proof that a framework is better than other.

Since I teach TDD/BDD, Javascript and OO, I'd like to show to my students best practices to develop rich
internet applications, and the todo list application is simple enough to show key concepts. So I think it's a good
idea publishing a full sample project showing this concepts.

**Of course I'm not perfect, the application can have errors or something could have been done in a better way**. This
 is my second motivation, to learn. I expect to get some feedback to enhance this sample application ! I can lear too
  new ideas and techniches.

Finally I'd like to explore some frameworks and how to use them in an efective way.

Framework agnostic architecture
===============================

A well designed architecture should give you the freedom of switching the framework used without impacting most of
your code. In this project I'd tried to decouple most of the code from any framework.

DOM Access Layer
----------------

The DOM Access Layer decouple the core of the application from the specifics of DOM manipulation. In this case I use
"view models" to implement this layer. There is an implementation of these "view models" using knockout.js,
and other using Zepto/jQuery. Switching from one framework to another is only matter of switching the "view
model" library used. If in the future we wish to change the presentation framework we only need to implement a new
"view model" library.

It's interesting comparing both implementations of the DOM Access Layer. Clearly knockout.js seems more powerful,
the view layer is very simple to code. With Zepto/jQuery the view layer is more complex,
but I don't need to modify the HTML and I can use the same document as provided by the web designer. Another advantage of
 Zepto/jQuery is that the final result has less footprint and less start up time, specially in the case of Zepto.

Data Access Layer
-----------------

The Data Access Layer decouples the models from the specifics storage mechanism used. Currently only support in
memory storage. If in the future I add more storage systems (localStore, AJAX, WebSockets...) only need to implement
 a new storage library. The rest of the code won't need to be changed.

TDD/BDD
=======

The core of the application code is fully unit tested. The tests are integrated in a build script and generate JUnit
XML report files, so I hope it will be easy to integrate with a CI server in the future.

I plan to add a BDD suite in the future.

If you have never seen TDD in practice in a full rich internet application, I hope this project helps you to
illustrate how to apply TDD in a web application based in javascript and HTML5.

Build
=====

To build this project follow these steps:

1. If not on your system, [install Node.js](http://nodejs.org/#download)
2. If you have not yet NPM, don't wait and [install NPM](http://npmjs.org/)
3.  Install the [uglify-js](https://github.com/mishoo/UglifyJS) package issuing the following command: ``npm install -g
uglify-js``
    Perhaps you need to do a sudo: ``sudo npm install -g uglify-js``
3. Download this project to your computer
4. Go to the root folder of the project with the command line
5. Execute the following command ``node build``.

The build system is a simple node package "ad hoc" for this project. It will run the unit test suite,
if there is no errors will compact and minimify all the application libraries.

If you like to skip the tests, you can run ``node build --skipTests``

Execute
=======

Simply open in your browser either ``todo_with_knockout.html`` or ``todo_with_zepto_jquery.html``

Proyect layout
==============

The project is structured in the following directories:

* ```build/``` The build scripts
* ```css/``` Simple CSS for the applications
* ```img/``` Some images (the ajax loader)
* ```js/``` The runtime code of the application
    * ```libs/``` Third party libs used in runtime (zepto, jQuery, knockout)
        * ```todo_with_ko.min.js``` Compacted minimified code resulting of the build process (You must build first)
        * ```todo_with_zepto_jquery.min.js``` Compacted minimified code resulting of the build process (You must build first)
* ```src/``` The source code for the application
    * ```main/``` The source code for the runtime
        * ```common/``` The source code of the core of the application, decoupled from the DOM/Presentation framework
used. The unit tests cover this files, except store.js.
            * ```utils.js``` Event & observable fields (whenever I do not have knockout)
            * ```model.js``` A Task & Tasks (task list) model. Decoupled of the specific persistence/storage mechanism
            * ```controller.js``` The high level application controller
            * ```widgets.js``` Reusable controllers/widgets. Decoupled from the specific presentation framework
            * ```store.js``` A simple in memory storage.
        * ```knockout/``` The view models implemented with [Knockout.js](http://knockoutjs.com/)
        * ```zepto_jquery/``` The view models implemented with [Zepto](http://zeptojs.com/)/[jQuery](http://docs.jquery
.com/Downloading_jQuery)
    * ```tests/``` The source code for the tests
        * ```libs/``` Third party libs used for testing (jasmine & Larry Myers' jasmine reporters)
        * ```utils/``` Custom utils for testing
            * ```custom-matchers.js``` Some custom matchers for jasmine
            * ```test-doubles.js``` A test double (mocks/spies/stubs) library for the application
        * ```unit/``` Unit tests
            * ```suite.html``` A page to run unit tests (if you do not want to run them from the command line)
            * ```*-tests.js``` A test suite

Not yet done (in the roadmap)
=============================

There are a lot of things left to do !

* Use application cache manifest
* Edit the description of the task (click to edit)
* Task filters (view only done/todo)
* Task filters (matching description)
* A better web design (somebody help me with those damned CSS!)
* Responsive design
* Integration Tests & BDD. Currently there are only unit tests.
* An storage based in localStore
* An storage based in a remote REST service using AJAX
* An storage based in a remote service using WebSockets
* An robust storage able to switch to local storage when there is no connectivity and resync with the server when it
is online again
* Explore other presentation frameworks (ember.js, jquerymobile...?)
* Integrate build in a CI server (jenkins...?)

Feel free to experiment
=======================

If you are learning JavaScript and about building a rich web application, this is your project. Feel free to read the
code, modify it and experiment! This is the main purpose of this project !

repository: japaz/explore-the-todo-list-app

repo_name: japaz/explore-the-todo-list-app


text:
# Configuring StorageClass
This example shows how to configure Kubernetes storageclass to provision EBS volumes with various configuration parameters. EBS CSI driver is compatiable with in-tree EBS plugin on StorageClass parameters. For the full list of in-tree EBS plugin parameters, please refer to Kubernetes documentation of [StorageClass Parameter](https://kubernetes.io/docs/concepts/storage/storage-classes/#aws-ebs).

## Usage
1. Edit the StorageClass spec in [example manifest](./specs/example.yaml) and update storageclass parameters to desired value. In this example, a `io1` EBS volume will be created and formatted to `xfs` filesystem with encryption enabled using the default KMS key.

2. Deploy the example:
```sh
kubectl apply -f specs/
```

3. Verify the volume is created:
```sh
kubectl describe pv
```

4. Validate the pod successfully wrote data to the volume:
```sh
kubectl exec -it app cat /data/out.txt
```

5. Cleanup resources:
```sh
kubectl delete -f specs/
```

repository: aws-samples/eks-workshop-greater-china

gha_language: Makefile

repo_name: aws-samples/eks-workshop-greater-china


text:
# s2gen - static site generator

This is a simple static site generator written in Scala for my web-site [appliedscala.com](http://appliedscala.com/). It assumes that you write the content in Markdown and use Freemarker as a template engine. The generator supports watching for file changes and is completely unopinionated about organizing front-end assets.

## Getting started

Download the latest release from [the release page](https://github.com/denisftw/s2gen/releases/latest)

Extract the downloaded package to any directory and add `s2gen`
executable to the `PATH`. To achieve that, you can edit your `.bashrc`:

```bash
S2GEN=/home/user/DevTools/s2gen
PATH=$S2GEN/bin:$PATH
```

Initialize a skeleton project in an empty directory by typing the following:

```
$ s2gen -init
```

The following directory structure will be generated:

```
$ tree -L 4
.
├── content
│   └── blog
│       └── 2016
│           └── hello-world.md
├── s2gen.conf
├── site
│   └── css
│       └── styles.css
└── templates
    ├── about.ftl
    ├── archive.ftl
    ├── blog.ftl
    ├── footer.ftl
    ├── header.ftl
    ├── index.ftl
    ├── info.ftl
    ├── main.ftl
    ├── menu.ftl
    ├── page.ftl
    ├── post.ftl
    └── sitemap.ftl

6 directories, 13 files

```

The example configuration can be found in `s2gen.conf` (HOCON format).
The default settings are mostly fine, but feel free to change the `site.host`.
In order to generate the site, simply type:

```
$ s2gen
[11:05:53.508] [INFO ] SiteGenerator - Cleaning previous version of the site
[11:05:53.515] [INFO ] SiteGenerator - Generation started
[11:05:53.599] [INFO ] SiteGenerator - Generating the archive page
[11:05:53.662] [INFO ] SiteGenerator - The archive page was generated
[11:05:53.663] [INFO ] SiteGenerator - Generating the sitemap
[11:05:53.664] [INFO ] SiteGenerator - The sitemap was generated
[11:05:53.664] [INFO ] SiteGenerator - Generating the index page
[11:05:53.665] [INFO ] SiteGenerator - The index page was generated
[11:05:53.665] [INFO ] SiteGenerator - Generating custom pages
[11:05:53.667] [INFO ] SiteGenerator - All custom pages were generated
[11:05:53.706] [INFO ] SiteGenerator - Successfully generated: 2016/hello-world.md
[11:05:53.706] [INFO ] SiteGenerator - Generation finished
[11:05:53.706] [INFO ] SiteGenerator - Registering a file watcher
[11:05:53.745] [INFO ] SiteGenerator - Waiting for changes...
```

After generating, **s2gen** switches to the monitor mode and starts waiting for file changes.
Generated HTML files will be placed to the site directory.
Frontend assets (styles, scripts, images, fonts) could also be added
to this directory manually and **s2gen** will not touch them.

### Custom templates

The bootstrap example generates the About page as a custom template. In order to add a custom template,
you must place the Freemarker file in the `templates` directory and add it to the `templates.custom` list in `s2gen.conf`:

```
templates {
  custom = ["about.ftl"]
}
```

For `about.ftl`, the output HTML file will be placed into `./site/about/index.html`, so it can be referenced as follows:

```html
<a href="/about">About</a>
```

Custom templates also have access to common site properties like `title` and `description`.

## Testing the site

In order to test the site in the browser, you can use a NodeJS based HTTP server:

```
$ npm install http-server -g
$ http-server -p 8080 site
Starting up http-server, serving site
Available on:
  http:<IP_ADDRESS>:8080
  http:<IP_ADDRESS>:8080
Hit CTRL-C to stop the server
```

## Copyright and License

Licensed under the MIT License, see the LICENSE file.


text:
# @ices/ts-plugin-locale

## TypeScript's language service plugin that adds IntelliSense for locale components

## Usage

```json5
// tsconfig.json
{
  compilerOptions: {
    plugins: [{ name: '@ices/ts-plugin-locale' }],
  },
}
```

### Preview

![preview](https://raw.githubusercontent.com/icesjs/ts-plugin-locale/master/preview.gif)

## peerDependencies

```text
@ices/react-locale
```

## Related

[@ices/react-locale](https://www.npmjs.com/package/@ices/react-locale)

[@ices/locale-webpack-plugin](https://www.npmjs.com/package/@ices/locale-webpack-plugin)

repository: icesjs/ts-plugin-locale

repo_name: icesjs/ts-plugin-locale


text:
### API BASE URL

##### Local: http://localhost:3000

### Requirements

- `Nodejs v10-13` - a JavaScript run-time environment that executes JavaScript code outside of a browser
- `POSTGRES` - a database management system for data persistence
- `.env.example` - contains all the variable environment for this project

### SETUP

First clone it to your machine:

```
https://github.com/Muhire-Josue/Proverbs-api.git
```

```
Create a file called .env, copy all environment variables from .ENV.EXAMPLE and fill in their respective values (this will allow you to connect to the database among other things)
```

Open it using your favorite IDE,
I used ([vs code](https://code.visualstudio.com/download))

Install all necessary node modules

```
npm install
```

Create a database

```
npm run create-db
```

Run the migrations (to map the models to the database relations)

```
npm run migrations
```

To start the app

```
npm run dev
```

To run tests

```
npm test
```

### API ENDPOINTS

| API                                  | Methods | Description                |
| ------------------------------------ | ------- | -------------------------- |
| `/`                                  | GET     | Welcome message            |
| `/user`                              | POST    | Choose a name              |
| `/proverb/add`                       | POST    | Post a proverb             |
| `/proverb/edit/:proverbId`           | PUT     | Edit a proverb             |
| `/proverbs`                          | GET     | Get all proverbs           |
| `/proverbs/mine`                     | GET     | Get all your proverbs      |
| `/proverbs/:postedBy`                | GET     | Get all proverbs of a user |
| `/proverb/:proverId`                 | GET     | Get a proverb by id        |
| `/proverb/:proverId`                 | DELETE  | Delete a proverb           |
| `/proverb/like`                      | POST    | like and unlike a proverb  |
| `/proverb/:proverbId/comment`        | GET     | Comment a proverb          |
| `/proverb/comment/:commentId/edit`   | PUT     | Edit a comment             |
| `/proverb/comment/delete/:commentId` | DELETE  | Delete a comment           |

### How can it be manually tested

- using [postman](https://www.getpostman.com/downloads/)

### Technologies used

- `YARN` - a package manager for the JavaScript programming language
- `Git` - version-control system for tracking changes in source code during software development

repository: Muhire-Josue/Proverbs-api

repo_name: Muhire-Josue/Proverbs-api


text:
# Getting started with markdown-reader

This module creates a Node stream that outputs an object for every markdown file and directory it finds in an array of directories.

It does this recursively, so it gets the files and directories in every subdirectory, too.

## Install

To install the module, make sure you have [Node](https://nodejs.org) installed, and that [npm](https://npmjs.org) is available on your machine (it's a package manage that is installed when you install Node).

Run the `npm install` command:

```sh
npm install --save markdown-reader
```

## Usage

Basic usage looks like this:

```js
var path = require('path')
var reader = require('markdown-reader')

var dir = path.join(__dirname, 'files')
reader(dir).on('data', console.log)
```

Here's an example that uses the `data` event from the stream to work with the markdown files:

```js
var path = require('path')
var keypath = require('obj-keypath')
var reader = require('../index')

var dir = path.join(__dirname, 'files')
var contents = {}

var stream = reader(dir)

stream.on('data', function (data) {
  if (data.type === 'directory') {
    keypath.set(contents, data.relname.split('/'), {})
  } else if (data.type === 'file') {
    keypath.set(contents, data.relname.split('/'), data)
  }
})

stream.on('end', function () {
  console.log(contents)
})
```

license: ISC

repository: sethvincent/markdown-reader

repo_name: sethvincent/markdown-reader


text:
# React Mermaid 2

> A React 16.8+ (using Hooks) component to display [mermaid](https://github.com/knsv/mermaid) diagrams, flowcharts, gantt charts, etc.

![https://mermaid-js.github.io/mermaid/img/new-diagrams.png](https://mermaid-js.github.io/mermaid/img/new-diagrams.png)

Source : [https://mermaid-js.github.io/mermaid/#/](https://mermaid-js.github.io/mermaid/#/)

## Getting Started

- Install with [NPM](https://www.npmjs.org/)

```bash
npm install --save react-mermaid2
```

or

```bash
yarn add react-mermaid2
```

## Usage

```javascript
import React from "react"
import Mermaid from "react-mermaid2"

export default Component = () => {
  return (
    <Mermaid chart={`
        graph TD;
        A-->B;
        A-->C;
        B-->D;
        C-->D;
        `}/>
  )
}
```

## Options

| Property | Type     | Argument     | Default   | Description                                           |
| -------- | -------- | ------------ | --------- | ----------------------------------------------------- |
| chart     | `string` | `<optional>` | `mermaid` | The mermaid code of your chart. Check Mermaid js documentation for details. |
| name     | `string` | `<optional>` | `` | On optional name of your mermaid diagram/flowchart/gantt etc. |
| config     | `object` | `<optional>` | `` | On optional object with one of several Mermaid config parameters. Check Mermaid js documentation for details.

## Developing

[react-mermaid2](https://github.com/e-attestations/react-mermaid2) is built using **ES6**+ with [React](https://reactjs.org/) v16.8 (with Hooks) using [babel](https://babeljs.io/) 7+.

### Install dependencies

After cloning the repo, go to the local copy, then install dependencies.

```bash
npm install
```

or

```bash
yarn
```

### Build

Run the following task to compile from `src/` to `dist/Mermaid.js`.

```bash
npm run package
```

or

```bash
yarn package
```

## Demo application

This repository proposes a React demonstration appication with component demonstration using a chart collection from a separate `collection.js' file.

You can fork/download the repo and launch the demo app to see the component in action.

```bash
npm start
```

or

```bash
yarn start
```

## Contributing

If you want to contribute to this project please take care to maintain the existing coding style.

Feel free to add unit tests for any new or changed functionality.

## License

Copyright (c) 2020 [e-Attestations](https://e-attestations.io)
Licensed under the MIT license.


text:
# SpareReactors

* These essentially represent `scaling` units in your *micro-app-mesh*.
* You can spawn these and connect these to a [ClusterHost](clusterhost.md)
* The ClusterHost will *update* the *SpareReactor* to the **choosen** `scale-out App` automatically whenever it connects

  ```c#

  new ClusteredAppHost().ConfigureWith(
        new AutoScaleoutReactorPlan( //the auto scaling host
            new ScaleoutToEverySpareReactor(),  //logic to control how the scale-out will occour
            "AnyApp", //the app to scale
            "reactorName | null",  //the reactorname of the app to sale, or null, to scale the whole app
            "version | null") //the version of the App to scale as uploaded to the AppUpdateManager
            )
        )
  ```

  `picture of sparereactor on appstatus portal`

# Patterns & Practices

* This pattern is mostly useful for cases where Cloud scaleout is not appropriote or inefficent. This may be because you need more control over your scaling practices or because you may want to experiment with multi-plexiing different workloads on different `bare metal` or `vm hosts` to *get more bang for your cloud buck*.

* Deploy `SpareReactors` directly from [Docker Hub](https://hub.docker.com) or one customised to your needs

repository: captainjono/rxns

branch_name: refs/heads/vnext

gha_language: C#

repo_name: captainjono/rxns


text:
# Plyr Ads
Preroll plugin for the awesome [Plyr](https://plyr.io) media player.

[Checkout the demo](https://ferdiemmen.github.io/plyr-ads/)

## Installation
    $ npm install plyr-ads --save

## Run demo
    $ gulp demo

## Features
- **Google IMA** - works with the Google IMA SDK
- **Responsive** - works with any screen size
- **SASS** - to include in your build processes

## Features currently being developed
- Youtube video as preroll

## Planned features (in any order)
- VAST support
- Midroll and postroll
- Api
- Events to hook into like: 'started', 'midpoint', 'ended', etc...
...and whatever else has been raised in [issues](https://github.com/ferdiemmen/plyr-ads/issues)

If you have any cool ideas or features, please let me know by [creating an issue](https://github.com/ferdiemmen/plyr-ads/issues/new) or, of course, forking and sending a pull request.

## Initialising

PlyrAds extends on one or many Plyr instance. **Make sure to include the Google IMA SDK and ofcourse Plyr.**

**Html**
```html
<script type="text/javascript" src="https://imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
```

**Javascript**
```javascript
var player = plyr.setup();
plyrAds.setup(player, options);
```

## Options
Options must be passed as an object to the `setup()` method as above or as JSON in `data-plyr` attribute on each of your target elements:

```javascript
var player = plyr.setup();
plyrAds.setup(player, {
  adTagUrl: 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator='
});
```

      Option
      Type
      Default
      Description

      adTagUrl
      String
      ''
      **required** A Google IMA compliant ad tag url.

      skipButton
      Object
      {enabled: true, text: 'Skip ad', delay: 10}
      To let the visitor skip the ad at a certain point. See below

## Skip button options

      Option
      Type
      Default
      Description

      enabled
      Boolean
      true
      Toggles if the skip button should be enabled.

      text
      String
      'Skip ad'
      The text shown on the skip button.

      delay
      Integer (seconds)
      10
      Countdown timer for when the visitor is able to skip the ad.

## Thanks
Thanks to Sam Potts and all his contributors who build the awesome [Plyr](https://plyr.io/) video player.

## Copyright and License
[The MIT license](license.md).

repository: subhransusekhar/plyr-ads

repo_name: subhransusekhar/plyr-ads


text:
# parseltongue
The tool about parse data.

## License
Apache License 2.0

## Development setup

First time running the project? Make sure you have Python .

1.  Clone this project with:
`git clone https://github.com/JJSPython/parseltongue.git`
2.  `cd` into the cloned repo
3.  Run `pip install -r requirements.txt` to install project dependencies.
4.  Run `python manage.py runserver` to start the dev server.
5.  Run Browser URL to http://localhost:8000/crawler

## Python Setup

* Install [python](https://www.python.org/)
* Install [Git](https://git-scm.com/downloads)

## Example
* Install [Heroku](https://vast-refuge-25114.herokuapp.com/crawler)

repository: mathsigit/parseltongue

repo_name: mathsigit/parseltongue


text:
# mass_reports_for_splunk
An (ugly) script to generate a large number of sheduled PDF views in Splunk based on a template

## Introduction

**Need**: provide a dashboard to a large group of sysadmin, showing their systems only.

Difficulties:
-	Cannot provide 100's of accounts on the Splunk SH (operation processes not designed to do it)
-	Permissions are tricky: limitation role->index, but what about more precise search terms? (without the possibility to bypass) -> probably doable, but needs a SH lock-down and proper role modelling
-	PDF generation as alternative
 - No templates system
 - Various workaround needed (see later)
 - Limited in formating
 - No monitoring of reporting errors (or difficult…)

PDF Generator:
-	Limited formating control
-	page layout, font size, graph size, graph format (size of label area vs graph area, …)
-	No bookmark/hyperlink within report

**Solution:**
- Template system:	Developed own script

Workarounds:
-	Scheduled PDF works only if using saved searches, not inline… http://answers.splunk.com/answers/74295/empty-scheduled-pdf-reports.html#answer-98352
-	Scheduledview report format is not used, it takes only the global configuration?!
-	Refreshing (via rest endpoint) the scheduledview does not refresh/reinitialise the schedule. I have to set explicitely again via REST the schedule.
-	Larger charts (takes more width on the page, A3 landscape). Size is hard coded (600px)
-	Top alignement in table cells (default is bottom).
-	Line feed in Multivalue cell (nicer format in the PDF):
  `eval Description=mvappend(Description," ",mvappend("","Advisories: ",Adv))`
- Single Value "missuse" to show conditionally a header with multiple values (text): use delim to insert `"<br/>"` that will be honored (fortunately!) by the PDF generator (but not by the view…)
External reporting engine?
-	Any recommendation for external reporting engine? Jasper reports?

See https://github.com/grundsch/mass_reports_for_splunk/wiki for a detailed description of the script.


text:
# DCL-118: Advanced C++

These projects are created as part of the following training: DCL-118 "Advanced C++"

Please follow the link for the complete training catalog: https://www.deepcloudlabs.com/resources


text:
### Text-Analyzer

##### By Isaac Moreno & Noah Woodrum👨💻

[View Here](https://github.com/isaacrmoreno/text-analyzer )

### Description:

Created and tested test analyzer for lesson project.

### Set Up Instructions:

1. Clone this [repository](https://github.com/isaacrmoreno/text-analyzer.git) to your desktop.
2. Navigate to the top level of the directory.
3. Open Index.html in your browser.

### Bugs:

N/A

### Specs

Describe: wordCounter()

1. Test: "It should return 1 if a passage has just one word."
Code:
const text = "hello";
wordCounter(text);
Expected Output: 1

 2. Test: "It should return 2 if a passage has two words."
Code:
const text = "hello there";
wordCounter(text);
Expected Output: 2

 3. Test: "It should return 0 for an empty string."
Code: wordCounter("");
Expected Output: 0

 4. Test: "It should return 0 for a string that is only spaces."
Code: wordCounter("             ")
Expected Output: 0

5. Test: "It should not count numbers as words."
Code: wordCounter("hi there 77 19");
Expected Output: 2

Describe: numberOfOccurrencesInText()

6. Test: "It should return 0 occurrences of a word for an empty string."
Code:
const text = "";
const word = "red";
NumberOfOccurrencesInText(word, text);
Expected output: 0

7. Test: "It should return 1 occurrence of a word when the word and the text are the same."
Code:
const text = "red";
const word = "red";
NumberOfOccurrencesInText(word,text);
Expected Output: 1

8. Test: "It should return 0 occurrences of a word when the word and the text are different."
Code:
const text = "red";
const word = "blue";
NumberOfOccurrencesInText(word, text);
Expected Output: 0

9. Test: "It should return the number of occurrences of a word."
Code:
const text = "red blue red red red green";
const word ="red";
NumberOfOccurrencesInText(word, text);
Expected Output: 4

Describe: numberOfOccurrencesInText()

10. Test: "It should return 0 occurrences of a word for an empty string."
Code:
const text = "";
const word = "red";
NumberOfOccurrencesInText(word, text);
Expected Output: 0

11. Test: "It should return a word match regardless of case."
Code:
const text = "red RED Red green Green GREEN";
const word = "Red"
NumberOfOccurrencesInText(word, text);
Expected Output: 3

12. Test: "It should return a word match regardless of punctuation."
Code:
const text = "Red! Red. I like red, don't you?";
const word = "red";
wordCounter(word, text);
Expected Output: 3

### Technologies Used:

1. VSCode
2. GitHub
3. Jquery

### Contact:

✉<EMAIL_ADDRESS>- Isaac Moreno
✉<EMAIL_ADDRESS>- Noah Woodrum

### Licenses:

MIT © 2021 Isaac Moreno & Noah Woodrum

repository: NoahWoodrum/text-analyzer

repo_name: NoahWoodrum/text-analyzer