text:
# Virt-A-Mate MyPlugin

What you will need:

- [VS Code](https://code.visualstudio.com/) to edit your plugins
- [Virt-A-Mate](https://www.patreon.com/meshedvr/) to use your plugins

How to use this template:

1. Decide on a plugin name. Here we will call it `MySuperPlugin`.
2. Clone this repo: `git clone --depth=1 https://github.com/acidbubbles/vam-plugin-template.git MySuperPlugin` inside `(VaM install folder)\Saves\Scripts\Anonymous` where `Anonymous` would be your pseudonym. That will clone into `(VaM install folder)\Saves\Scripts\Anonymous\MySuperPlugin`.
3. Delete the `.git` folder.
4. Initialize a new repo of your own: `git init`.
5. Rename `MyPlugin.csproj` to `MySuperPlugin.csproj` and `src/MyPlugin.cs` to `src/MySuperPlugin.cs`.
6. Open `MySuperPlugin.csproj` and rename the `src/MyPlugin.cs` to `src/MySuperPlugin.cs`.
7. Open `src/MySuperPlugin.cs` and start coding! Look at the `TODO` lines and enter a meaningful description.
8. Save a few test scenes under `scenes` to make it easier to quickly test your plugin.
9. When you're done, use `./Publish.ps1 1.0.0` and a version of the code without `#if(VAM_DIAGNOSTIC)` sections will be generated.
10. Create your project on GitHub using the nomenclature `vam-mysuperplugin`, and push it there. It's not [that complicated](https://guides.github.com/activities/hello-world/)!
11. Remove those instructions from this `README.md` file and explain what it does, and how to use it.
12. Let the [world know](https://www.reddit.com/)!

## License

[MIT](LICENSE.md)

repository: danielwsink/vam-plugin-template

repo_name: danielwsink/vam-plugin-template


text:
If you ever find yourself
gazing at falling snow,
why not catch a few snowflakes
on your glove and examine their shapes?
You might notice
that they look symmetrical,
and if you look closely,
you'll see they have six sides.
You could say a snowflake
is simply frozen water,
but compare one
with an ice cube from the freezer,
and you'll realize
they're very different things.
Unlike ice cubes, formed when liquid
freezes into a solid,
snowflakes form when water vapor
turns straight into ice.
But that still doesn't explain why
snowflakes have six sides.
To understand that,
we need to delve deeper
into the physics of water.
Water is made out of two hydrogen atoms
and one oxygen atom.
A single water molecule
thus has ten protons and ten electrons,
eight from oxygen
and one from each hydrogen atom.
The two electrons
from oxygen's outer shell
are shared with two electrons
from both hydrogens as they bond together,
and the remaining
four outer shell electrons from oxygen
form two pairs.
We call the bonds between these atoms
covalent bonds.
The pairs of electrons
are all negatively charged.
Similar charges repel,
so they tend to stay as far away
from each other as possible.
The pairs form four electron clouds,
two of which are where the hydrogen
and oxygen share electrons.
The repulsion between the unbonded pairs
is even stronger than repulsion
between the shared pairs,
so the two hydrogens
get pushed a little further
to an angle of 104.5 degrees.
The water molecule as a whole
is electrically neutral,
but oxygen gets
a larger share of electrons,
making it slightly negative
and the hydrogens slightly positive.
Due to its negative charge,
the oxygen in one molecule
is attracted to the positive charge
of the hydrogen in another molecule.
And so a weak bond
between the two molecules,
called a hydrogen bond,
is formed.
When water freezes, this bonding
occurs on repeat,
ultimately forming a hexagonal structure
due to the angle between hydrogens
and oxygen within each molecule.
This is the seed of a snowflake,
and it retains a hexagonal shape
as it grows.
As the snowflake moves through the air,
water vapor molecules
stick to the six sharp edges
and expand the snowflake outwards,
bit by bit.
A snowflake's developing shape depends
on atmospheric conditions,
like humidity and temperature.
As a snowflake falls,
changes in weather conditions
can affect how it grows,
and even small differences in the paths
two snowflakes take
will differentiate their shapes.
However, since conditions at the six
sharp edges of one snowflake are similar,
a symmetric snowflake can grow.
Weather conditions
affect snow on the ground, as well.
Warmer ground temperatures produce
a wetter snow that is easier to pack
because liquid water molecules
help snowflakes stick to each other.
Melted snow also plays a critical role
in another wintry activity, skiing.
Completely dry snow
is very difficult to ski on
because there's too much friction between
the jagged snowflakes and the ski surface.
So what's happening is that as skis move,
they rub the surface of the snow
and warm it up,
creating a thin layer of water,
which helps them slide along.
So technically,
it's not really snow skiing,
but water skiing.
But it is true that
no matter how hard you look,
you're almost definitely not going to find
two identical snowflakes,
and that's a mystery that scientists
are still trying to solve,
though we know that it has to do
with the many possible
branching points in snowflake formation,
and the differences
in temperature and humidity,
and while we wait for the answer,
we can enjoy watching these tiny fractals
falling from the sky.

license: MIT

repository: prewittdavon/TEDVis

branch_name: refs/heads/master

extension: md

gha_language: Python

gha_license_id: MIT

license_type: permissive

repo_name: prewittdavon/TEDVis


text:
# Changelog

All notable changes to **Make/Accessible** will be documented in this file.

## 2.2.2 - 07/10/2017

Internal improvements.

## 2.2.1 - 02/10/2017

Internal improvements.

## 2.2.0 - 01/10/2017

Added new functionality:

Now you can also make a singleton instances accessible by using:

```php
$instance = Make::accessibleInstance(Singleton::class);
```

Some internal improvements.

## 2.1 - 30/09/2017

Added new functionality:

Now you can also test singleton instances easily by using:

```php
$instance = Make::instance(Singleton::class);
```

## 2.0 - 30/09/2017

Renamed package from `e200/makeaccessible` to `make/accessible`.

Changed the way we check if a member is public or not.

## 1.0 - 29/09/2017

Changed method `MakeAccessible::make()` to `Make::accessible()`.

## 0.1 - 29/09/2017

First release.

gha_language: PHP


text:
+++
# Experience widget.
widget = "experience"  # Do not modify this line!
headless = true  # This file represents a page section.
active = true # Activate this widget? true/false
weight = 10  # Order that this section will appear.

title = "Education"
subtitle = ""

# Date format for experience
#   Refer to https://sourcethemes.com/academic/docs/customization/#date-format
date_format = "January 2006"

# Experiences.
#   Add/remove as many `[[experience]]` blocks below as you like.
#   Required fields are `title`, `company`, and `date_start`.
#   Leave `date_end` empty if it's your current employer.
#   Begin/end multi-line descriptions with 3 quotes `"""`.

[[experience]]
  title = "PhD Student in English Literature"
  company = "Washington University in St. Louis"
  company_url = "https://english.wustl.edu/"
  location = "St. Louis, Missouri"
  date_start = "2019-08-15"
  date_end = ""
  description = "Drama, narrative theory, computational approaches to style, genre, and plot"

[[experience]]
  title = "BA in English and Computer Science"
  company = "Rice University"
  company_url = "https://rice.edu/"
  location = "Houston, Texas"
  date_start = "2013-08-15"
  date_end = "2017-05-15"
  description = "Drama; theater in performance; software engineering"
+++

repository: ArtInVenice/personal-website

repo_name: ArtInVenice/personal-website


text:
# Remap the Home and End Keys

### For Non-Terminal Apps

Create the directory/file if not already there:
`~/Library/KeyBindings/DefaultKeyBinding.dict`

```
{
/* Remap Home / End to be correct :-) */
"\UF729"  = "moveToBeginningOfLine:";                   /* Home         */
"\UF72B"  = "moveToEndOfLine:";                         /* End          */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:";       /* Shift + End  */
}
```

### For Terminal

Set the following in the keyboard preferences for the Terminal:

```
    home :: \033OH
    end :: \033OF
    F1 :: \033[11~
    F2 :: \033[12~
    F3 :: \033[13~
    F4 :: \033[14~
```

### Sources
* https://lifehacker.com/225873/mac-switchers-tip--remap-the-home-and-end-keys
* https://jeffmikels.org/posts/how-to-fix-home-and-end-keys-in-the-mac-terminal/

repository: raydouglass/til

repo_name: raydouglass/til


text:
# Spatial_PCA

This data and set of Matlab scripts implements methodology presented in:

M. Markhvida, L. Ceferino, and J. Baker. “Modeling spatially correlated spectral accelerations at multiple periods using principal component analysis and geostatistics”. In: Earthquake Engineering & Structural Dynamics In Review (2017).

The script MAIN_sample.m calls the other scripts in the folder, provides some comments, and can be helpful for understanding and using the code in this repository.

This code has been provided to help implement methodology and calculations provided in the above-mentioned paper, and facilitate additional related calculations. It is not fully documented, however, this software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


text:
# Embed

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Total Downloads][ico-downloads]][link-packagist]
[![Monthly Downloads][ico-m-downloads]][link-packagist]
[![Software License][ico-license]](LICENSE)

PHP library to get information from any web page (using oembed, opengraph, twitter-cards, scrapping the html, etc). It's compatible with any web service (youtube, vimeo, flickr, instagram, etc) and has adapters to some sites like (archive.org, github, facebook, etc).

Requirements:

* PHP 7.4+
* Curl library installed
* PSR-17 implementation. By default these libraries are detected automatically:
  * [laminas/laminas-diactoros](https://github.com/laminas/laminas-diactoros)
  * [guzzle/psr7](https://github.com/guzzle/psr7)
  * [nyholm/psr7](https://github.com/Nyholm/psr7)
  * [sunrise/http-message](https://github.com/sunrise-php/http-message)

> If you need PHP 5.5-7.3 support, [use the 3.x version](https://github.com/oscarotero/Embed/tree/v3.x)

## Online demo

http://oscarotero.com/embed/demo

## Video Tutorial
 [<img src="https://img.youtube.com/vi/4YCLRpKY1cs/0.jpg" width="250">](https://youtu.be/4YCLRpKY1cs)

## Installation

This package is installable and autoloadable via Composer as [embed/embed](https://packagist.org/packages/embed/embed).

```
$ composer require embed/embed
```

## Usage

```php
use Embed\Embed;

$embed = new Embed();

//Load any url:
$info = $embed->get('https://www.youtube.com/watch?v=PP1xn5wHtxE');

//Get content info

$info->title; //The page title
$info->description; //The page description
$info->url; //The canonical url
$info->keywords; //The page keywords

$info->image; //The thumbnail or main image

$info->code->html; //The code to embed the image, video, etc
$info->code->width; //The exact width of the embed code (if exists)
$info->code->height; //The exact height of the embed code (if exists)
$info->code->ratio; //The aspect ratio (width/height)

$info->authorName; //The resource author
$info->authorUrl; //The author url

$info->cms; //The cms used
$info->language; //The language of the page
$info->languages; //The alternative languages

$info->providerName; //The provider name of the page (Youtube, Twitter, Instagram, etc)
$info->providerUrl; //The provider url
$info->icon; //The big icon of the site
$info->favicon; //The favicon of the site (an .ico file or a png with up to 32x32px)

$info->publishedTime; //The published time of the resource
$info->license; //The license url of the resource
$info->feeds; //The RSS/Atom feeds
```

## Parallel multiple requests

```php
use Embed\Embed;

$embed = new Embed();

//Load multiple urls asynchronously:
$infos = $embed->getMulti(
    'https://www.youtube.com/watch?v=PP1xn5wHtxE',
    'https://twitter.com/carlosmeixidefl/status/1230894146220625933',
    'https://en.wikipedia.org/wiki/Tordoia',
);

foreach ($infos as $info) {
    echo $info->title;
}
```

## Document

The document is the object that store the html code of the page. You can use it to extract extra info from the html code:

```php
//Get the document object
$document = $info->getDocument();

$document->link('image_src'); //Returns the href of a <link>
$document->getDocument(); //Returns the DOMDocument instance
$html = (string) $document; //Returns the html code

$document->select('.//h1'); //Search
```

You can perform xpath queries in order to select specific elements. A search always return an instance of a `Embed\QueryResult`:

```php
//Search the A elements
$result = $document->select('.//a');

//Filter the results
$result->filter(fn ($node) => $node->getAttribute('href'));

$id = $result->str('id'); //Return the id of the first result as string
$text = $result->str(); //Return the content of the first result

$ids = $result->strAll('id'); //Return an array with the ids of all results as string
$texts = $result->strAll(); //Return an array with the content of all results as string

$tabindex = $result->int('tabindex'); //Return the tabindex attribute of the first result as integer
$number = $result->int(); //Return the content of the first result as integer

$href = $result->url('href'); //Return the href attribute of the first result as url (converts relative urls to absolutes)
$url = $result->url(); //Return the content of the first result as url

$node = $result->node(); //Return the first node found (DOMElement)
$nodes = $result->nodes(); //Return all nodes found
```

## Metas

For convenience, the object `Metas` stores the value of all `<meta>` elements located in the html, so you can get the values easier. The key of every meta is get from the `name`, `property` or `itemprop` attributes and the value is get from `content`.

```php
//Get the Metas object
$metas = $info->getMetas();

$metas->all(); //Return all values
$metas->get('og:title'); //Return a key value
$metas->str('og:title'); //Return the value as string (remove html tags)
$metas->html('og:description'); //Return the value as html
$metas->int('og:video:width'); //Return the value as integer
$metas->url('og:url'); //Return the value as full url (converts relative urls to absolutes)
```

## OEmbed

In addition to the html and metas, this library uses [oEmbed](https://oembed.com/) endpoints to get additional data. You can get this data as following:

```php
//Get the oEmbed object
$oembed = $info->getOEmbed();

$oembed->all(); //Return all raw data
$oembed->get('title'); //Return a key value
$oembed->str('title'); //Return the value as string (remove html tags)
$oembed->html('html'); //Return the value as html
$oembed->int('width'); //Return the value as integer
$oembed->url('url'); //Return the value as full url (converts relative urls to absolutes)
```

Additional oEmbed parameters (like instagrams `hidecaption`) can also be provided:
```php
$embed = new Embed();

$result = $embed->get('https://www.instagram.com/p/B_C0wheCa4V/');
$result->setSettings([
    'oembed:query_parameters' => ['hidecaption' => true]
]);
$oembed = $info->getOEmbed();
```

## LinkedData

Another API available by default, used to extract info using the [JsonLD](https://www.w3.org/TR/json-ld/) schema.

```php
//Get the linkedData object
$ld = $info->getLinkedData();

$ld->all(); //Return all data
$ld->get('name'); //Return a key value
$ld->str('name'); //Return the value as string (remove html tags)
$ld->html('description'); //Return the value as html
$ld->int('width'); //Return the value as integer
$ld->url('url'); //Return the value as full url (converts relative urls to absolutes)
```

## Other APIs

Some sites like Wikipedia or Archive.org provide a custom API that is used to fetch more reliable data. You can get the API object with the method `getApi()` but note that not all results have this method. The Api object has the same methods than oEmbed:

```php
//Get the API object
$api = $info->getApi();

$api->all(); //Return all raw data
$api->get('title'); //Return a key value
$api->str('title'); //Return the value as string (remove html tags)
$api->html('html'); //Return the value as html
$api->int('width'); //Return the value as integer
$api->url('url'); //Return the value as full url (converts relative urls to absolutes)
```

## Extending Embed

Depending of your needs, you may want to extend this library with extra features or change the way it makes some operations.

### PSR

Embed use some PSR standards to be the most interoperable possible:

- [PSR-7](https://www.php-fig.org/psr/psr-7/) Standard interfaces to represent http requests, responses and uris
- [PSR-17](https://www.php-fig.org/psr/psr-17/) Standard factories to create PSR-7 objects
- [PSR-18](https://www.php-fig.org/psr/psr-18/) Standard interface to send a http request and return a response

Embed comes with a CURL client compatible with PSR-18 but you need to install a PSR-7 / PSR-17 library. [Here you can see a list of popular libraries](https://github.com/middlewares/awesome-psr15-middlewares#psr-7-implementations) and the library can detect automatically 'laminas\diactoros', 'guzzleHttp\psr7', 'slim\psr7', 'nyholm\psr7' and 'sunrise\http' (in this order). If you want to use a different PSR implementation, you can do it in this way:

```php
use Embed\Embed;
use Embed\Http\Crawler;

$client = new CustomHttpClient();
$requestFactory = new CustomRequestFactory();
$uriFactory = new CustomUriFactory();

//The Crawler is responsible for perform http queries
$crawler = new Crawler($client, $requestFactory, $uriFactory);

//Create an embed instance passing the Crawler
$embed = new Embed($crawler);
```

### Adapters

There are some sites with special needs: because they provide public APIs that allows to extract more info (like Wikipedia or Archive.org) or because we need to change how to extract the data in this particular site. For all that cases we have the adapters, that are classes extending the default classes to provide extra functionality.

Before creating an adapter, you need to understand how Embed work: when you execute this code, you get a `Extractor` class

```php
//Get the Extractor with all info
$info = $embed->get($url);

//The extractor have document and oembed:
$document = $info->getDocument();
$oembed = $info->getOEmbed();
```

The `Extractor` class has many `Detectors`. Each detector is responsible to detect a specific piece of info. For example, there's a detector for the title, other for description, image, code, etc.

So, an adapter is basically an extractor created specifically for a site. It can contains also custom detectors or apis. If you see the `src/Adapters` folder you can see all adapters.

If you create an adapter, you need also register to Embed, so it knows in which website needs to use. To do that, there's the `ExtractorFactory` object, that is responsible for instantiate the right extractor for each site.

```php
use Embed\Embed;

$embed = new Embed();

$factory = $embed->getExtractorFactory();

//Use this MySite adapter for mysite.com
$factory->addAdapter('mysite.com', MySite::class);

//Remove the adapter for pinterest.com, so it will use the default extractor
$factory->removeAdapter('pinterest.com');

//Change the default extractor
$factory->setDefault(CustomExtractor::class);
```

### Detectors

Embed comes with several predefined detectors, but you may want to change or add more. Just create a class extending `Embed\Detectors\Detector` class and register it in the extractor factory. For example:

```php
use Embed\Embed;
use Embed\Detectors\Detector;

class Robots extends Detector
{
    public function detect(): ?string
    {
        $response = $this->extractor->getResponse();
        $metas = $this->extractor->getMetas();

        return $response->getHeaderLine('x-robots-tag'),
            ?: $metas->str('robots');
    }
}

//Register the detector
$embed = new Embed();
$embed->getExtractorFactory()->addDetector('robots', Robots::class);

//Use it
$info = $embed->get('http://example.com');
$robots = $info->robots;
```

### Settings

If you need to pass settings to the CurlClient to perform http queries:

```php
use Embed\Embed;
use Embed\Http\Crawler;
use Embed\Http\CurlClient;

$client = new CurlClient();
$client->setSettings([
    'cookies_path' => $cookies_path,
    'ignored_errors' => [18],
    'max_redirs' => 3,               // see CURLOPT_MAXREDIRS
    'connect_timeout' => 2,          // see CURLOPT_CONNECTTIMEOUT
    'timeout' => 2,                  // see CURLOPT_TIMEOUT
    'ssl_verify_host' => 2,          // see CURLOPT_SSL_VERIFYHOST
    'ssl_verify_peer' => 1,          // see CURLOPT_SSL_VERIFYPEER
    'follow_location' => true,       // see CURLOPT_FOLLOWLOCATION
    'user_agent' => 'Mozilla',       // see CURLOPT_USERAGENT
]);

$embed = new Embed(new Crawler($client));
```

If you need to pass settings to your detectors, you can add settings to the `ExtractorFactory`:

```php
use Embed\Embed;

$embed = new Embed();
$embed->setSettings([
    'oembed:query_parameters' => [],  //Extra parameters send to oembed
    'twitch:parent' => 'example.com', //Required to embed twitch videos as iframe
    'facebook:token' => '1234|5678',  //Required to embed content from Facebook
    'instagram:token' => '1234|5678', //Required to embed content from Instagram
    'twitter:token' => 'asdf',        //Improve the data from twitter
]);
$info = $embed->get($url);
```

Note: The built-in detectors does not require settings. This feature is only for convenience if you create a specific detector that requires settings.

---

[ico-version]: https://poser.pugx.org/embed/embed/v/stable
[ico-license]: https://poser.pugx.org/embed/embed/license
[ico-downloads]: https://poser.pugx.org/embed/embed/downloads
[ico-m-downloads]: https://poser.pugx.org/embed/embed/d/monthly

[link-packagist]: https://packagist.org/packages/embed/embed

repository: oscarotero/Embed

repo_name: oscarotero/Embed


text:
# dokku-toolbelt

Toolbelt for dokku, similar to the heroku toolbelt

## HELP, MAINTAINER WANTED.

I no longer use dokku personally and would really appreciate someone stepping up to take ownership of this project from me. If you are interested, please create an issue to put your hand up.

## Installation
```
npm install -g dokku-toolbelt
```

## Example usage

```
cd /path/to/my/dokku/app
dt config

=====> app config vars
NODE_ENV: production
```

## Help

Running `dt help` or `dt` will output the help text information

## Explanation

Dokku toolbelt essentially just proxies running the `dokku` command on servers
remotely via ssh with a little 'context aware sugar' supplied by running
`git remote -v` in the current directory and parsing out `host` and `appname`

## Context aware

The toolbelt knows from which directory you are in, which server and project you are working with.
It can determine this by using `git remote -v` and looking for the correct host by looking for a dokku@ username
and parsing out the project name from the part after the : character.

```
dokku dokku@my-host.me:my-awesome-project

# host -> my-host.me
# project -> my-awesome-project
```

repository: command/dokku-toolbelt

repo_name: command/dokku-toolbelt


text:
# Pseudephebe pubescens (L.) M. Choisy SPECIES

#### Status
ACCEPTED

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

#### Published in
Icon. Lich. Univ. 2: sine pag. (1930)

#### Original name
Lichen pubescens L.

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
---
title: Untitled
date: 2017-11-04
---
About functorial construction of diagrams
-----------------------------------------

*Note added 2017-11-05:* This is completely wrong, the colimit of a
constant functor is that object, not $0$.

Suppose $0$ is a terminal object of a category $C$. Then we can define a
functor $C \to Fun(\Gamma, C)$, where $\Gamma$ is the category with that
shape, by taking $C$ to this diagram:

![](/images/8da2e6cdbfacef1337250c67dbb70c8bc74b5053.svg)

The natural transformations (the action on morphisms) are the obvious
ones.

In the setting of quasicategories, it is not so simple. BUT! We can
apply [@LuHiTop] prop <IP_ADDRESS>, in the case where $D' = \Delta^0$,
$C = \Gamma (=N(\Gamma))$, and $C^0$ is the initial object of $\Gamma$.
($D$ is $C$, confusingly). Then the induced functors
$\Gamma^0_{/x} \to C$ are all constant, so admit the colimit $0$. So
$K'$ is just the set of objects in $C$. By the colimit formula for Kan
extensions, we see that any kan extension of $x: \Delta^0 \to C$ to
$\Gamma$ must have terminal objects at the other coordinates. (Since any
two such functors are equivalent, this is even a sufficient criterion
for kan extension-ness). Hence $K$ consists of functors like the ones
pictured above, and a section of the trivial fibration of the theorem
gives us the desired functorial construction.

repository: AyeGill/personal-site

repo_name: AyeGill/personal-site


text:
# libsh Full API

Table of Contents

- [check_cmd](#check_cmd)
  - [Environment Variables](#environment-variables)
  - [Examples](#examples)
- [cleanup_directory](#cleanup_directory)
  - [Global Variables](#global-variables)
  - [Examples](#examples-1)
- [cleanup_file](#cleanup_file)
  - [Global Variables](#global-variables-1)
  - [Examples](#examples-2)
- [die](#die)
  - [Environment Variables](#environment-variables-1)
  - [Notes](#notes)
  - [Examples](#examples-3)
- [download](#download)
  - [Notes](#notes-1)
  - [Examples](#examples-4)
- [indent](#indent)
  - [Notes](#notes-2)
  - [Examples](#examples-5)
- [info_end](#info_end)
  - [Environment Variables](#environment-variables-2)
  - [Examples](#examples-6)
- [info_start](#info_start)
  - [Environment Variables](#environment-variables-3)
  - [Examples](#examples-7)
- [info](#info)
  - [Environment Variables](#environment-variables-4)
  - [Examples](#examples-8)
- [mktemp_directory](#mktemp_directory)
  - [Examples](#examples-9)
- [mktemp_file](#mktemp_file)
  - [Examples](#examples-10)
- [need_cmd](#need_cmd)
  - [Environment Variables](#environment-variables-5)
  - [Notes](#notes-3)
  - [Examples](#examples-11)
- [print_version](#print_version)
  - [Examples](#examples-12)
- [section](#section)
  - [Environment Variables](#environment-variables-6)
  - [Examples](#examples-13)
- [setup_cleanup_directories](#setup_cleanup_directories)
  - [Global Variables](#global-variables-2)
  - [Examples](#examples-14)
- [setup_cleanup_files](#setup_cleanup_files)
  - [Global Variables](#global-variables-3)
  - [Examples](#examples-15)
- [setup_cleanups](#setup_cleanups)
  - [Examples](#examples-16)
- [setup_traps](#setup_traps)
  - [Examples](#examples-17)
- [trap_cleanup_directories](#trap_cleanup_directories)
  - [Global Variables](#global-variables-4)
  - [Examples](#examples-18)
- [trap_cleanup_files](#trap_cleanup_files)
  - [Global Variables](#global-variables-5)
  - [Examples](#examples-19)
- [trap_cleanups](#trap_cleanups)
  - [Examples](#examples-20)
- [warn](#warn)
  - [Environment Variables](#environment-variables-7)
  - [Examples](#examples-21)

## check_cmd

Determines whether or not a program is available on the system PATH.

- `@param [String]` program name
- `@return 0` if program is found on system PATH
- `@return 1` if program is not found

### Environment Variables

- `PATH` indirectly used to search for the program

### Examples

Basic usage, when used as a conditional check:

```sh
if check_cmd git; then
  echo "Found Git"
fi
```

## cleanup_directory

Tracks a directory for later cleanup in a trap handler.

This function can be called immediately after a temp directory is created,
before a directory is created, or long after a directory exists. When used in
combination with [`trap_cleanup_directories`], all directories registered by
calling `cleanup_directory` will be removed if they exist when
`trap_cleanup_directories` is invoked.

- `@param [String]` path to directory
- `@return 0` if successful
- `@return 1` if a temp file could not be created

[`trap_cleanup_directories`]: #trap_cleanup_directories

### Global Variables

- `__CLEANUP_DIRECTORIES__` used to track the collection of directories to clean
  up whose value is a file. If not declared or set, this function will set it
  up.

### Examples

Basic usage:

```sh
dir="$(mktemp_directory)"
cleanup_directory "$dir"
# do work on directory, etc.
```

## cleanup_file

Tracks a file for later cleanup in a trap handler.

This function can be called immediately after a temp file is created, before a
file is created, or long after a file exists. When used in combination with
[`trap_cleanup_files`], all files registered by calling `cleanup_file` will be
removed if they exist when `trap_cleanup_files` is invoked.

- `@param [String]` path to file
- `@return 0` if successful
- `@return 1` if a temp file could not be created

[`trap_cleanup_files`]: #trap_cleanup_files

### Global Variables

- `__CLEANUP_FILES__` used to track the collection of files to clean up whose
  value is a file. If not declared or set, this function will set it up.

### Examples

Basic usage:

```sh
file="$(mktemp_file)"
cleanup_file "$file"
# do work on file, etc.
```

## die

Prints an error message to standard error and exits with a non-zero exit code.

- `@param [String]` warning text
- `@stderr` warning text message

### Environment Variables

- `TERM` used to determine whether or not the terminal is capable of printing
  colored output.

### Notes

This function calls `exit` and will **not** return.

### Examples

Basic usage:

```sh
die "No program to download tarball"
```

## download

Downloads the contents at the given URL to the given local file.

This implementation attempts to use the `curl` program with a fallback to the
`wget` program and a final fallback to the `ftp` program. The first download
program to succeed is used and if all fail, this function returns a non-zero
code.

- `@param [String]` download URL
- `@param [String]` destination file
- `@return 0` if a download was successful
- `@return 1` if a download was not successful

### Notes

At least one of `curl`, `wget`, or `ftp` must be compiled with SSL/TLS support
to be able to download from `https` sources.

### Examples

Basic usage:

```sh
download http://example.com/file.txt /tmp/file.txt
```

## indent

Indents the output from a command while preserving the command's exit code.

In minimal/POSIX shells there is no support for `set -o pipefail` which means
that the exit code of the first command in a shell pipeline won't be addressable
in an easy way. This implementation uses a temp file to ferry the original
command's exit code from a subshell back into the main function. The output can
be aligned with a pipe to `sed` as before but now we have an implementation
which mimics a `set -o pipefail` which should work on all Bourne shells. Note
that the `set -o errexit` is disabled during the command's invocation so that
its exit code can be captured.

Based on implementation from
[Stack Overflow](https://stackoverflow.com/a/54931544)

- `@param [String[]]` command and arguments
- `@return` the exit code of the command which was executed

### Notes

In order to preserve the output order of the command, the `stdout` and `stderr`
streams are combined, so the command will not emit its `stderr` output to the
caller's `stderr` stream.

### Examples

Basic usage:

```sh
indent cat /my/file
```

## info_end

Completes printing an informational, detailed step to standard out which has no
output, started with [`info_start`].

- `@stdout` informational heading text
- `@return 0` if successful

[`info_start`]: #info_start

### Environment Variables

- `TERM` used to determine whether or not the terminal is capable of printing
  colored output.

### Examples

Basic usage:

```sh
info_end
```

## info_start

Prints an informational, detailed step to standard out which has no output.

- `@param [String]` informational text
- `@stdout` informational heading text
- `@return 0` if successful

### Environment Variables

- `TERM` used to determine whether or not the terminal is capable of printing
  colored output.

### Examples

Basic usage:

```sh
info_start "Copying file"
```

## info

Prints an informational, detailed step to standard out.

- `@param [String]` informational text
- `@stdout` informational heading text
- `@return 0` if successful

### Environment Variables

- `TERM` used to determine whether or not the terminal is capable of printing
  colored output.

### Examples

Basic usage:

```sh
info "Downloading tarball"
```

## mktemp_directory

Creates a temporary directory and prints the name to standard output.

Most system use the first no-argument version, however Mac OS X 10.10 (Yosemite)
and older don't allow the no-argument version, hence the second fallback
version.

All tested invocations will create a file in each platform's suitable temporary
directory.

- `@param [optional, String]` parent directory
- `@stdout` path to temporary directory
- `@return 0` if successful

### Examples

Basic usage:

```sh
dir="$(mktemp_directory)"
# use directory
```

With a custom parent directory:

```sh
dir="$(mktemp_directory $HOME)"
# use directory
```

## mktemp_file

Creates a temporary file and prints the name to standard output.

Most systems use the first no-argument version, however Mac OS X 10.10
(Yosemite) and older don't allow the no-argument version, hence the second
fallback version.

All tested invocations will create a file in each platform's suitable temporary
directory.

- `@param [optional, String]` parent directory
- `@stdout` path to temporary file
- `@return 0` if successful

### Examples

Basic usage:

```sh
file="$(mktemp_file)"
# use file
```

With a custom parent directory:

```sh
dir="$(mktemp_file "$HOME")"
# use file
```

## need_cmd

Prints an error message and exits with a non-zero code if the program is not
available on the system PATH.

- `@param [String]` program name
- `@stderr` a warning message is printed if program cannot be found

### Environment Variables

- `PATH` indirectly used to search for the program

### Notes

If the program is not found, this function calls `exit` and will **not** return.

### Examples

Basic usage, when used as a guard or prerequisite in a function:

```sh
need_cmd git
```

## print_version

Prints program version information to standard out.

The minimal implementation will output the program name and version, separated
with a space, such as `my-program 1.2.3`. However, if the Git program is
detected and the current working directory is under a Git repository, then more
information will be displayed. Namely, the short Git SHA and author commit date
will be appended in parenthesis at end of the line. For example,
`my-program 1.2.3 (abc123 2000-01-02)`. Alternatively, if the Git commit
information is known ahead of time, it can be provided via optional arguments.

If verbose mode is enable by setting the optional third argument to a `true`,
then a detailed version report will be appended to the single line "simple
mode". Assuming that the Git program is available and the current working
directory is under a Git repository, then three extra lines will be emitted:

1. `release: 1.2.3` the version string
2. `commit-hash: abc...` the full Git SHA of the current commit
3. `commit-date: 2000-01-02` the author commit date of the current commit

If Git is not found and no additional optional arguments are provided, then only
the `release: 1.2.3` line will be emitted for verbose mode.

Finally, if the Git repository is not "clean", that is if it contains
uncommitted or modified files, a `-dirty` suffix will be added to the short and
long Git SHA refs to signal that the implementation may not perfectly correspond
to a SHA commit.

- `@param [String]` program name
- `@param [String]` version string
- `@param [optional, String]` verbose mode set if value if `"true"`
- `@param [optional, String]` short Git SHA
- `@param [optional, String]` long Git SHA
- `@param [optional, String]` commit/version date
- `@stdout` version information
- `@return 0` if successful

Note that the implementation for this function was inspired by Rust's
[`cargo version`](https://git.io/fjsOh).

### Examples

Basic usage:

```sh
print_version "my-program" "1.2.3"
```

An optional third argument puts the function in verbose mode and more detail is
output to standard out:

```sh
print_version "my-program" "1.2.3" "true"
```

An empty third argument is the same as only providing two arguments (i.e.
non-verbose):

```sh
print_version "my-program" "1.2.3" ""
```

## section

Prints a section-delimiting header to standard out.

- `@param [String]` section heading text
- `@stdout` section heading text
- `@return 0` if successful

### Environment Variables

- `TERM` used to determine whether or not the terminal is capable of printing
  colored output.

### Examples

Basic usage:

```sh
section "Building project"
```

## setup_cleanup_directories

Sets up state to track directories for later cleanup in a trap handler.

This function is typically used in combination with [`cleanup_directory`] and
[`trap_cleanup_directories`].

- `@return 0` if successful
- `@return 1` if a temp file could not be created

### Global Variables

- `__CLEANUP_DIRECTORIES__` used to track the collection of directories to clean
  up whose value is a file. If not declared or set, this function will set it
  up.
- `__CLEANUP_DIRECTORIES_SETUP__` used to track if the `__CLEANUP_DIRECTORIES__`
  variable has been set up for the current process

### Examples

Basic usage:

```sh
setup_cleanup_directories
```

Used with [`cleanup_directory`], [`setup_traps`], and
[`trap_cleanup_directories`]:

```sh
setup_cleanup_directories
setup_traps trap_cleanup_directories

dir="$(mktemp_directory)"
cleanup_directory "$dir"
# do work on directory, etc.
```

[`cleanup_file`]: #cleanup_file
[`setup_traps`]: #setup_traps
[`trap_cleanup_directories`]: #trap_cleanup_directories

## setup_cleanup_files

Sets up state to track files for later cleanup in a trap handler.

This function is typically used in combination with [`cleanup_file`] and
[`trap_cleanup_files`].

- `@return 0` if successful
- `@return 1` if a temp file could not be created

### Global Variables

- `__CLEANUP_FILES__` used to track the collection of files to clean up whose
  value is a file. If not declared or set, this function will set it up.
- `__CLEANUP_FILES_SETUP__` used to track if the `__CLEANUP_FILES__` variable
  has been set up for the current process

### Examples

Basic usage:

```sh
setup_cleanup_files
```

Used with [`cleanup_file`], [`setup_traps`], and [`trap_cleanup_files`]:

```sh
setup_cleanup_files
setup_traps trap_cleanup_files

file="$(mktemp_file)"
cleanup_file "$file"
# do work on file, etc.
```

[`cleanup_file`]: #cleanup_file
[`setup_traps`]: #setup_traps
[`trap_cleanup_files`]: #trap_cleanup_files

## setup_cleanups

Sets up state to track files and directories for later cleanup in a trap
handler.

This function is typically used in combination with [`cleanup_file`] and
[`cleanup_directory`] as well as [`trap_cleanups`].

- `@return 0` if successful
- `@return 1` if the setup was not successful

### Examples

Basic usage:

```sh
setup_cleanups
```

Used with [`cleanup_directory`], [`cleanup_file`], [`setup_traps`], and
[`trap_cleanups`]:

```sh
setup_cleanups
setup_traps trap_cleanups

file="$(mktemp_file)"
cleanup_file "$file"
# do work on file, etc.

dir="$(mktemp_directory)"
cleanup_directory "$dir"
# do work on directory, etc.
```

[`cleanup_directory`]: #cleanup_directory
[`cleanup_file`]: #cleanup_file
[`setup_traps`]: #setup_traps
[`trap_cleanups`]: #trap_cleanups

## setup_traps

Sets up traps for `EXIT` and common signals with the given cleanup function.

In addition to `EXIT`, the `HUP`, `INT`, `QUIT`, `ALRM`, and `TERM` signals are
also covered.

This implementation was based on a very nice, portable signal handling thread
thanks to an implementation on
[Stack Overflow](https://unix.stackexchange.com/a/240736).

- `@param [String]` name of function to run with traps

### Examples

Basic usage with a simple "hello world" cleanup function:

```sh
hello_trap() {
  echo "Hello, trap!"
}

setup_traps hello_trap
```

If the cleanup is simple enough to be a one-liner, you can provide the command
as the single argument:

```sh
setup_traps "echo 'Hello, World!'"
```

## trap_cleanup_directories

Removes any tracked directories registered via [`cleanup_directory`].

- `@return 0` whether or not an error has occurred

[`cleanup_directory`]: #cleanup_directory

### Global Variables

- `__CLEANUP_DIRECTORIES__` used to track the collection of files to clean up
  whose value is a file. If not declared or set, this function will assume there
  is no work to do.

### Examples

Basic usage:

```sh
trap trap_cleanup_directories 1 2 3 15 ERR EXIT

dir="$(mktemp_directory)"
cleanup_directory "$dir"
# do work on directory, etc.
```

## trap_cleanup_files

Removes any tracked files registered via [`cleanup_file`].

- `@return 0` whether or not an error has occurred

[`cleanup_file`]: #cleanup_file

### Global Variables

- `__CLEANUP_FILES__` used to track the collection of files to clean up whose
  value is a file. If not declared or set, this function will assume there is no
  work to do.

### Examples

Basic usage:

```sh
trap trap_cleanup_files 1 2 3 15 ERR EXIT

file="$(mktemp_file)"
cleanup_file "$file"
# do work on file, etc.
```

## trap_cleanups

Removes any tracked files and directories registered via [`cleanup_file`] and
[`cleanup_directory`] respectively.

- `@return 0` whether or not an error has occurred

[`cleanup_directory`]: #cleanup_directory
[`cleanup_file`]: #cleanup_file

### Examples

Basic usage:

```sh
trap trap_cleanups 1 2 3 15 ERR EXIT
```

Used with [`setup_traps`]:

```sh
setup_traps trap_cleanups
```

[`setup_traps`]: #setup_traps

## warn

Prints a warning message to standard out.

- `@param [String]` warning text
- `@stdout` warning heading text
- `@return 0` if successful

### Environment Variables

- `TERM` used to determine whether or not the terminal is capable of printing
  colored output.

### Examples

Basic usage:

```sh
warn "Could not connect to service"
```

repository: fnichol/libsh

branch_name: refs/heads/main

gha_language: Shell

gha_license_id: NOASSERTION

repo_name: fnichol/libsh


text:
# Airport Challenge

```
        ______
        _\____\___
=  = ==(____MA____)
          \_____\___________________,-~~~~~~~`-.._
          /     o o o o o o o o o o o o o o o o  |\_
          `~-.__       __..----..__                  )
                `---~~\___________/------------`````
                =  ===(_________)

```
## Introduction

In order to gain more practice writing Javascript, i revisited this exercise which was originally completed in Ruby [here](https://github.com/ArifEbrahim/airport_challenge).

This allowed to be implement TDD, debugging, mocks/doubles & dependancy injection in another language. All 6 user user stories were completed.

## How to use

#### To set up the project

Clone this repo to your computer and then open "index.html" in your web browser.

#### To create an airport

Open the developer console in your browser. Instantiate an airport by calling `new Airport();` . The airport class and allows instances of the Plane class to land or take off.

```
let jfk = new Airport();
```

#### To create a plane

Open the developer console in your browser. Instantiate a plane by calling `new Plane();` . The plane class can be told to land and take off from airports.

```
let b747 = new Plane();
```

#### Plane methods

A plane can be instructed to land at an airport with the following method:

```
b747.land(jfk);
```

Similarly, planes can be instructed to take off with the following method:

```
b747.takeOff();
```

There is randomly generated weather and if it's stormy weather then planes will not be allowed to land or take off. An error message is generated in the console in both cases.

#### Testing

Testing was completed in Jasmine and all tests are passing. To view the tests, open the file "SpecRunner.html" in your web browser. A screenshot is included below.

![tests](./images/tests.png)

## User stories implemented

The following user stories were implemented as part of this project:

```
As an air traffic controller
So I can get passengers to a destination
I want to instruct a plane to land at an airport and confirm that it has landed

As an air traffic controller
So I can get passengers on the way to their destination
I want to instruct a plane to take off from an airport and confirm that it is no longer in the airport

As an air traffic controller
To ensure safety
I want to prevent landing when the airport is full

As the system designer
So that the software can be used for many different airports
I would like a default airport capacity that can be overridden as appropriate

As an air traffic controller
To ensure safety
I want to prevent takeoff when weather is stormy

As an air traffic controller
To ensure safety
I want to prevent landing when weather is stormy
```

## Future work

The following edge cases have been solved:
- planes that are in the air cannot take off again

The following edge cases still need to be worked on:
- planes can only take off from airports they are in
- planes that are landed cannot land again and must be in an airport


text:
---
hrs_structure:
  division: '1'
  volume: '2'
  title: '9'
  chapter: 103F
  section: 103F-414
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0103F-0414
    parent: HRS0103F
    name: 103F-414 Allotment
weight: 67135
title: Allotment
full_title: 103F-414 Allotment
---
**[§103F-414]** **Allotment.** Contracts to expend and appropriations for the purchase of health and human services shall be subject to the allotment system generally applicable to all appropriations made by the legislature. [L 1997, c 190, pt of §2]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# ,

> Comma runs software without installing it.

A `pacman` port of [shopify/comma](https://github.com/shopify/comma)

Literally just a tiny wrapper for `pacman` and `fzf` that finds the right package for your command, and installs it temporarily while your command runs.

## Installation

```sh
git clone https://github.com/tombl/comma
cd comma
cargo build --release
cp target/release/comma ~/.local/bin/,
```

## Usage

```sh
, cowsay neato
```

Run `sudo pacman -Fy` on occasion to update the binary database.

repository: tombl/comma

repo_name: tombl/comma


text:
<!--
This file is part of JavaSMT,
an API wrapper for a collection of SMT solvers:
https://github.com/sosy-lab/java-smt

SPDX-FileCopyrightText: 2021 Dirk Beyer <https://www.sosy-lab.org>

SPDX-License-Identifier: Apache-2.0
-->

This is an example application for using JavaSMT with Maven.
The example application prints a table of the available SMT solvers,
their version number and supported features.

The Maven workflow in this project supports the following steps:

- Compiling: `mvn compile` downloads all dependencies and compiles the project.
- Testing: `mvn test` executes the Sudoku example test.
- Packaging: `mvn package` creates a jar file for the example application.
  Dependencies like other jar files and binaries for SMT solvers are stored in the directory `dependencies`.
- Running: `java -jar ./target/java-smt-maven-example-VERSION.jar` shows a table in the terminal.

Please note that the Maven repository currently only contains release versions
and no snapshots, thus the newest features and bugfixes might be missing.
If a Maven step is not working or more steps are required,
please ask or report an issue [in the project](https://github.com/sosy-lab/java-smt).

repository: sosy-lab/java-smt

gha_language: Java

repo_name: sosy-lab/java-smt


text:
Creating an Event
===

On Substrate, [**Transactions**](https://substrate.dev/docs/en/overview/glossary#transaction) are handled differently than you might have been used to on Ethereum. Even though a transaction may be finalized, it does not necessarily imply that the function executed by that transaction fully succeeded.

To know that, we should emit an [**`Event`**](https://substrate.dev/docs/en/overview/glossary#events) at the end of the function to not only report success, but to tell the "off-chain world" that some particular state transition has happened.

## Declaring an Event

Substrate provides a `decl_event!` macro which allows you to easily create events which you can deposit in your runtime logic.

Here is an example of an event declaration:

```rust
decl_event!(
    pub enum Event<T>
    where
        <T as system::Trait>::AccountId,
        <T as system::Trait>::Balance
    {
        MyEvent(u32, Balance),
        MyOtherEvent(Balance, AccountId),
    }
);
```

Again, if we want to use some custom Substrate types, we need to integrate generics into our event definition.

## Adding an Event Type

The `decl_event!` macro will generate a new `Event` type which you will need to expose in your module. This type will need to inherit some traits like so:

```rust
pub trait Trait: balances::Trait {
    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
}
```

## Depositing an Event

In order to use events within your runtime, you need to add a function which deposits those events. Since this is a common pattern in runtime development, the [**`decl_module!`**](https://github.com/paritytech/wiki/pull/272) macro can automatically add a default implementation of this to your module.

Simply add a new function to your module like so:

```rust
fn deposit_event<T>() = default;
```

If your events do not use any generics (e.g. just Rust primitive types), you should omit the `<T>` like this:

```rust
fn deposit_event() = default;
```

The `decl_module!` macro will detect this line, and replace it with the appropriate function definition for your runtime.

### Calling `deposit_event()`

Now that you have things set up within your module, you may want to actually deposit the event at the end of your function.

Doing that is relatively simple, you just need to provide the values that go along with your `Event` definition:

```rust
let my_value = 1337;
let my_balance = <T::Balance as As<u64>>::sa(1337);

Self::deposit_event(RawEvent::MyEvent(my_value, my_balance));
```

## Updating `lib.rs` to Include Events

The last step to get your runtime to compile is to update the `lib.rs` file to include the new `Event` type you have defined.

In your modules `Trait` implementation, you need to include:

```rust
// `lib.rs`
...
impl mymodule::Trait for Runtime {
    type Event = Event;
}
...
```

Finally, you need to also include the `Event` or `Event<T>` type to your module's definition in the `construct_runtime!` macro. Which one you include depends again on whether your event uses any generics.

```rust
// `lib.rs`
...
construct_runtime!(
    pub enum Runtime with Log(InternalLog: DigestItem<Hash, Ed25519AuthorityId>) where
        Block = Block,
        NodeBlock = opaque::Block,
        InherentData = BasicInherentData
    {
        ...
        MyModule: mymodule::{Module, Call, Storage, Event<T>},
    }
);
...
```

## Your Turn!

You will need to update your module to support events. We have taught you all the different parts, you will just need to piece it together.

Use the instructions in the template of this section to help you get your module talking! Remember you will need to update `lib.rs` too!

<!-- tabs:start -->

#### ** Template **

[embedded-code-template](./assets/2.2-template.rs ':include :type=code embed-template')

#### ** Solution **

[embedded-code-final](./assets/2.2-finished-code.rs ':include :type=code embed-final')

#### ** Previous Chapter Solution **

[embedded-code-previous](./assets/2.1-finished-code.rs ':include :type=code embed-previous')

<!-- tabs:end -->


text:
# Starbucks Capstone Challenge
In this project I do some EDA of starbucks data.

The business questions I want to ask are as follows:

1 Female customers or male customers, which group is the majority?

2 Are my customers wealther than the average US people?

3 Could the company make specific promotion strategy according to individual attribute?

4 How to use funnel analysis to help more people to use their promotions?

# Installation

numpy
pandas
matplotlib
sklearn

# Dataset overview

The program used to create the data simulates how people make purchasing decisions and how those decisions are influenced by

promotional offers. Each person in the simulation has some hidden traits that influence their purchasing patterns and are

associated with their observable traits. People produce various events, including receiving offers, opening offers, and making

purchases. As a simplification, there are no explicit products to track. Only the amounts of each transaction or offer are

recorded. here are three types of offers that can be sent: buy-one-get-one (BOGO), discount, and informational. In a BOGO

offer, a user needs to spend a certain amount to get a reward equal to that threshold amount. In a discount, a user gains a

reward equal to a fraction of the amount spent. In an informational offer, there is no reward, but neither is there a

requisite amount that the user is expected to spend. Offers can be delivered via multiple channels. The basic task is to use

the data to identify which groups of people are most responsive to each type of offer, and how best to present each type of offer.

## Data Dictionary
### profile.json：

Rewards program users (17000 users x 5 fields)

gender: (categorical) M, F, O, or null

age: (numeric) missing value encoded as 118

id: (string/hash)

became_member_on: (date) format YYYYMMDD

income: (numeric)

### portfolio.json：

Offers sent during 30-day test period (10 offers x 6 fields)

reward: (numeric) money awarded for the amount spent

channels: (list) web, email, mobile, social

difficulty: (numeric) money required to be spent to receive reward

duration: (numeric) time for offer to be open, in days

offer_type: (string) bogo, discount, informational

id: (string/hash)

### transcript.json：

Event log (306648 events x 4 fields)

person: (string/hash)

event: (string) offer received, offer viewed, transaction, offer completed

value: (dictionary) different values depending on event type

offer id: (string/hash) not associated with any "transaction"

amount: (numeric) money spent in "transaction"

reward: (numeric) money gained from "offer completed"

time: (numeric) hours after start of test

# Results

Now we know that there are more female customers than males in the data set, and the female customers intend to have a higher

income. The whole group of customers in the group have a higher salary than the US median income, and this shows that

Starbucks is favourable by the middle class.

Among all the offers, the offer with difficulty 10 has the highest completion rate, which may shed light on future promotion strategy of Starbucks.

Unfortunately, these clusters seem to be appropriate for segmenting the customers’ attribute, but not for the transactional

information. This will be one direction of my future studies. I also want to do supervised learning to find a more effective

promotion strategy given customers’ historical data.

# Licensing, Acknowledgements, etc.
Code released under the MIT license.

Thanks to Starbucks for the dataset, and to Udacity for bringing the opportunity to work with it.

repository: JackoChi/DSND

repo_name: JackoChi/DSND


text:
---
layout: page
title: hipsteR
tagline: re-educating people who learned R before it was cool
description: brief description of newer R-related developments
---

I was an early adopter of [R](https://www.r-project.org), having first
learned S (yay!) and then S-plus (yuck!). But at times my knowledge of
R seems stuck in 2001. I keep finding out about “new” R
functions (like `replicate`, which was new in _2003_).

This is a tutorial for people like me, or people who were taught by people like me.

### Switch to knitr

If you use [Sweave](http://leisch.userweb.mwn.de/Sweave/), it's time
you switched to [knitr](https://yihui.name/knitr/). You'll find that
the transition is easy.

A number of Sweave annoyances have been eliminated, but most
importantly you can use knitr
[with R Markdown](https://kbroman.org/knitr_knutshell/pages/Rmarkdown.html)
or
[with AsciiDoc](https://kbroman.org/knitr_knutshell/pages/asciidoc.html)
for writing simple reports. The markup is much simpler than LaTeX, and
you don't have to worry about page breaks.

### Learn [Hadley Wickham](http://hadley.nz)'s packages

Start with [dplyr](http://dplyr.tidyverse.org/), [tidyr](http://tidyr.tidyverse.org/),
[purrr](http://purrr.tidyverse.org/), and
[ggplot2](http://ggplot2.tidyverse.org/).

These are the main packages for what's now called the
"[tidyverse](https://www.tidyverse.org/)", which has grown beyond
Hadley. Also check out

- [lubridate](http://lubridate.tidyverse.org/) for handing dates
- [stringr](http://stringr.tidyverse.org/) for handling strings
- [forcats](http://forcats.tidyverse.org/) for handling factors
- [readr](http://readr.tidyverse.org/) for reading csv/tsv files
- [readxl](http://readxl.tidyverse.org/) for reading Excel files
- [broom](https://broom.tidyverse.org) for tidying statistical
analysis objects

For R package development, check out [devtools](https://github.com/hadley/devtools),
[roxygen2](https://github.com/klutometis/roxygen),
[testthat](https://github.com/hadley/testthat),
and [assertthat](https://github.com/hadley/assertthat).

Also, read his books: [Advanced R](http://adv-r.had.co.nz/),
[R packages](http://r-pkgs.had.co.nz/),
[R for Data Science](http://r4ds.had.co.nz/),
and [ggplot2 (2nd edition)](http://ggplot2.org/book/).

### Adopt the pipe operator

When you adopt [Hadley](http://hadley.nz)'s [dplyr](https://github.com/hadley/dplyr)
and [tidyr](https://github.com/hadley/tidyr) tools, you'll want to
also adopt the pipe operator `%>%`, from
[magrittr](https://github.com/smbache/magrittr).

You're old school, so you're used to writing
[stuff like this](https://twitter.com/kwbroman/status/521127502391955456):

```r
x <- c(0.109, 0.359, 0.63, 0.996, 0.515, 0.142, 0.017, 0.829, 0.907)
round(exp(diff(log(x))), 1)
```

Seems perfectly fine, but note how it's read from the inside out. With
the pipe operator, you can do the same series of steps, written in the
order that they're actually performed.

```r
library(magrittr)
x %>% log %>%
    diff %>%
    exp %>%
    round(1)
```

The pipe operator does some magic that makes the bit on the left be
the first argument of the function call on the right.

If you need the bit on the left of the pipe to be somewhere other than
the first argument, you can use a period.  For example, here's a wacky way to
get the log (base 2) of 5.

```r
2 %>% log(5, base=.)
```

Note:
[Jenny Bryan suggests](https://twitter.com/JennyBryan/status/748290187034169344)
that we use the parentheses on the functions even when they're not
formally required, like this:

```r
library(magrittr)
x %>% log() %>%
    diff() %>%
    exp() %>%
    round(1)
```

### Consider RStudio

If you're still using the R GUI (for Windows or Mac), you should
switch to [RStudio](https://www.rstudio.com/products/rstudio/download/#download).
Everything about it is better.

Personally, I stick with [Emacs](https://www.gnu.org/software/emacs/) +
[ESS](https://ess.r-project.org/), because I'm writing code in multiple
languages (not just R). (Another IDE option for R that many recommend:
[Eclipse](https://www.eclipse.org/eclipse/) with
[StatET](http://www.walware.de/goto/statet).)

But I use RStudio for teaching: for demonstrations, and I have the
students use it; it's the best environment for learning R.

And note that RStudio makes it easy to
[use knitr with Markdown](https://rmarkdown.rstudio.com/),
and to
[develop R Packages](https://support.rstudio.com/hc/en-us/articles/200486488-Developing-Packages-with-RStudio).
And RStudio also has some
[nice debugging features](https://support.rstudio.com/hc/en-us/articles/205612627-Debugging-with-RStudio),
like the ability to set breakpoints.

[RStudio](https://rstudio.com), the company, produces a number of other great
tools, like [shiny](https://shiny.rstudio.com).

### CRAN is huge, and there's also GitHub

[CRAN](https://cran.r-project.org) has over 8000 packages, with lots of
great stuff like
[data.table](https://cran.r-project.org/package=data.table),
[magrittr](https://github.com/smbache/magrittr),
[RSQLite](https://cran.r-project.org/package=RSQLite),
[XML](https://cran.r-project.org/package=XML),
[animation](https://yihui.name/animation/), and
[slidify](http://slidify.org/).

And there are even more packages that live on [GitHub](https://github.com) (solely, or in
addition to CRAN), and with the `install_github()` function in the
[devtools](https://github.com/hadley/devtools) package, you can skip
CRAN and install packages straight from GitHub. devtools also has an
`install_bitbucket()` for installing from
[BitBucket](https://bitbucket.org).

I'd better mention [Bioconductor](https://bioconductor.org/); oodles of
bioinformatics/genomics-related packages live there rather than CRAN.

And while I'm talking packages, I should mention
[ROpenSci](https://ropensci.org/), an effort to create packages to
access all kinds of data repositories from R. Take a look at
[their list](https://ropensci.org/packages/).

### You _can_ put underscores in names

It used to be that `_` was a shortcut for `<-`. (That was always a bad
idea. And it led me to use dots in function names, like
[`calc.genoprob`](https://github.com/kbroman/qtl/blob/master/R/calc.genoprob.R),
which has been problematic due to the S3 class system.)

Then they started allowing `=` in place of `<-`.

And then they got rid of `_` as a shortcut for `<-`.  Good idea, and
now we can have functions named like `calc_genoprob`.

### Read about new features

Read about new features in R
[here](https://cran.r-project.org/src/base/NEWS).

Also look at
[what was new in older versions](https://cran.r-project.org/src/base/NEWS.2)
and [even older versions](https://cran.r-project.org/src/base/NEWS.1).

### New apply-type functions

You probably know about `apply`, `lapply`, `sapply`, and `tapply`. But
did you know about `vapply` and `mapply`? And how about `replicate`?

For truly modern functional programming in R, check out the
[purrr](http://purrr.tidyverse.org) package (part of the
[tidyverse](https://www.tidyverse.org)).

### Parallel and Rcpp

Look at the
[parallel package](https://stat.ethz.ch/R-manual/R-devel/library/parallel/doc/parallel.pdf),
and perhaps read the
[Parallel R book](https://www.amazon.com/exec/obidos/ASIN/1449309925/7210-20).

Also look at [Rcpp](http://adv-r.had.co.nz/Rcpp.html), a simpler way
to call C/C++ functions from R. Read the [Rcpp book](https://www.amazon.com/exec/obidos/ASIN/1461468671/7210-20).

### Various

I searched through the `NEWS` files (mentioned above) and
wrote down some of the functions that were new since 2002.

(Note that I have little experience with many of these, and some are
not entirely recommended. For example,
[rickyars](https://github.com/rickyars)
[noted](https://github.com/kbroman/hipsteR/issues/4) that `inner_join` and
`left_join` in [dplyr](https://github.com/hadley/dplyr) can be 10×
faster than `merge`. [Ben Bolker](https://ms.mcmaster.ca/~bolker/) [recommends](https://kbroman.wordpress.com/2014/05/15/hipster-re-educating-people-who-learned-r-before-it-was-cool/#comment-3518) the `plyr::r*ply` functions
over `replicate`, as you get to define the return structure.)

[`Vectorize`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/Vectorize.html)

[`which.min`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/which.min.html), [`which.max`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/which.min.html)

[`stopifnot`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/stopifnot.html)

[`strwrap`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/strwrap.html)

[`unsplit`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/split.html)

[`rowSums`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/colSums.html), [`colSums`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/colSums.html), [`rowMeans`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/colSums.html),
[`colMeans`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/colSums.html)

[`rowsum`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/rowsum.html)

[`slice.index`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/slice.index.html)

[`runmed`](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/runmed.html)

[`addmargins`](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/addmargins.html)

[`head`](https://stat.ethz.ch/R-manual/R-devel/library/utils/html/head.html),
[`tail`](https://stat.ethz.ch/R-manual/R-devel/library/utils/html/head.html)

[`arrayInd`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/which.html)

[`droplevels`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/droplevels.html)

[`saveRDS`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/readRDS.html), [`readRDS`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/readRDS.html)

[`paste0`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/paste.html)

[`anyNA`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/NA.html)

[`aggregate`](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/aggregate.html), [`by`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/by.html)

[`merge`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/merge.html)

[`with`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/with.html)

[`stack`](https://stat.ethz.ch/R-manual/R-devel/library/utils/html/stack.html), [`reshape`](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/reshape.html), [`relist`](https://stat.ethz.ch/R-manual/R-devel/library/utils/html/relist.html)

---

The source for this tutorial is
[on github](https://github.com/kbroman/hipsteR).

I would be glad for suggestions, corrections, or additions.

Also see my tutorials on
[git/github](https://kbroman.org/github_tutorial),
[knitr](https://kbroman.org/knitr_knutshell),
[make](https://kbroman.org/minimal_make),
[R packages](https://kbroman.org/pkg_primer),
[data organization](https://kbroman.org/dataorg),
and [initial steps towards reproducible research](https://kbroman.org/steps2rr).

repository: kbroman/hipsteR

branch_name: refs/heads/gh-pages

gha_language: Ruby

repo_name: kbroman/hipsteR


text:
<div align="center">
<h1> Codeforces Timer </h1>
A Google Chrome Extension to add a timer to practice speed problem solving on Codeforces.
</div>

## Installation

1. Download the repo as `.zip` and extract it.
2. Open Google Chrome -> Settings -> Extensions -> Toggle On Developer Mode -> Load Unpacked Extensions -> Point to the extracted folder.

## Usage

1. Select the timer as per your need from the drop down of extension icon.
2. Selected timer will be applied for all the problems that you open.
3. Problems can be opened from Problemset page and Contest page.
4. Once a problem is opened timer cannot be paused.
5. When a solution is submitted within time, and is accepted, the timer will detect and automatically stop and show `Finished`.
6. For already solved problems, timer will show a `Finished` message.
7. For problems, you ran out of time, it will show a `Timed Out` message.


text:
---
layout: post
title: "2020 ipywidgets workshop in Paris"
author: "Wolf Vollprecht"
summary: I have worked on finishing drag'n'drop in ipywidgets, and adding dynamic loading to JuppyterLab extensions.
image: /assets/images/2020/dragdropteaser.png
categories: posts
---

We've had five days of ipywidgets workshop in Paris, and while others worked on doing the hard work (fixing bugs and preparing the next big release of ipywidgets 8.0) I was finishing up an old PR for a really cool new feature (drag and drop!) and working on JupyterLab dynamic extension loading support for the upcoming JupyterLab 2.0!

![ipywidgets sprint 2020](/assets/images/2020/ipywidgets_sprint.jpg)

## Drag and Drop in ipywidgets

During the past summer, we've worked with [Bartosz Telenczuk](https://github.com/btel) on adding drag'n'drop support to ipywidgets. This work went very far, and there was an open pull request with all the good ideas inside. The initial work was done, but some cleanup and last bits of work before this could be merged. This last bit of work is now done.

<video controls="true" autoplay loop width="100%">
	<source src="/assets/images/2020/drag_drop_ipywidgets.mp4" type="video/mp4" />
	<source src="/assets/images/2020/drag_drop_ipywidgets.webm" type="video/webm" />
</video>

The drag and drop example notebook

The initial implementation was a draggable Label that could be dropped on containers. After we started with an implementation of a draggable `Label`, we settled on more generic widgets: a `DraggableBox` and a `DropBox`. Both are containers that can hold exactly one child. If the `draggable` trait on the `DraggableBox` is set to true, it can be dragged, and dropped, for example on a `DropBox`. One can install an `on_drop` handler on a  `DropBox` to receive data that was attached to the `DraggableBox`, as well as the widget that was dropped. That makes it possible to drag widgets from one container to another (as shown in the screencast). I think drag'n'drop will give a lot of power to the user, and I can see quite a few interesting applications for it, such as interactive plot builder, image sorting or dropping pins on a ipyleaflet map.

It is even possible to receive drag and drop events from the rest of the operating system, so one can also drag a file on top of a DropBox, and the widget will receive the mime type info, e.g. for uploading one or multiple images. Additioanlly, this also works in JupyterLab, and with detached widgets, as Jeremy Tuloup shows in this GIF:

![](https://user-images.githubusercontent.com/591645/72636740-03b41a80-3960-11ea-9319-1b2abe583571.gif)

Here is the open PR: [https://github.com/jupyter-widgets/ipywidgets/pull/2720](https://github.com/jupyter-widgets/ipywidgets/pull/2720) which should go in for 8.0.

## JupyterLab dynamic extension loading

JupyterLab has a really nice extension system. Extensions can change almost every part of the JupyterLab app -- however, there is a drawback currently. As extensions are so tightly integrated, they are usually _compiled_ into the JupyterLab JavaScript. This means that when installing a new JupyterLab extension, the user needs to have NodeJS and yarn installed, and during the installation process a lot of memory, bandwidth and CPU is used to download all required NPM packages and compile them into a small production bundle.
Another hurdle is that in some organizations, access to NPM is forbidden -- as it comes with some security implications.

Since JavaScript is a dynamic language, it also has an `eval` method, and we can dynamically load and execute scripts from the internet, or a file. Back in the days of JQuery, there was a utility called `RequireJS` to dynamically load JavaScript. We're using this again to load and register JupyterLab extension dynamically, and it's still working great.

For this work we started a repository on GitHub, and at the moment it's called [jupyterlab-dynext](https://github.com/wolfv/jupyterlab-dynext). It's a JupyterLab extension that dynamically loads, wait for it, more JupyterLab extensions. Dynamic JupyterLab extensions look almost like regular extensions, with the small difference that the `requires` key shouldn't contain Token instances, but rather plain strings. These plain strings are then matched against other registered plugins in JupyterLab, and the correct dependencies are injected.

For example:

```js
return function()
{
  return {
    id: 'mydynamicplugin',
    autoStart: true,
    requires: ["@jupyterlab/apputils:ICommandPalette"],
    activate: function(app, palette) {
      console.log("Hello from a dynamically loaded plugin!");

      // We can use `.app` here to do something with the JupyterLab
      // app instance, such as adding a new command
      let commandID = "MySuperCoolDynamicCommand";
      let toggle = true;
      app.commands.addCommand(commandID, {
        label: 'My Super Cool Dynamic Command',
        isToggled: function() {
          return toggle;
        },
        execute: function() {
          console.log("Executed " + commandID);
          toggle = !toggle;
        }
      });

      palette.addItem({
        command: commandID,
        // make it appear right at the top!
        category: 'AAA',
        args: {}
      });
    }
  };
}
```

The activate function will always receive the running JupyterLab app instance as the first argument, the other arguments are dynamically injected depending on values in the `requires` list -- in this case we want to add a command to the command palette, and in order to do that we need the ICommandPalette instance.

The jupyterlab-dynext loader can currently load any given URL (for example, you can use a GitHub Gist URL), and you can try out a new extension by executing the "Load current file as extension command" while editing the file. Note that this trick currently works only once, as the plugin IDs are unique and reloading is currently not allowed.

<video width="100%" controls>
    <source src="/assets/images/2020/dynamic_jlab_loading.mp4" type="video/mp4" />
    <source src="/assets/images/2020/dynamic_jlab_loading.webm" type="video/webm" />
</video>

In the future it would be very cool to have a sort of snippet editor for these dynamically loaded extensions, with a big reload button to test extensions or themes quickly. One could also expose these JS loading capabilities as a widget to the notebook, in order to bring some of the old `%% javascript` magic back. If you are interested in hacking on this and currently are a student, don't hesitate to contact us as we're still looking for interns at QuantStack.

Mockup of a extension manager/editor with reload

#### JupyterLab Dark Theme

I am also still quite frustrated with the dark theme of JupyterLab. I think it was a hasty job back then, where colors were not correctly adjusted to make it look great. The black is very saturated, and some of the colors for syntax highlighting have a low contrast ratio. So I quickly ported a different dark theme to JupyterLab, mostly by using the style editor in Firefox: Turns out it's really simple to make themes for JLab, just installing them is as tedious as it is with any extension – something we're trying to fix with the dynamic extension loader as well. It should probably have a way to load a theme style sheet without executing any JavaScript so that installing themes doesn't have any security implications. But as it stands right now, it doesn't look like this (or any other better dark theme) will make the cut for JupyterLab 2.0 [(pull request is open here)](https://github.com/jupyterlab/jupyterlab/pull/7779).

![JupyterLab AYU theme](/assets/images/2020/jlab_color.jpg)

## Fixing up compilation time and binary size of xwidgets

The [xwidgets](https://github.com/jupyter-xeus/xwidgets) are the C++ counterpart to the ipywidgets. They support exactly the same functionality, but the backend is implemented in C++. The frontend, however, runs exactly the same JavaScript code in the webbrowser (that's the beauty of the widgets!).

However, we've been using some elaborate template meta-programming techniques in xwidgets which allow the code to look _quite similar_ to Python and supporting the same value semantics. This comes with a burden, though: for one,
compiled binaries are huge, and interactive execution via the xeus-cling just-in-time compiler is slow.

I have started to re-implement the core part of xwidgets, xproperty, from the ground up with some new ideas. This was partially successful, and inspired Sylvain and Johan to go back to xproperty and fix it up with the new ideas. Binary size is now cut in half, and compilation is also a little bit faster.

Still I think it could be interesting to implement xproperty in an even more dynamic way, getting rid of a lot of templates and relying fully on virtual functions.

---

All in all this was a very productive workshop. Many thanks to Jason for helping so much with the JupyterLab dynamic loading extension.

You can follow me on [↝ Twitter](https://twitter.com/@wuoulf) to stay up to date.


text:
![poster](pygame.jpg)
# _GameDev with Pygame_

In this repository, I have added basics codes of Pygame with sufficient comments as description so that anyone could know what each line doing in the background. After going through this repository, learners will be able to create cool 2D and 3D games.

# Resources
I am very much grateful to-
* [Official Documentation](https://www.pygame.org/docs/) of Pygame
* [TechwithTimm](https://www.youtube.com/playlist?list=PLzMcBGfZo4-lp3jAExUCewBfMx3UZFkh5) Youtube Channel
* [Sentdex](https://www.youtube.com/playlist?list=PLQVvvaa0QuDdLkP8MrOXLe_rKuf6r80KO) Youtube Channel
* [Freecodecamp](https://www.youtube.com/watch?v=FfWpgLFMI7w&t=292s) Youtube Channel

# License
Details can be found in [LICENSE](LICENSE)


text:
## SageMaker Notebook Instance Lifecycle Config Samples

### Overview

A collection of sample scripts to customize [Amazon SageMaker Notebook Instances](https://docs.aws.amazon.com/sagemaker/latest/dg/nbi.html) using [Lifecycle Configurations](https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html)

Lifecycle Configurations provide a mechanism to customize Notebook Instances via shell scripts that are executed during the lifecycle of a Notebook Instance.

#### Sample Scripts

* [add-pypi-repository](scripts/add-pypi-repository) - This script adds a private PyPi repository in addition to or instead of pypi.org.
* [auto-stop-idle](scripts/auto-stop-idle) - This script stops a SageMaker notebook once it's idle for more than 1 hour. (default time)
* [connect-emr-cluster](scripts/connect-emr-cluster) - This script connects an EMR cluster to the Notebook Instance using SparkMagic.
* [disable-uninstall-ssm-agent](scripts/disable-uninstall-ssm-agent) - This script disables and uninstalls the SSM Agent at startup.
* [execute-notebook-on-startup](scripts/execute-notebook-on-startup) - This script executes a Notebook file on the instance during startup.
* [export-to-pdf-enable](scripts/export-to-pdf-enable) - This script enables Jupyter to export a notebook directly to PDF.
* [install-conda-package-all-environments](scripts/install-conda-package-all-environments) - This script installs a single conda package in all SageMaker conda environments, apart from the JupyterSystemEnv which is a system environment reserved for Jupyter.
* [install-conda-package-single-environment](scripts/install-conda-package-single-environment) - This script installs a single conda package in a single SageMaker conda environment.
* [install-lab-extension](scripts/install-lab-extension) - This script installs a jupyterlab extension package in SageMaker Notebook Instance.
* [install-nb-extension](scripts/install-nb-extension) - This script installs a single jupyter notebook extension package in SageMaker Notebook Instance.
* [install-pip-package-all-environments](scripts/install-pip-package-all-environments) - This script installs a single pip package in all SageMaker conda environments, apart from the JupyterSystemEnv which is a system environment reserved for Jupyter.
* [install-pip-package-single-environment](scripts/install-pip-package-single-environment) - This script installs a single pip package in a single SageMaker conda environments.
* [install-server-extension](scripts/install-server-extension) - This script installs a single jupyter notebook server extension package in SageMaker Notebook Instance.
* [mount-efs-file-system](scripts/mount-efs-file-system) - This script mounts an EFS file system to the Notebook Instance at the ~/SageMaker/efs directory based off the DNS name.
* [mount-fsx-lustre-file-system](scripts/mount-fsx-lustre-file-system) - This script mounts an FSx for Lustre file system to the Notebook Instance at the /fsx directory based off the DNS and Mount name parameters.
* [persistent-conda-ebs](scripts/persistent-conda-ebs) - This script installs a custom, persistent installation of conda on the Notebook Instance's EBS volume, and ensures that these custom environments are available as kernels in Jupyter.
* [proxy-for-jupyter](scripts/proxy-for-jupyter) - This script configures proxy settings for your Jupyter notebooks and the SageMaker Notebook Instance.
* [publish-instance-metrics](scripts/publish-instance-metrics) - This script publishes the system-level metrics from the Notebook Instance to CloudWatch.
* [set-codecommit-cross-account-access](scripts/set-codecommit-cross-account-access) - This script sets cross-account CodeCommit access, so you can work on repositories hosted in another account.
* [set-env-variable](scripts/set-env-variable) - This script gets a value from the Notebook Instance's tags and sets it as an environment variable for all processes including Jupyter.
* [set-git-config](scripts/set-git-config) - This script sets the username and email address in Git config.

### Development

For contributors looking to develop scripts, they can be developed directly on SageMaker Notebook Instances since that is the environment that they are run with. Lifecycle Configuration scripts run as `root`, the working directory is `/`.  To simulate the execution environment, you may use

```bash
sudo su
export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
cd /
```

Edit the script in a file such as `my-script-on-start.sh` and execute it as

```bash
sh my-script-on-start.sh
```

The directory structure followed is:

```
scripts/
    my-script-name/
        on-start.sh
        on-create.sh
```

### Testing

To test the script end-to-end:

Create a [Lifecycle Configuration](https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateNotebookInstanceLifecycleConfig.html) with the script content and
a [Notebook Instance](https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateNotebookInstance.html) with the Lifecycle Configuration

```bash
# If the scripts are in a directory "scripts/my-script-name/*"
SCRIPT_NAME=my-script-name
ROLE_ARN=my-role-arn

RESOURCE_NAME="$SCRIPT_NAME-$RANDOM"

# Add any script specific options such as subnet-id
aws sagemaker create-notebook-instance-lifecycle-config \
    --notebook-instance-lifecycle-config-name "$RESOURCE_NAME" \
    --on-start Content=$((cat scripts/$SCRIPT_NAME/on-start.sh || echo "")| base64) \
    --on-create Content=$((cat scripts/$SCRIPT_NAME/on-create.sh || echo "")| base64)

aws sagemaker create-notebook-instance \
    --notebook-instance-name "$RESOURCE_NAME" \
    --instance-type ml.t2.medium \
    --role-arn "$ROLE_ARN" \
    --lifecycle-config-name "$RESOURCE_NAME"

aws sagemaker wait \
    notebook-instance-in-service \
    --notebook-instance-name "$RESOURCE_NAME"
```

* [Access](https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreatePresignedNotebookInstanceUrl.html) the Notebook Instance and perform any validation specific to the script.

```bash
aws sagemaker create-presigned-notebook-instance-url \
    --notebook-instance-name "$RESOURCE_NAME"
```

* [Stop](https://docs.aws.amazon.com/sagemaker/latest/dg/API_StopNotebookInstance.html) and [Start](https://docs.aws.amazon.com/sagemaker/latest/dg/API_StartNotebookInstance.html) the Notebook Instance

```bash
aws sagemaker stop-notebook-instance \
    --notebook-instance-name "$RESOURCE_NAME"

aws sagemaker wait \
    notebook-instance-stopped \
    --notebook-instance-name "$RESOURCE_NAME"

aws sagemaker start-notebook-instance \
    --notebook-instance-name "$RESOURCE_NAME"

aws sagemaker wait \
    notebook-instance-in-service \
    --notebook-instance-name "$RESOURCE_NAME"
```

* [Access](https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreatePresignedNotebookInstanceUrl.html) the Notebook Instance again and perform any validation specific to the script.

```bash
aws sagemaker create-presigned-notebook-instance-url \
    --notebook-instance-name "$RESOURCE_NAME"
```

File a Pull Request following the instructions in the [Contribution Guidelines](CONTRIBUTING.md).

## License Summary

This sample code is made available under the MIT-0 license. See the LICENSE file.


text:
# Metaslug

Metaslug allows you to map url to metas by locale.
You can define slug '/awesome-page' will have title 'Awesome' with other custom metas.

Metaslug uses liquid to be able to add dynamic content in the metas.

## Starting

First add the `metaslug` helper in your layout then use the install generator:

~~~
doctype html
html lang="fr"
  head
    meta charset="utf-8"
    = metaslug
~~~

~~~
bundle exec rails generate metaslug:install
~~~

It will create the `config/metaslug` folder and add an initializer.
Locale files should be presents in this directory, but there is a task to help you generating them using your defined routes.

~~~
bundle exec rails generate metaslug:locale
~~~

It will generate files like:

~~~
en:
  default:
    description: "Default description"
    title: "Default title"
  "/posts":
    description: ""
    title: ""
  "/posts/:id/edit":
    description: ""
    title: ""
~~~

This generator takes options. For example:

~~~
bundle exec rails g metaslug:locale -l de -o -m description,keywords,title
~~~

will generate a file for de locale. `-o` specifies to only print content on the console while `-m` takes your metas (defaults are title and description).

On development mode, translations are reloaded for each request, not in the other environments.

You can edit your locale file to add static or dynamic content.

~~~
en:
  default:
    description: "Default description"
    title: "Default title"
  "/my-page":
    description: ""
    title: "Title"
  "/posts/:id/edit":
    description: "Edit a post"
    title: "Edit post with title {{post.title}}"
~~~

We use liquid templates to be able to add dynamic content, based on your vars.
All you have to do is to allow methods in your model, and add allow variable in your controllers (they must be instance variable).
`metaslug_vars` is just a before_filter and can take the exact same options, like only, except…

~~~
class Post < ActiveRecord::Base
  liquid_methods :title
end
~~~

~~~
class PostsController < ApplicationController
  before_action :set_post, only: [:show, :edit, :update, :destroy]
  metaslug_vars :post, only: :edit

  private
    def set_post
      @post = Post.find(params[:id])
    end
end
~~~

## Tests

You can run the integration tests using:

~~~
bundle exec rake test
~~~

## Warning

Metaslug overrides the default render method, to be able to use dynamic metas.
We need to access the vars setted after action and interpolate them before rendering.

## Roadmap

This is what we planned to add next:

- Different storage (database, cache…)
- Web interface to edit metas from the app
- Remove rails dependency

repository: synbioz/metaslug

branch_name: refs/heads/develop

repo_name: synbioz/metaslug


text:
# lab-03-jquery
Contains files for jQuery selectors and events lab

FEATURE 1:

Number and name of feature: Display Images
Estimate of time needed to complete: 2hrs

Start time: 9:40am
Finish time: 10:40am
Actual time needed to complete: 1hr

Driver: Cory
Navigator: Jon

FEATURE 2:

Number and name of feature: Filter images
Estimate of time needed to complete: 2hrs

Start time: 11:00am
Finish time: 6:30pm
Actual time needed to complete: 4 hours

Driver: Jon
Navigator: Cory

Feature 3:

Number and name of feature: Pagination
Estimate of time needed to complete: 2hrs

Start time: 11:00am
Finish time:
Actual time needed to complete:

Driver: Jon
Navigator: Cory

gha_language: JavaScript


text:
# apk_verifier
Help to verify android APK file installation ( Defold Game Engine NE )

via only two methods :

• get_package_name() return string for compare with project package name

• is_installed_from_market() return bool for check play market installation

For use add "https://github.com/FamilyAge/apk_verifier/archive/master.zip" into game.project dependencies


text:
# MAC spoof

Spoof your MAC address the old fasion way using already built in linux commands.

### Requirements

- OpenSSL

### Installation

    bash < <( curl https://raw.github.com/jacobbednarz/mac-spoof/master/install )

### Usage

    sudo mac-spoof wlan0

repository: jacobbednarz/mac-spoof

repo_name: jacobbednarz/mac-spoof


text:
---
layout: about
title: about
permalink: /
subtitle:

profile:
  align: right
  image: pfp.png
  image_circular: false # crops the image to make it circular
  address: >

Located in California, USA

news: true  # includes a list of news items
selected_papers: false # includes a list of papers marked as "selected={true}"
social: true  # includes social icons at the bottom of the page
---

Hi there! I'm Bryant Duong, a Senior Software Engineer at [Optum](https://www.optum.com/), part of UnitedHealth Group. In summer 2023, I interned at the National Institutes of Health, conducting bioinformatics [research](https://bryantduong.github.io/projects/3_project/) in Dr. Zhiyong Lu's lab. Between 2015-2017, I worked at the National Security Agency as a [Stokes Scholar](https://federaljobs.net/blog/the-stokes-educational-scholarship-program-nsa/). I'm currently interested in exploring more research projects in healthcare and bioinformatics.

I'm also pursuing a Master's in [Computer and Information Technology](https://online.seas.upenn.edu/degrees/mcit-online/) at the [University of Pennsylvania](https://www.upenn.edu/). The MCIT program, tailored for individuals with unique educational backgrounds like mine, blends undergraduate Computer Science with graduate-level courses. My academic journey also includes an MBA from [UC Davis](https://gsm.ucdavis.edu/) and a BA in Cognitive Science from [UC Berkeley](https://cogsci.berkeley.edu/).

Outside of work, I'm passionate about mentoring. I've guided over 30 junior engineers and students, both within and outside my company, on a range of topics—from software engineering best practices to optimizing 1:1 manager meetings. Reading sci-fi novels and collecting anime cels/sketches that led to animation production are other pastimes I cherish.


text:
A very simple viewer/editor for LIUM speaker diarizations.

# Installation

    pip install lium-diarization-editor

# Usage

The package provides the command `lium-dia-edit`:

    Usage: lium-dia-edit [OPTIONS]

      View or edit a diarization.

    Options:
      -a, --audio TEXT        Load an audio file belonging to the diarization.
      -d, --dia TEXT          A LIUM diarization file.
      -p, --pickled-dia TEXT  A pickled diarization, as created using the --save
                              option.
      -s, --save TEXT         Where to save the diarization (as pickle) when
                              pressing "s".
      --help                  Show this message and exit.

Within the editor, use the following keys to do stuff:

| Key        | Function                                    |
|------------|---------------------------------------------|
| space      | play/pause                                  |
| left/right | 10s backward/forward                        |
| p/n        | previous/next segment                       |
| m          | next unmoderated segment                    |
| l          | limit playback to current speaker           |
| s          | save diarization                            |
| u          | undo last change                            |
| home       | go to beginning                             |
| 0-9        | change speaker of current segment to M<0-9> |

# Contributing

* Install [pipenv](https://pipenv.readthedocs.io/en/latest/)
* Fork and clone the [repository](https://github.com/maxhollmann/lium-diarization-editor)
* In the repository, run `pipenv install --dev` to install required packages and the package itself into a virtualenv
* To activate the virtualenv, run `pipenv shell`
* Make changes, commit, push
* Create a pull request

repository: maxhollmann/lium-diarization-editor

repo_name: maxhollmann/lium-diarization-editor


text:
# Audit Logs

-   **[Viewing Audit Logs of Key Operations on the Management Console](viewing-audit-logs-of-key-operations-on-the-management-console.md)**

-   **[Configuring the Database Audit Log](configuring-the-database-audit-log.md)**

repository: Polina-Gubina/docs

repo_name: Polina-Gubina/docs


text:
# CHANGELOG

All notable changes to this project will be documented in this file.

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

## [Unreleased]
### Added
* *Nothing*

### Changed
* Update dependencies.
* Migrate to shlink reusable workflows.

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*

## [2.2.0] - 2023-04-20
### Added
* *Nothing*

### Changed
* [#44](https://github.com/acelaya/react-external-link/issues/44) Migrate to vite for bundling.
* [#45](https://github.com/acelaya/react-external-link/issues/45) Migrate to vitest for testing.

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*

## [2.1.0] - 2023-02-19
### Added
* *Nothing*

### Changed
* Update dependencies

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*

## [2.0.1] - 2023-01-03
### Added
* *Nothing*

### Changed
* *Nothing*

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* Ensured provided `rel` attribute does not overwrite `noopener noreferrer`, but it's appended instead.

## [2.0.0] - 2022-05-12
### Added
* *Nothing*

### Changed
* `ExternalLink` props now extend `AnchorHTMLAttributes<Element>`.
* Updated dependencies, including Jest 28.

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*

## [1.3.0] - 2022-04-02
### Added
* Added support for React 18

### Changed
* Updated to shlink coding standard 2.0

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*

## [1.2.2] - 2021-07-07
### Added
* *Nothing*

### Changed
* *Nothing*

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* [#30](https://github.com/acelaya/react-external-link/issues/30) Fixed wrong generation of definition types before publishing.

## [1.2.1] - 2021-03-05
### Added
* *Nothing*

### Changed
* *Nothing*

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* [#21](https://github.com/acelaya/react-external-link/issues/21) Fixed linting by updating to `@shlinkio/eslint-config-js-coding-standard` as the coding style.

## [1.2.0] - 2020-12-19
### Added
* *Nothing*

### Changed
* [#16](https://github.com/acelaya/react-external-link/issues/16) Migrated build to Github Actions.
* [#17](https://github.com/acelaya/react-external-link/issues/17) Migrated release publishing to Github Actions.
* [#18](https://github.com/acelaya/react-external-link/issues/18) Migrated to Codecov as coverage backend.
* [#19](https://github.com/acelaya/react-external-link/issues/19) Updated dependencies.

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*

## [1.1.0] - 2019-09-03
### Added
* [#2](https://github.com/acelaya/react-external-link/issues/2) Added travis config and enabled project builds.
* [#1](https://github.com/acelaya/react-external-link/issues/1) Added tests which are run as part of the build.
* [#5](https://github.com/acelaya/react-external-link/issues/5) Project added to scrutinizer.
* [#3](https://github.com/acelaya/react-external-link/issues/3) Automated package releases.

### Changed
* [#6](https://github.com/acelaya/react-external-link/issues/6) Changed coding styles to adidas coding styles.

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*

## [1.0.1] - 2019-08-29
### Added
* *Nothing*

### Changed
* *Nothing*

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* Fixed typescript interface not accepting any extra props in `ExternalLink`

## [1.0.0] - 2019-08-28
### Added
* First stable release

### Changed
* *Nothing*

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* *Nothing*

repository: acelaya/react-external-link

gha_language: TypeScript

repo_name: acelaya/react-external-link