text:
# Cutting a CLI Release

The Exercism CLI uses [GoReleaser](https://goreleaser.com) to automate the
release process.

## Requirements

1. [Install GoReleaser](https://goreleaser.com/install/)
1. [Install snapcraft](https://snapcraft.io/docs/snapcraft-overview)
1. [Setup GitHub token](https://goreleaser.com/environment/#github-token)
1. Have a gpg key installed on your machine - it is [used for signing the artifacts](https://goreleaser.com/sign/)

## Cut a release

```bash

# Test run
goreleaser --skip-publish --snapshot --rm-dist

# Commit any changes, then create a new tag and push it
git tag -a v3.0.16 -m "Trying out GoReleaser"
git push origin v3.0.16

# Build and release
goreleaser --rm-dist

# Remember to update cmd/version.go in the code
# (until we use: https://goreleaser.com/environment/#using-the-main-version)

# You must be logged into snapcraft to publish a new snap
snapcraft login

# Push to snapcraft
for f in `ls dist/*.snap`; do snapcraft push --release=stable $f; done

# [TODO] Push to homebrew

# Run [exercism-cp-archive-hack.sh](https://gist.github.com/ekingery/961650fca4e2233098c8320f32736836) which takes the new archive files and renames them to match the old naming scheme for backward compatibility.
```

Lastly, head to [the release page](https://github.com/exercism/cli/releases) to test and publish the draft. Until mid to late 2020, we will need to manually upload the backward-compatible archive files generated in `/tmp/exercism_tmp_upload` by the shell script referenced above.

## Confirm / Update the Changelog

GoReleaser supports [auto generation of changelog](https://goreleaser.com/customization/#customize-the-changelog) that we will want to customize to meet our standards (not including refactors, test updates, etc). We should also consider [the release notes](https://goreleaser.com/customization/#custom-release-notes).

Make sure all the recent changes are reflected in the "next release" section
of the Changelog. Make this a separate commit from bumping the version.

You can view changes using the /compare/ view:
https://github.com/exercism/cli/compare/$PREVIOUS_RELEASE...master

## Bump the version

Edit the `Version` constant in `cmd/version.go`, and edit the Changelog.

All the changes in the "next release" section should be moved to a new section
that describes the version number, and gives it a date.

The "next release" section should contain only "Your contribution here".

_Note: It's useful to add the version to the commit message when you bump it: e.g. `Bump version to v2.3.4`._

In the future we will probably want to replace the hardcoded `Version` constant with [main.version](https://goreleaser.com/environment/#using-the-main-version). Here is a [stack overflow post on injecting to cmd/version.go](https://stackoverflow.com/a/47510909).

A draft will have been auto-generated by GoReleaser. Describe the release, select a specific commit to target, paste the release text and describe the new changes.

```
To install, follow the interactive installation instructions at https://exercism.io/cli-walkthrough
---

[describe changes in this release]

```

## Update Homebrew

This is helpful for the (many) Mac OS X users.

First, get a copy of the latest tarball of the source code:

```
cd ~/tmp && wget https://github.com/exercism/cli/archive/vX.Y.Z.tar.gz
```

Get the SHA256 of the tarball:

```
shasum -a 256 vX.Y.Z.tar.gz
```

Update the homebrew formula:

```
cd $(brew --repository)
git checkout master
brew update
brew bump-formula-pr --strict exercism --url=https://github.com/exercism/cli/archive/vX.Y.Z.tar.gz --sha256=$SHA
```

For more information see their [contribution guidelines](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged).

## Update the docs site

If there are any significant changes, we should describe them on
[exercism.io/cli]([https://exercism.io/cli).

The codebase lives at [exercism/website-copy](https://github.com/exercism/website-copy) in `pages/cli.md`.

repository: ekingery/cli

repo_name: ekingery/cli


text:
In this hands on, you are going to validate the form data that was submitted and output any problems that might have occurred. We will access data from the form scope.

**Tags Used**: [\<cfset>](https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-r-s/cfset.html), [\<cfif>](https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-i/cfif.html)

**Functions Used**: [len](https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-l/len.html)

1. Locate the comment that says `Message Output` in the `/www/contact.cfm` file and remove all the code that is inside the `<cfif>` tag just below it.
1. Inside the `<cfif>` tag create a variable called `OK` and set it to true.
1. Below the `<cfset>`, create a `<cfif>` statement that checks if the length of the value of `form.contactname` is equal to 0. To do that, use a function called `len()` which will return the number of characters in the provided string. Your code should look similar to this:

        <cfset ok = true />

        <cfif len(form.contactname) eq 0>

        </cfif>

1. Inside the `<cfif>` statement, set the `OK` variable to false.
1. You should end up with code similar to this:

        <cfset ok = true />

        <cfif len(form.contactname) eq 0>
            <cfset ok = false />
        </cfif>

1. Create `<cfif>` statements for the email and message fields in the form.
1. After the last `<cfif>` statement, create a new `<cfif>` statement that checks if the `OK` value is equal to false. If it is equal to false, output the following:

You did not provide all the required information!

1. Your final block of code should look similar to this:

        <cfif form.submitted>
            <cfset ok = true />

            <cfif len(form.contactname) eq 0>
                <cfset ok = false />
            </cfif>

            <cfif len(form.email) eq 0>
                <cfset ok = false />
            </cfif>

            <cfif len(form.message) eq 0>
                <cfset ok = false />
            </cfif>

            <cfif ok eq false>

You did not provide all the required information!

            </cfif>
        </cfif>

1. Reload the `contact.cfm` page in your browser and click 'submit'. You should see the message "You did not provide all the required information!" displayed.
1. Fill in all the fields in the form and click 'submit'. You will notice that the message does not display.

repository: dfgrumpy/learncfinaweek

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

license_type: permissive

repo_name: dfgrumpy/learncfinaweek


text:
# [ALERT] Deprecated !!
> The package is deprecated because Laravel Password has a native implementaion since [version 9.0](https://github.com/laravel/passport/releases/tag/v9.0.0)

# Laravel Passport Multi-Auth

[![Latest Stable Version](https://poser.pugx.org/smartins/passport-multiauth/v/stable)](https://packagist.org/packages/smartins/passport-multiauth)
[![Build Status](https://travis-ci.org/sfelix-martins/passport-multiauth.svg?branch=6.x)](https://travis-ci.org/sfelix-martins/passport-multiauth)
[![Code Coverage](https://scrutinizer-ci.com/g/sfelix-martins/passport-multiauth/badges/coverage.png?b=7.x)](https://scrutinizer-ci.com/g/sfelix-martins/passport-multiauth/?branch=7.x)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/sfelix-martins/passport-multiauth/badges/quality-score.png?b=7.x)](https://scrutinizer-ci.com/g/sfelix-martins/passport-multiauth/?branch=7.x)
[![StyleCI](https://styleci.io/repos/106218586/shield?branch=6.x)](https://styleci.io/repos/106218586)
[![License](https://poser.pugx.org/smartins/passport-multiauth/license)](https://packagist.org/packages/smartins/passport-multiauth)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AEXFGV23MM386&source=url)

Add multi-authentication support to [Laravel Passport](https://laravel.com/docs/5.5/passport)

## Upgrading from 4.0 to 5.0

- To upgrade from version 4.0 to 5.0 folow [this guide](https://github.com/sfelix-martins/passport-multiauth/blob/5.0/UPGRADE.md)

## Upgrading from 2.0 to 3.0

- To upgrade from version 2.0 to 3.0 folow [this guide](https://github.com/sfelix-martins/passport-multiauth/blob/3.0/UPGRADE.md)

## Upgrading from 1.0 to 2.0

- To upgrade from version 1.0 to 2.0 follow [this guide](https://github.com/sfelix-martins/passport-multiauth/blob/2.0/UPGRADE.md)

## Compatibility

| Laravel Passport |
|------------------|
| ^5.0             |
| ^6.0             |
| ^7.0             |
| ^8.0             |

| Laravel Framework  | Passport MultiAuth |
|--------------------|--------------------|
| <= 5.6             | <= 3.0             |
| 5.7.x              | 4.0.x              |
| >= 5.7.x  <= 5.8.x | 5.0.x              |
| 6.x                | 6.x                |
| 7.x                | 7.x                |

## Installing and configuring

Install using composer:

```sh
$ composer require smartins/passport-multiauth
```

To all works fine, we need to ensure that the `SMartins\PassportMultiauth\Providers\MultiauthServiceProvider::class` service provider
be registered before `Laravel\Passport\PassportServiceProvider::class`.

Firstly, you will remove the `laravel/passport` package from Laravel [Package Discovery](https://laravel.com/docs/5.8/packages#package-discovery).

In your `composer.json` file, add the `laravel/passport` to `extra.laravel.dont-discover` array:

```json
    "extra": {
        "laravel": {
            "dont-discover": [
                "laravel/passport"
            ]
        }
    },
```

And register the providers manually on `config/app.php`:

```php
    'providers' => [
        // ...
        SMartins\PassportMultiauth\Providers\MultiauthServiceProvider::class,
        Laravel\Passport\PassportServiceProvider::class,
    ],
```

**WARNING:** The provider `SMartins\PassportMultiauth\Providers\MultiauthServiceProvider::class` MUST be added before `Laravel\Passport\PassportServiceProvider::class` to it works fine.

Maybe you will need clear the bootstrap cache files to re-register the providers:

```sh
php artisan optimize:clear
```

Migrate database to create `oauth_access_token_providers` table:

```sh
$ php artisan migrate
```

**NOTE** If you don't ron the command to install passport run:

```sh
$ php artisan passport:install
```

Instead of using the `Laravel\Passport\HasApiTokens` trait from [Laravel Passport](https://laravel.com/docs/5.6/passport#installation) core, use the trait `SMartins\PassportMultiauth\HasMultiAuthApiTokens`.

Internally, this `HasMultiAuthApiTokens` uses the `HasApiTokens`, overriding the methods `tokens()` and `createToken($name, $scopes = [])`.
The behavior of the method `tokens()` was changed to join with the table `oauth_access_token_providers` getting just the tokens created
to specific model.
The method `createToken($name, $scopes = [])` was changed to create the token using the `provider` defined to model on `config/auth.php`.
Now when you create the token, this token will be related with the model that is calling.

Add new provider in `config/auth.php` using a model that extends of `Authenticatable` class and use `HasMultiAuthApiTokens` trait.

Example:

Configure your model:

```php

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use SMartins\PassportMultiauth\HasMultiAuthApiTokens;

class Admin extends Authenticatable
{
    use Notifiable, HasMultiAuthApiTokens;
}

```

And your `config/auth.php` providers:

```php
    // ...

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],

        // ** New provider**
        'admins' => [
            'driver' => 'eloquent',
            'model' => App\Admin::class,
        ],
    ],

    // ...
```

Add a new `guard` in `config/auth.php` guards array using driver `passport` and the provider added above:

```php
    // ...

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'passport',
            'provider' => 'users',
        ],

        // ** New guard **
        'admin' => [
            'driver' => 'passport',
            'provider' => 'admins',
        ],
    ],

    // ...
```

Register the middleware `AddCustomProvider` to `$routeMiddleware` attributes on `app/Http/Kernel.php` file.

```php

class Kernel extends HttpKernel
{
    // ...

    /**
     * The application's route middleware.
     *
     * These middleware may be assigned to groups or used individually.
     *
     * @var array
     */
    protected $routeMiddleware = [
        // ...
        'oauth.providers' => \SMartins\PassportMultiauth\Http\Middleware\AddCustomProvider::class,
    ];

    // ...
}
```

**OBS:** The param `provider` is required to routes wrapped by `AddCustomProvider` middleware.
You must to pass a valid provider configured on `config/auth.php`.

Add new middleware `Authenticate` on `app/Http/Kernel` `$routeMiddleware` attribute.

```php

class Kernel extends HttpKernel
{
    // ...

    /**
     * The application's route middleware.
     *
     * These middleware may be assigned to groups or used individually.
     *
     * @var array
     */
    protected $routeMiddleware = [
        'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
        // ** New middleware **
        'multiauth' => \SMartins\PassportMultiauth\Http\Middleware\MultiAuthenticate::class,
        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
        'can' => \Illuminate\Auth\Middleware\Authorize::class,
        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
        'oauth.providers' => \SMartins\PassportMultiauth\Http\Middleware\AddCustomProvider::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
    ];

    // ...
}
```

Encapsulate the passport routes for access token with the registered middleware in `AuthServiceProvider`.
This middleware will add the capability to `Passport` route `oauth/token` use the value of `provider` param on request:

```php
namespace App\Providers;

use Route;
use Laravel\Passport\Passport;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
    // ...

    /**
     * Register any authentication / authorization services.
     *
     * @return void
     */
    public function boot()
    {
        $this->registerPolicies();

        Passport::routes();

        // Middleware `oauth.providers` middleware defined on $routeMiddleware above
        Route::group(['middleware' => 'oauth.providers'], function () {
            Passport::routes(function ($router) {
                return $router->forAccessTokens();
            });
        });
    }
    // ...
}
```

**Optional:** Publish migrations:

Just run the `vendor:publish` artisan command with package provider as parameter:

```sh
$ php artisan vendor:publish --provider="SMartins\PassportMultiauth\Providers\MultiauthServiceProvider"
```

If you are not going to use PassportMultiauth's default migrations, you should call the `SMartins\PassportMultiauth\PassportMultiauth::ignoreMigrations` method in the register method of your AppServiceProvider.

## Usage

Add the `provider` parameter in your request at `/oauth/token`:

```http
POST /oauth/token HTTP/1.1
Host: localhost
Accept: application/json, text/plain, */*
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache

{
<EMAIL_ADDRESS>    "password":"password",
    "grant_type" : "password",
    "client_id": "client-id",
    "client_secret" : "client-secret",
    "provider" : "admins"
}
```

You can pass your guards on `multiauth` middleware as you wish. Example:

```php
Route::group(['middleware' => ['api', 'multiauth:admin']], function () {
    Route::get('/admin', function ($request) {
        // Get the logged admin instance
        return $request->user(); // You can use too `$request->user('admin')` passing the guard.
    });
});

```

The  `api` guard use is equals the example with `admin`.

You can pass many guards to `multiauth` middleware.

```php
Route::group(['middleware' => ['api', 'multiauth:admin,api']], function () {
    Route::get('/admin', function ($request) {
        // The instance of user authenticated (Admin or User in this case) will be returned
        return $request->user();
    });
});
```

You can use too the `Auth` facade:

```php
Auth::check();
Auth::user();
```

### Refreshing tokens

Add the `provider` parameter in your request at `/oauth/token`:

```http
POST /oauth/token HTTP/1.1
Host: localhost
Accept: application/json, text/plain, */*
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache

{
    "grant_type" : "refresh_token",
    "client_id": "client-id",
    "client_secret" : "client-secret",
    "refresh_token" : "refresh-token",
    "provider" : "admins"
}
```

### Using scopes

Just use the [`scope` and `scopes`](https://laravel.com/docs/5.5/passport#checking-scopes) middlewares from `Laravel\Passport`.

```php
protected $routeMiddleware = [
    'scopes' => \Laravel\Passport\Http\Middleware\CheckScopes::class,
    'scope' => \Laravel\Passport\Http\Middleware\CheckForAnyScope::class,
];
```

### Personal Access Tokens

In your model that uses the trait `SMartins\PassportMultiauth\HasMultiAuthApiTokens` you can uses the methods `createToken($name, $scopes = [])` and `tokens()` to manage your personal access tokens. E.g.:

```php

$user = User::find(1);
$admin = Admin::find(1);

// Create token from Model instance.
$user->createToken('My Token');
$admin->createToken('My Admin Token');

// Get the tokens created to this user.
$user->tokens()->each(function ($token) {
    echo $token->name; // My Token
});

$admin->tokens()->each(function ($token) {
    echo $token->name; // My Admin Token
});
```

### Known Issues

To all works correctly you must use the default guard `web` on `config/auth.php`. E.g.:

```php
    'defaults' => [
        'guard' => 'web',
    ],
```

Exists an opened [issues](https://github.com/sfelix-martins/passport-multiauth/issues/63) that will be analysed ASAP.

### Unit tests

Instead to use the `Laravel\Passport\Passport::actingAs()` method, use `SMartins\PassportMultiauth\PassportMultiauth::actingAs()`.
The difference is that the `actingAs` from this package get the guard based on `Authenticatable` instance passed on first parameter and authenticate this user using your guard. On authenticated request (Using `auth` middleware from package -  `SMartins\PassportMultiauth\Http\Middleware\MultiAuthenticate)` the guard is checked on `Request` to return the user or throws a `Unauthenticated` exception. E.g.:

```php
use App\User;
use Tests\TestCase;
use SMartins\PassportMultiauth\PassportMultiauth;

class AuthTest extends TestCase
{
    public function fooTest()
    {
        $user = factory(User::class)->create();

        PassportMultiauth::actingAs($user);

        $this->json('GET', 'api/user');
    }

    public function withScopesTest()
    {
        $user = factory(User::class)->create();

        PassportMultiauth::actingAs($user, ['see-balance']);

        $this->json('GET', 'api/balance');
    }
}
```

### Sample Project

You can see a complete `Passport-Multiauth` implementation using `Password Grant Tokens` and `Personal Access Token` on [passport-multiauth-demo](https://github.com/sfelix-martins/passport-multiauth-demo) project

### Contributors

Based on [renanwilian](https://github.com/renanwilliam) responses to [Passport Multi-Auth issue](https://github.com/laravel/passport/issues/161).

license: MIT

repository: sfelix-martins/passport-multiauth

gha_language: PHP

gha_license_id: MIT

repo_name: sfelix-martins/passport-multiauth


text:
# Changelog
## 3.1.0 2023-04-04
## MANY UPDATES & FIXES
Improved Default Clustering
- Default Variational Autoencoder Embeddings + Contour
- Countour parameters only still available (was called: k-means)
- Improved image normalization
- Fixed Cluster Label Issue

Updated Clustering Window
- Removed frequency visualization
- Right click to change clusters

Improved TSNE/UMAp visualization

Added File Name to Excel Batch Output

Checks for File Changes Before Save

## 3.0.4 2022-07-27
## Supervised Clustering Bug Fix
- Fixed an issue where supervised clustering was crashing

## 3.0.3 2022-06-07
## MAJOR BUG FIX - PLEASE DOWNLOAD
- Temporary fix to a bug where cluster assignments weren't correct when clustering files with rejected calls.
- If you want to cluster all calls except rejected calls, be sure to delete rejected calls before clustering.
- Permanent fix incoming, but for now saved cluster assignments will at least match up with the clustering window.

## 3.0.2 2022-03-21
## v3 More Bug Fixes
- Fixed automatic spectrogram scaling issues
- Fixed GUI Axes

## 3.0.1 2021-08-08
## v3 Bug Fixes
- Batch Reject By Threshold Fix
- Export Audio Fix
- Export Spectrogram Fix

## 3.0 2021-07-23

## Main Upgrades
- Brand New YOLO V2 based Detection Architechture
- Navigate Entire Audio Files to Quickly & Easily Refine Detections or Add New Boxes
- Retrain Existing Networks With Your Own Recordings
- Manually add calls not detected by Faster-RCNN.
- Start From Scratch: Hand Box Calls and Train a New Species Detector
- Improved automatic contour extraction
- Contour Invarient Clustering With Variational Auto Encoders
- Upgraded clustering GUI
- Additional "page" spectogram with a larger time window for call contextualization.
- Record Audio Directly in DeepSqueak

## New Navigation Controls
- Click on the lower page spectrogram to jump to that position in the upper "focus" view.
- Click a location on the map bar to jump to that location in the file.
- Up and down arrow keys to slide the focus window forward or backward
- Right click on a detection to remove it.
- Control-click or double click on a detection to change it's label
- Select, move, and modify ROIs of detected calls:

## Minor Upgrades
- Constant time and spectrogram scales.
- Display either spectral amplitude of power spectral density
- Possibility to modify time and spectrogram scales, Focus (upper spectrogram), Page (lower spectrogram).
- Sonic Visualizer export/import.
- Fully compatible with older DeepSqueak detections files.
- Invertible colormaps.
- GUI tweaks.

## Credits:
**Original DeepSqueak**: Coffey, K., Marx, R., & Neumaier, J.<br>
**Screener**: Lara-Valderrábano, L. and Ciszek, R.

## 2.6.2 2020-08-03

Modifications to increase contributor and community engagement
 - New [Community Hub on Gitter](https://gitter.im/DeepSqueak_Community)
 - New [DeepSqueak Twitter](https://twitter.com/DeepSqueak_USV)
 - New Contributor Guidlines
 - New Contributor Code of Conduct
 - New Background Image!

Minor bug fixes

## 2.6.1 2019-07-16

Fixed bug when importing call classifications from Raven .txt files.
  - DeepSqueak will now look for a column called 'Tags'.
  - If the 'Tags' column doesn't exist, DeepSqueak will use the 'Annotation' column.
  - If the 'Annotation' column doesn't exist, the category will be set to 'USV' by default.

Fixed issue when calls file is empty in unsupervised clustering.

## 2.6.0 2019-04-17

Improved the accuracy of the post-hoc denoising network.

Improved Call classification
  - Included a newly trained supervised classifier based on Wright et al.'s rat USV categories.
  - Included a k-means model from human-selected exemplar calls, based on Wright et al.'s rat USV categories.
  - Supervised network training now trains from the region of the spectrogram contained within the box, rather than a constant frequency range. This might make old networks incompatible.
  - Automatically merge clusters with the same names but different case.

t-SNE plots now have the option to assign colors by call classification, rather than call pitch. If coloring by classification, you must load detection files, rather than pre-extracted contours. This requires call files that have already been classified, either manually, or by supervised/unsupervised classification.

Added better support for non-ultrasonic animals, such as zebras.

## 2.5.0 2019-03-04
Fixed possible bug when updating files after clustering.

Made syntax analysis compatible with exported excel files.

Generally cleaned the code.

Made box merging much faster, detected audio is now always stored ad 16-bit.

K-means clustering models are now saved with the cluster names, so that when clustering with an existing model, the names don't need to be re-entered.

Improved the "Tools > Automatic Review > Batch Reject by Threshold" menu to allow for more permutations of score, duration, tonality, frequency, power, and category.

Detection files are now tables instead of structures. Everything should be backwards compatible.

## 2.4.1 2019-03-01
Updated threshold rejection to use power instead of amplitude.

Added buttons to sort calls by frequency and duration.

Improved support for multichannel audio by taking the mean of all audio channels.
Alternatively, a max intensity projection can be applied to the audio, or a single channel can be used.
See line 79 of SqueakDetect.m for details.

## 2.3.0 2019-02-20
Detection is now no longer limited to two Networks.

Improved separation of densely packed calls.

## 2.2.0 2019-01-25

Drastically improved detection of low signal vocalizations!
- New slider to set precision to recall tradeoff
- When slider is set to high precision, USV detection will be fast and accurate but may miss some quiet calls
- When slider is set to high recall, USV detection is slightly slower but will detect even extremely low signal calls
- When slider is set to high recall, DeepSqueak will likely detect more noise
- Default slider position is in the middle, and balances both approaches

Added a link to the "Issues" section of our GitHub in the Help Menu

Included a pdf of the published paper

## 2.1.2 2019-01-14
Multichannel audio no longer breaks DeepSqueak.
If audio files have more than one channel, only the first channel is used.

Added support for more categories for manual call classification

Added a function to set the upper and/or lower frequency of each call to a constant value. Located under "Tools > Automatic Review > Set Static Box Height".

## 2.1.0 2019-01-03
Call power is now calculated as power spectral density (units are dB/Hz), rather than amplitude.

Switch KHz to kHz

Added support for .wmf files

## 2.0.2 2018-12-31
Fixed issue when the first samples in an audio file contain calls

## 2.0.1 2018-12-18
Fixed minor bugs in 2.0 release

## 2.0.0 2018-12-14
**DeepSqueak 2.0**
```
 (                   (
 )\ )                )\ )                      )      )     )
(()/(    (   (      (()/(  (    (    (    ) ( /(   ( /(  ( /(
 /(_))  ))\ ))\`  )  /(_)( )\  ))\  ))\( /( )\())  )(_)) )\())
(_))_  /((_/((_/(/( (_)) )(( )/((_)/((_)(_)((_)\  ((_)  ((_)\
 |   \(_))(_))((_)_\/ __((_)_(_))((_))((_)_| |(_) |_  ) /  (_)
 | |) / -_/ -_| '_ \\__ / _` | || / -_/ _` | / /   / / | () |
 |___/\___\___| .__/|___\__, |\_,_\___\__,_|_\_\  /___(_\__/
              |_|          |_|
```

**Major Improvements to Speed**
 * DeepSqueak now detects at 20x - 40x
 * Speed improvements come from optimized spectrogram settings and network architechture

**Improved Networks**
 * New All Short Calls Network for detecting rat and mouse call with the same network
 * New Mouse Short Call Network
 * New Rat Short Call Network
 * New Long Rat call Network
 * New Post-Hoc Denoising Network
 * New Wright Category Classification Network

**Automatic Audio Scaling**
 * Gain setting is removed and instead DeepSqueak will automatically scale all audio to the proper volume for detection

**Simplified Network Training**
 * Netowork training only works in 2018a (currently working with Matlab to find the problem with faster-RCNN in 2018b)

**Various minor quality of life improvements**

## 1.1.9 2018-12-5
Fixed bug in k-means feature weighting

Added tool to create t-sne image of calls. "Tools -> Call Classification -> Create t-sne"

## 1.1.8 2018-11-30
Added figure with cluster exemplars for k-means clustering

Calls in the clustering GUI are now sorted by how well they match the cluster

## 1.1.7 2018-11-27
Various bug Fixes

Improved syntax analyses

DS now checks to see if a newer version is online

## 1.1.6 2018-11-19
Fixed error in importing files from Ultravox.

Fixed error when simultaneously detecting with multiple networks.

## <IP_ADDRESS> 2018-11-16
Changed export audio so that all audio is exported, not just what's in the boxes.

Improved file names in export spectrogram and export audio.

## <IP_ADDRESS> 2018-11-15
Fixed bug in kmeans optimization by removing dependency on export_fig

## 1.1.5 2018-11-7
Probably fixed unix compatibility by changes slashes to ones that one on both windows and unix.

Fixed error in export to excel, when filenames were cut off when the name contained periods.

When creating training images, augmented duplicates are now created in addition to, rather than instead of the original.
 - Reduced the amount of white noise augmentation
 - Fixed incorrect file path for training tables

Added manifestos.

## 1.1.4 2018-11-1
Switched most file saving to "fullfile" function, rather than concatinating strings.

Made detection files smaller by saving the audio as the native format, rather than double.

Saved files now include metadata such as detection time, settings, audio file path, and detection network.

## 1.1.3 2018-10-23
Added k-means optimization into unsupervised clustering, using the knee method. When using k-means, their is now an option to enter the number of means, or try many different means and select the one at the knee point.

Improved data preperation for unsupervised clustering. Now, paramaters include duration, slope, and frequency. Each each call is split into eight chunks, and each parameter is calculated for each chunk. Users can define the paramater weights to optimize cluster quality.

## 1.1.2 2018-9-28
Users can now set the time scale on the spectrogram to a constant value, in the "Update Display Range" menu.

Added amplitude (power) to k-means clustering. Each call is split into chunks, and the power from each chunk is put into k-means.

K-means clustering breaks the contours into chunks, which are are now equally spaced in time, rather than removing gaps in time.

## 1.1.1 2018-9-27
Added the ability to accept or reject calls based on score, power, and tonality, in batches.

Added tonality slider, so users can easily adjust tonality.
 - Changed default tonality to 0.3, made amplitude threshold 0 by default

The gradient display now only displays the verticle gradient, which better represents how tonality is calculated.

Updating the display is now significantly faster, because the data in the existing figures is updated rather than being redrawn.

During detection, boxes are padded slightly, to make contour detection better.

## 1.0.5 2018-9-12
Added a new rat call detection network
 - Trained with the new options in <IP_ADDRESS>

SqueakDetect now subtracts the 5th percentile from the spectrogram across the temporal dimension.
 - This increases detection accuracy by filtering out noise bands from low quality microphones.
## <IP_ADDRESS> 2018-9-10
Added option to specify the range for amplitude augmentation

## 1.0.4 - 2018-9-5
Added data augmentation for training new networks
 - When using "Create Training Images", each image will now be augmented with a random level of white noise, and multiplied by a random gain factor. This substantially increases detection accuracy across different microphones and recording gain.

repository: DrCoffey/DeepSqueak

gha_language: MATLAB

repo_name: DrCoffey/DeepSqueak


text:
---
layout: default
title: ""
---
## Fearlessly Improving Legacy Code or: How I Learned to Stop Worrying and Love Dreadful Code
_PhillyXP • November 15, 2022 • Virtual_

Thanks for joining my talk at PhillyXP about how to Fearlessly Improve Legacy Code. You'll find links to any of the resources I discussed in the talk on this page.

### Video

### Slide Deck

### Talk References

Here is a list of all of the articles and videos I referenced in my talk:

* [Characterization Tests](https://en.wikipedia.org/wiki/Characterization_test) - wikipedia
* [Characterization Testing](https://michaelfeathers.silvrback.com/characterization-testing) - Michael Feathers
* [Taylorism](https://en.wikipedia.org/wiki/Scientific_management) - wikipedia
* [History of the Gantt Chart](https://en.wikipedia.org/wiki/Gantt_chart) - wikipedia
* [Theory X and Theory Y Management](https://en.wikipedia.org/wiki/Theory_X_and_Theory_Y) - wikipedia
* [Low of Holes](https://en.wikipedia.org/wiki/Law_of_holes) - wikipedia
* [Claude Shannon's Problem Solving Process](https://www.businessinsider.com/engineer-claude-shannon-problem-solving-process-2017-7) - Business Insider
* [The Core Six Refactorings](https://arlobelshee.com/the-core-6-refactorings/) - Arlo Belshee
* [Approval Tests](https://approvaltests.com/)
* [Writing Characterization Tests - Agile in a Flash](https://agileinaflash.blogspot.com/2009/02/writing-characterization-tests.html) - Tim Ottinger & Jeff Langr
* [Code Coverage Complications - Industrial Logic Blog](https://www.industriallogic.com/blog/code-coverage-complications/) - Anthony Sciamanna

### Books
Here are the books I've referenced in the talk:
* [Working Effectively with Legacy Code](https://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052/) - Michael Feathers
* [Accelerate](https://www.amazon.com/Accelerate-Software-Performing-Technology-Organizations/dp/1942788339/) - Dr. Nicole Forsgren, Jez Humble & Gene Kim

### Industrial Logic eLearning
I referenced the Industrial Logic Legacy Code eLearning album in the talk. If you want to learn more about what we offer you can [check it out here](https://www.industriallogic.com/training/elearning/).

Do you have questions about the talk, improving legacy code, or TDD? Or maybe just want to chat or learn more about Industrial Logic? The best way to get in touch with me is on twitter. Feel free to contact me at ([@asciamanna](https://www.twitter.com/asciamanna)).

### PhillyXP
Feel free to join the [PhillyXP user group](https://meetup.com/phillyxp) for more talks about agile software development, lean, modern agile, and team excellence. We are currently 100% virtual so you can join from anywhere!

gha_language: HTML


text:
---
template: main.html
---

# Seldon Examples based on Iter8 v0.7

1.  [Hybrid (A/B + SLOs) testing](https://iter8-tools.github.io/iter8/0.7/tutorials/seldon/quick-start/)
2.  [Progressive traffic shifting](https://iter8-tools.github.io/iter8/0.7/tutorials/seldon/rollout-strategies/progressive/)

branch_name: refs/heads/main

gha_language: SCSS


text:
---
layout: docs
title:  "Iso"
section: "optics_menu"
source: "core/src/main/scala/monocle/PIso.scala"
scaladoc: "#monocle.Iso"
---
# Iso

An `Iso` is an optic which converts elements of type `S` into elements of type `A` without loss.

Consider a case class `Person` with two fields:

```tut:silent
case class Person(name: String, age: Int)
```

`Person` is equivalent to a tuple `(String, Int)` and a tuple `(String, Int)` is equivalent to `Person`.
So we can create an `Iso` between `Person` and `(String, Int)` using two total functions:

* `get: Person => (String, Int)`
* `reverseGet (aka apply): (String, Int) => Person`

```tut:silent
import monocle.Iso
val personToTuple = Iso[Person, (String, Int)](p => (p.name, p.age)){case (name, age) => Person(name, age)}
```

```tut:book
personToTuple.get(Person("Zoe", 25))
personToTuple.reverseGet(("Zoe", 25))
```

Or simply:

```tut:book
personToTuple(("Zoe", 25))
```

Another common use of `Iso` is between collection. `List` and `Vector` represent the same concept, they are both an
ordered sequence of elements but they have different performance characteristics. Therefore, we can define an `Iso` between
a `List[A]` and a `Vector[A]`:

```tut:silent
def listToVector[A] = Iso[List[A], Vector[A]](_.toVector)(_.toList)
```

```tut:book
listToVector.get(List(1,2,3))
```

We can also `reverse` an `Iso` since it defines a symmetric transformation:

```tut:book
def vectorToList[A] = listToVector[A].reverse

vectorToList.get(Vector(1,2,3))
```

`Iso` are also convenient to lift methods from one type to another, for example a `String` can be seen as a `List[Char]`
so we should be able to transform all functions `List[Char] => List[Char]` into `String => String`:

```tut:silent
val stringToList = Iso[String, List[Char]](_.toList)(_.mkString(""))
```

```tut:book
stringToList.modify(_.tail)("Hello")
```

## Iso Generation

We defined several macros to simplify the generation of `Iso` between a case class and its `Tuple` equivalent. All macros
are defined in a separate module (see [modules](../modules.html)).

```tut:silent
case class MyString(s: String)
case class Foo()
case object Bar

import monocle.macros.GenIso
```

First of all, `GenIso.apply` generates an `Iso` for `newtype` i.e. case class with a single type parameter:

```tut:book
GenIso[MyString, String].get(MyString("Hello"))
```

Then, `GenIso.unit` generates an `Iso` for object or case classes with no field:

```tut:book
GenIso.unit[Foo]
GenIso.unit[Bar.type]
```

Finally, `GenIso.fields` is a whitebox macro which generalise `GenIso.apply` to all case classes:

```tut:book
GenIso.fields[Person].get(Person("John", 42))
```

Be aware that whitebox macros are not supported by all IDEs.

## Laws

An `Iso` must satisfy all properties defined in `IsoLaws` from the `core` module.
You can check the validity of your own `Iso` using `IsoTests` from the `law` module.

In particular, an `Iso` must verify that `get` and `reverseGet` are inverse. This is done via
`roundTripOneWay` and `roundTripOtherWay` laws:

```tut:silent
def roundTripOneWay[S, A](i: Iso[S, A], s: S): Boolean =
  i.reverseGet(i.get(s)) == s

def roundTripOtherWay[S, A](i: Iso[S, A], a: A): Boolean =
  i.get(i.reverseGet(a)) == a
```

repository: jdegoes/Monocle

repo_name: jdegoes/Monocle


text:
## What are autoencoders?

- In classical machine learning, we introduced PCA as a dimensionality reduction algorithm

- In deep learning auto-encoder has the same purpose as PCA does for tabular data

- "Autoencoding" is a data compression and decompression algorithm where the compression and decompression functions are implemented with neural networks

- Two interesting practical applications of autoencoders are data denoising (which we feature later in this post), and dimensionality reduction

![](../Notebooks/Images/auto_encoder.png)

### Build a MLP based auto-encoder for MNIST

- Write a single fully-connected neural layer as encoder and as decoder with Keras

```python
from keras.layers import Input, Dense
from keras.models import Model
from keras.datasets import mnist
import numpy as np

# this is the size of our encoded representations
encoding_dim = 32  # 32 floats -> compression of factor 24.5, assuming the input is 784 floats

# this is our input placeholder
input_img = Input(shape=(784,))
# "encoded" is the encoded representation of the input
encoded = Dense(encoding_dim, activation='relu')(input_img)
# "decoded" is the lossy reconstruction of the input
decoded = Dense(784, activation='sigmoid')(encoded)

# this model maps an input to its reconstruction
autoencoder = Model(input_img, decoded)

# configure our model to use a per-pixel binary crossentropy loss, and the Adadelta optimizer:

autoencoder.compile(optimizer='adadelta', loss='binary_crossentropy')

# prepare our input data. We're using MNIST digits, and we're discarding the labels
# since we're only interested in encoding/decoding the input images

(x_train, _), (x_test, _) = mnist.load_data()

# normalize all values between 0 and 1 and we will flatten the 28x28 images into vectors of size 784

x_train = x_train.astype('float32') / 255.
x_test = x_test.astype('float32') / 255.

# Reshape x_train and x_test
x_train = np.reshape(x_train,[-1, 28*28])
x_test = np.reshape(x_test,[-1, 28*28])

# train our autoencoder for 50 epochs

autoencoder.fit(x_train, x_train,
                epochs=50,
                batch_size=256,
                shuffle=True,
                validation_data=(x_test, x_test))

```

## If we want to visualize the reconstructed inputs and the encoded representations, what should we do?

```python
# Solution:

# We should create a separate encoder model

# this model maps an input to its encoded representation
encoder = Model(input_img, encoded)

# As well as the decoder model

# create a placeholder for an encoded (32-dimensional) input
encoded_input = Input(shape=(encoding_dim,))
# retrieve the last layer of the autoencoder model
decoder_layer = autoencoder.layers[-1]
# create the decoder model
decoder = Model(encoded_input, decoder_layer(encoded_input))

# encode and decode some digits
# note that we take them from the *test* set
encoded_imgs = encoder.predict(x_test)
decoded_imgs = decoder.predict(encoded_imgs)
```

## We can have deep auto-encoder and convolutional auto-encoder

https://blog.keras.io/building-autoencoders-in-keras.html

repository: KitsuneNoctus/makeschool

repo_name: KitsuneNoctus/makeschool


text:
# VertcoinTipBotButton

Adds a res-like button and drop-down menu to reddit which lets you quickly and easily invoke the vertcointipbot and looks like:

![Vertcoin tip bot button screenshot](http://fuzzywuzzie.github.io/VertcoinTipBotButton/screenshot.png)

To use this, you will need to have a "user-scripts" browser extension installed:

* Chrome: [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en)
* Firefox: [Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/)
* Safari: [GreaseKit](http://8-p.info/greasekit/)

## Installation

### Chrome (Using Tampermonkey)

1. Click the Tampermonkey icon in the top-right of your browser
2. Click "Add a new script..."
3. In the editor, copy and paste the `VertcoinTipBotButton.user.js` code at: [https://raw.github.com/FuzzyWuzzie/VertcoinTipBotButton/master/VertcoinTipBotButton.user.js](https://raw.github.com/FuzzyWuzzie/VertcoinTipBotButton/master/VertcoinTipBotButton.user.js)
4. Click the save button (or press `CTRL+S`).

It's that simple!

### Firefox (Using Greasemonkey)

1. Click on this link: [https://raw.github.com/FuzzyWuzzie/VertcoinTipBotButton/master/VertcoinTipBotButton.user.js](https://raw.github.com/FuzzyWuzzie/VertcoinTipBotButton/master/VertcoinTipBotButton.user.js)
2. Click `Install` once the timer finishes

Even simpler!

repository: hamaluik/VertcoinTipBotButton

repo_name: hamaluik/VertcoinTipBotButton


text:
# Restoring Automatic Backups

There can be many reasons why you want to restore a backup of your BetterTouchTool settings. For example your current settings may have gotten corrupted for some reason (e.g. a hard drive or software issue), or you accidentall deleted some things you need back.

BetterTouchTool creates a backup of your settings everytime after it updates to a new version.
These backups are located in ```~/Library/Application Support/BetterTouchTool```. To open this folder, go to Finder, then click "Go" and then click "Go To Folder". There you can enter the path to this folder (make sure to include the ~).

Now what you see may look similar to this:

![backup](media/backup.png)

I recommend to sort it by "Date Modified", so you can see which are the newest items in that folder.

The BetterTouchTool data store always consists of three files:
* btt_data_store.v2
* btt_data_store.v2-shm
* btt_data_store.v2-wal

Instead of v2 it can also be v3 in the new versions.

Now you can see that there are many files that have a suffix called ".oldVersionBackupXXXX". These are the backups that BTT has saved automatically.

To restore such a backup, follow these steps:

1. Make a backup of the whole ```~/Library/Application Support/BetterTouchTool``` folder so in case you break anything you can restore it later (just copy it somewhere)
2. Quit BetterTouchTool
3. Delete or rename the 3 files mentioned above. (if there are v3 files you need to delete them, if there are also v2 files you should delete them too)
4. Look for the three backup files you want to restore. For example:
    * btt_data_store.v2.oldVersionBackup2.469
    * btt_data_store.v2-shm.oldVersionBackup2.469
    * btt_data_store.v2-wal.oldVersionBackup2.469
5. Rename these three files and remove the .oldVersionBackupXXXX suffix.
6. Start BetterTouchTool again.

Now your settings should have been restored. Make sure to select the correct device tab in BetterTouchTool (e.g. Magic Mouse)

repository: idjevm/BetterTouchTool

gha_license_id: NOASSERTION

repo_name: idjevm/BetterTouchTool


text:
# Relative

Use `Relative` component to control position and to act as a
parent/ancestor to an `Absolute` element.

**Extends: [Box](/Box)**

```.jsx
<Relative p={2}>
  Relative postioned
</Relative>
```

## Props

| Prop     | Type                     | Description  |
| -------- | ------------------------ | ------------ |
| `top`    | number, string, or array | Sets top     |
| `bottom` | number, string, or array | Sets bottom  |
| `left`   | number, string, or array | Sets left    |
| `right`  | number, string, or array | Sets right   |
| `zIndex` | number or string         | Sets z-index |

repository: priceline/design-system

gha_language: TypeScript

repo_name: priceline/design-system


text:
We can actually be very straightforward with how we translate our `with` expressions to JavaScript:

```
type Foo with a=1, b=2
println 'Foo type has been defined.'
foo1 = Foo
foo2 = foo1 with a=10, b=11
```

```javascript
var Foo$Type = new LlamaType(['Foo'], {a: $int(1), b: $int(2)});
var Foo = new LlamaObject(Foo$Type, 'Foo');
println($str('Foo type has been defined.'));
var foo1 = Foo;
var foo2 = foo1.with({a: $int(10), b: $int(11)});
```

The first line in the JavaScript creates a type which has one constructor (`Foo`), and two attributes, defaulted to `1` and `2`. The second line is created at the same time, which is the constructor for the type (there's only one). It's a constant since it doesn't take any arguments, and since it stores its type, it can use it to initialize its variables. In the fourth line, we instantiate a foo -- this is just the same as assigning it to a variable, because it's a constant, so there's no need for `new`. In the fifth line, we are modifying its variables, so we use the `.with` method. This will create a new object with the updated values.

What about refs, though?

```
type Bar with a=ref 1, b=ref 2
```

The issue, here, is that since we have a singleton `Bar` object, those `ref`s are subject to change! They won't always be `ref 1` and `ref 2`. For example:

```
bar1 = Bar
println bar1.a # prints 'ref 1'
bar1.a := 10
bar2 = Bar
println bar2.a # prints 'ref 10'
```

This is just something that is going to have to be dealt with! As in "don't do that unless you know what you're doing." After all, we can always simulate the OOP-y style:

```
new (): Bar = Bar with a=ref 1, b=ref 2
bar1 = new(): Bar
println bar1.a # prints 'ref 1'
bar1.a := 10
bar2 = new(): Bar
println bar2.a # prints 'ref 1'
```

path: /thoughts/with statements (JS translation).md

filename: with statements (JS translation).md

gha_language: Haskell


text:
# Spatial Media

A collection of specifications and tools for 360° video and spatial audio, including:

- [Spatial Audio](docs/spatial-audio-rfc.md) metadata specification
- [Spherical Video](docs/spherical-video-rfc.md) metadata specification
- [Spherical Video V2](docs/spherical-video-v2-rfc.md) metadata specification
- [Spatial Media tools](spatialmedia/) for injecting spatial media metadata in media files

Try out [Jump Inspector](https://g.co/jump/inspector), an Android app for previewing VR videos with spatial audio.

repository: pedro-morgado/spatialaudiogen

gha_language: Python

repo_name: pedro-morgado/spatialaudiogen


text:
# AWS S3 image uploader with java spring boot

Simple Amazon Web Services S3 Image uploader developed with java

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

* AWS S3 Documentation https://aws.amazon.com/documentation/s3/

### Prerequisites

* Apache Maven
* JDK 1.7+

### Configuration
* Modify **application.properties** file with your aws s3 credentials
```
app.aws.iam.accesskey=<add-your-access-key>
app.aws.iam.secretkey=<add-your-secret-key>
app.aws.s3.clientregion=<add-your-s3-client-region>
app.aws.s3.bucketname=<add-your-s3-bucket-name>
```

### Building & Running

* Build maven project

```
mvn clean package
```

* Run jar file

```
java -jar target\s3_image_uploader-0.0.1-SNAPSHOT.jar
```
* Check running application at : http://localhost:8080

## Built With

* [Maven](https://maven.apache.org/) - Dependency Management

## Authors

* **[Nadun Chamikara](https://github.com/nadunc)**

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/nadunc/AWS-S3-image-uploader-with-java-spring-boot/blob/master/LICENSE) file for details

gha_language: Java


text:
[![Build Status](https://travis-ci.org/defrex/django-resize.svg)](https://travis-ci.org/defrex/django-resize)

## django-resize

Simple Django Image Resizing

Install app
```python
INSTALLED_APPS += ('resize',)
```

Then, use the `ImageField` subclass `resize.fields.ResizedImageField` like so.
```python
from resize.fields import ResizedImageField

class MoModel(models.Model):
    image = ResizedImageField(resolutions=('32x32', '100x100'))
```
The resolutions should be in the form`widthxheight`, where `auto`
is an acceptable value for either. For example `100xauto` `50x20` `autox2000`.

During normal operation, new resolutions of the image will be generated
whenever it's changed. However, if you raw-insert data, or add new resolutions
to the list, you can generate any missing images with a manage command.
```shell
./manage.py resize_fields
```
In your templates, a templatetag is provided to use the correct resolution like so.
```html
{% load resize %}

<img src="{{ my_model.image|resize:'32x32' }}">
```
or in Jinja (via [django-jinja](http://django-jinja.readthedocs.org/en/latest/))
```html
<img src="{{ resize(my_model.image, '32x32') }}">
```

repository: defrex/django-resize

repo_name: defrex/django-resize


text:
Swift Phoenix Client
====================

While I stil check up on this project and its issues (and enjoy doing so), our family's new son leaves me with significantly less free time for maintenance than I would like. I would love to hear from one or a few people who are passionate and up-to-date on all things Swift if they have any interest in helping maintain this project. Thanks for any interest :)

## Installation

### CocoaPods

You can install SwiftPhoenix Client via CocoaPods by adding the following to your Podfile

```
pod "SwiftPhoenixClient"
```

and running `pod install`. From there you will need to add `import SwiftPhoenixClient` in any ViewController you want it to be used.

## Usage

Using the Swift Phoenix Client is extremely easy (and familiar if have used the Phoenix JS client).

### Socket Connection/Setup

The first thing you will need is to specify your Phoenix channel endpoint:

```
let socket = Phoenix.Socket(domainAndPort: "localhost:4000", path: "socket", transport: "websocket")
```

To specify a specific protocol you can use the `prot` argument:

```
let socket = Phoenix.Socket(domainAndPort: "localhost:4000", path: "socket", transport: "websocket", prot: "https")
```

Additionally, you will want to identify the topic of the channel we are joining:

```
let topic: String? = "rooms:lobby"
```

### Joining Channel

Next we want to join our channel:

```
socket.join(topic: topic!, message: Phoenix.Message(subject: "status", body: "joining")) { channel in
  let chan = channel as! Phoenix.Channel

  chan.on("join") { message in
    // A new player has joined the game
  }
}
```

### New Messages

We will want to handle new messages (or events) on the channel:

```
chan.on("new:msg") { message in
  let msg = message as! Phoenix.Message
  // Fire ze missiles.
}
```

### Other Events

Just like above,  you can handle any events that your Phoenix app is handling/broadcasting.

```
chan.on("user:entered") { message in
  // A new user has entered the game.
}
```

```
chan.on("error") { message in
  // Nuts
}
```

## Example

Check out the [ViewController](https://github.com/davidstump/SwiftPhoenixClient/blob/master/Example/SwiftPhoenixClient/ViewController.swift) in this repo for a brief example of a simple iOS chat application using the [Phoenix Chat Example](https://github.com/chrismccord/phoenix_chat_example)

Also check out both the Swift and Elixir channels on IRC.

Read the `README_pods.md` file to include this pod from a local copy (of a cloned repo). This may be necessary if you want to use the latest features, but they haven't been tagged and released to CocoaPods yet.

## Note:

Currently works with Swift 2.0, Xcode 7.0, and Phoenix 1.0.1.

Tested with the [Phoenix Chat Server example](https://github.com/chrismccord/phoenix_chat_example), upgraded to Phoenix 1.0.1.

## License

SwiftPhoenixClient is available under the MIT license. See the LICENSE file for more info.


text:
# DIANA-stack

Derek Merck<EMAIL_ADDRESS>
Brown University and Rhode Island Hospital
Winter 2018

<https://www.github.com/derekmerck/DIANA/tree/master/DianaStack>

## Dependencies

### Python Package Requirements

- [Python][] 2.7.11+ for scripting
- [Ansible][] for service orchestration
- [pyyaml][]
- [jinja2][]

### External Requirements

- [Docker][] for service virtualization
- [Orthanc][] for DICOM storage and bridging DICOM to REST
- [Postgresql][] 9.5+ for scalable Orthanc backend
- [Splunk][] 6.6+ for data indexing

[Docker]:http://www.docker.com
[Orthanc]: https://orthanc.chu.ulg.ac.be
[Splunk]: https://www.splunk.com
[Postgresql]:http://www.postgresql.org
[Orthanc]:http://www.orthanc-server.com
[Python]:http://www.python.org
[pyyaml]:http://pyyaml.org
[jinja2]:http://jinja.pocoo.org
[ansible]:http://www.ansible.com

## Use Cases

### DIANA for Mass DICOM Archive

role: `dicom_archive`

1. Create an index role
2. Create a DB role
3. Create n+m DICOM repo roles
   - n archive workers
   - m queues, muxes
4. Create an http reverse proxy role for archive workers
5. Create a bridge role repo/series -> index

6. Install the _dicom-series_ dashboards

Creating the index first allows the system to ship logs directly to the index

### DIANA for PACS Crawling

role: `pacs_crawler`

1. Create an index role
2. Create a DICOM repo role
3. Create a bridge role repo/remote -> index

4. Register the Orthanc repo with the PACS as a valid query source and move target
5. Install the _remote-studies_ dashboards

### DIANA for VPN'd DICOM forwarding

role: `vpn_forwarder`

1. Create a VPN client role
2. Create a DICOM repo role
   - configure as a queue that receives locally and forwards to the VPN

Great for small, low powered devices at remote facilities that need to send images or structured dose reports to a primary archive.  Building on ARM (Raspberry Pi 3) is problematic.

### DIANA for Dose Management

role: `dose_monitor`

1. Create an index role
2. Create a DICOM repo role
3. Create a bridge role repo/dose -> index

4. Point modality dose reports to the dose repo
5. Install the _dose-monitoring_ dashboards

#### Reconciling Missing Data on Dose Reports

Occassionally the EHR will be unavailable to automatically assign accession numbers or protocols as the studies are performed.  For example, we recently lost LifeChart for 4 hours, and ended up with about 40 studies that had absent or hand-input improper accession numbers assigned.  Because the index assumes the accession numbers are correct, this can lead to missing studies in the summary information.

Reconciling this is somewhat complicated, but can be scripted with CopyDICOM.

index = Splunk gateway
dicom_node = Orthanc with structured dose reports
remote_bridge = Orthanc with access to the PACS where the updated accession numbers live

1. Extract the Study Instance UID of the bad reports from Splunk

```
study_ids = index.DoQuery( "index=dose_reports | ..."" )
```

2. Ask the PACS for the updated accession numbers for those StudyInstanceUIDs.
```
for study_id in study_ids:
  accessions.append( remote_bridge.DoRemoteQuery( {"StudyInstanceUID": study_id} ) )
```

3. Modify each report in the DICOM node
```
For study_id, accession_num in zip( study_ids, accessions ):
  dicom_node.modify( {"StudyInstanceUID": study_id}, {"AccessionNumber": accession_num} )
```

4. Drop the bad reports from the indices
```
index.DoQuery( "index=dicom_series | ... | del" )
index.DoQuery( "index=dose_reports | ... | del" )
```

5. Re-index the modified files and update the dose registry
```
index.UpdateSeries( dicom_node )
index.UpdateDoseRegistry( dicom_node )
```

### DIANA for HL7 Dashboards

role: `hl7_consumer`

1. Create an index role
2. Create an FTP forwarder role

3. Install dashboards

## REST Head Uploads

Max file size is set to 8MB in `nginx`.  Most CTs are only .5MB, but some long scouts for panscans may be 4+MB uncompressed.

## License

MIT

repository: jmartens/DIANA

repo_name: jmartens/DIANA


text:
---
title: Utility Classes
date: "2020-10-22T15:32:44.604Z"
description: "A reflection on why utility casses maybe aren't so great"
---

Lately there appears to be a profound interest in CSS utility classes. Maybe this is just due to the [Baader-Meinhof Phenomenon](https://www.healthline.com/health/baader-meinhof-phenomenon)
but a popular library -- [tailwindcss](https://tailwindcss.com/) -- is seemingly everwhere! tailwindcss argues that CSS frameworks do
too much and since they offer predesigned components, building is initially fast but comes with a higher price later on.  They aren't the only
library to offer this though. Bootstrap -- arguably the framework tailwindcss is accusing of "doing too much" -- has these same
set of utility classes.

This all sounds great... but I don't get it.

I would argue that this method of applying a bunch of classes to an element will eventually lead to a higher cost than designing a robost component.
Even using a component library and overriding the styles would be cheaper down the road.

Requirement: "Make a universal button. This button will be used as the primary action thoughout the application"

```html
<button class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded">
  Button
</button>
```

This can be wrapped in reusable component in your framework of choice. I'm going to use React here because of its popularity.

```jsx
// React
<PrimaryButton>Add New Customer</PrimaryButton>
```

But what benefit do utility classes have over classes or even inline styles?

```jsx

const PrimaryButton = ({ children }) => {
  return (
    <button styles={{ backgroundColor: 'blue', color: 'white', fontWeight: 'bold', paddingTop: '2rem', paddingBottom: '4rem' }}>{children}</button>
  );
}
```

Conveniently left out of the inline-style example is the `:hover`. This isn't really feasible with inline-styles and would require using
plain old CSS, CSS imports, a css-in-js solution, etc. So that could be considered a positive for the utility classes. Another argument in
favor of the utility classes is that they are easier to read and definitley more succint (`py-2` vs `paddingTop: '2rem'`).

So now onto some of the pitfalls.

What happens when a designer wants to use a color that isn't predefined? You can't just use `class="bg-#390970`. One solution is to configure
the utility class library. Another is to one-off the style or another custom class

```jsx
<button style="{ background-color: #390970 }" class="text-white font-bold py-2 px-4 rounded">
  Button
</button>

/**
*
*  index.css
*
*  .primary-button {
*    background-color: #390970;
*  }
*
*/

<button class="primary-button text-white font-bold py-2 px-4 rounded">
  Button
</button>
```

While changing the configuration of the library will do the trick it may be unfamiliar territory for designers or at the very least
would limit the options available because there are only so many configuration options avialble.

As for inling the styles why can't all the styles referenced by the class be inlined as well at that point? Same thing goes for the class.
Just define all the styles required for the button in `primary-button`.

I will say that tailwindcss provides a bunch of configuration options and it's written in JavaScript so you can extend pretty much anything.

What does this have over a designer writing an application specific CSS stylesheet?

If the components are not resused (say in a plain HTML page) there is a problem when the designer asks to update the style of a button: you have
to change it everywhere. While this probably isn't such a big deal since most large applications now have the concept to create
reusable components it is still something to consider. For instance, angular does not make creating new components very easy. It's common
to see developers simply copy portions of HTML templates. When this happens updating a style across the board is not straightforward.
If the developer used a more global style like `.primary-button` updating it in 1 stylesheet is much more efficient and painfree than
grepping for `btn` and deciding if it is indeed a primary button or not and making the necessary adjustments.

repository: adam-beck/codelobe

repo_name: adam-beck/codelobe


text:
---
layout: post
title: "TIL: JavaScript's void Operator"
date: 2022-01-20 11:54:45 -0300
categories: TIL javascript
---

Today I discovered the [`void`
operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void#immediately_invoked_function_expressions)
in JavaScript. It evaluates an expression but always returns `undefined`.

```js
console.log(void "hello world") // prints `undefined`
```

It can be used on a

  IIFE
,
which usually uses parenthesis to make the function definition be interpreted
as an expression and not a declaration:

```js
void function() {
  console.log("hello world")
}();
// prints "hello world"

(function() {
  console.log("hello world")
})();
// prints "hello world"

function() {
  console.log("hello world")
}();
// SyntaxError
```

This operator is also useful to ensure that an arrow function always return `undefined`:

```js
// changes to the return value of `doSomething` won't affect this code
button.onclick = () => void doSomething();
```

## Caveat

It's important to note that this operator has a [high precedence]
with right-to-left associativity, so you may want to use parenthesis to
correctly construct some expressions:

```js
void "hello" + " world" // parsed as: (void "hello") + " world"
// => 'undefined world'

void ("hello" + " world") // parsed as: void ("hello" + " world")
// => undefined
```

[high precedence]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table


text:
-----------
# InstanceGroup v1alpha2 kops

>bdocs-tab:example

```bdocs-tab:example_yaml

apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: null
  labels:
    kops.k8s.io/cluster: test.aws.k8spro.com
  name: nodes
spec:
  image: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2017-12-02
  machineType: t2.medium
  maxSize: 2
  minSize: 2
  minPrice: "0.2"
  cloudLabels:
    team: me
    project: ion
  nodeLabels:
    kops.k8s.io/instancegroup: nodes
  role: Node
  rootVolumeSize: 200
  rootVolumeOptimization: true
  subnets:
  - us-west-2a
  taints:
  - dedicated=gpu:NoSchedule
  - team=search:PreferNoSchedule

```

Group        | Version     | Kind
------------ | ---------- | -----------
kops | v1alpha2 | InstanceGroup

InstanceGroup represents a group of instances (either nodes or masters) with the same configuration

Appears In:

InstanceGroupList kops/v1alpha2

Field        | Description
------------ | -----------
apiVersion
 *string*    | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.  Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
metadata
 *[ObjectMeta](#objectmeta-v1-meta)*    |
spec
 *[InstanceGroupSpec](#instancegroupspec-v1alpha2-kops)*    |

### InstanceGroupSpec v1alpha2 kops

Appears In:

InstanceGroup kops/v1alpha2

Field        | Description
------------ | -----------
additionalSecurityGroups
 *string array*    | AdditionalSecurityGroups attaches additional security groups (e.g. i-123456)
additionalUserData
 *[UserData](#userdata-v1alpha2-kops) array*    | AdditionalUserData is any additional user-data to be passed to the host
associatePublicIp
 *boolean*    | AssociatePublicIP is true if we want instances to have a public IP
cloudLabels
 *object*    | CloudLabels indicates the labels for instances in this group, at the AWS level
detailedInstanceMonitoring
 *boolean*    | DetailedInstanceMonitoring defines if detailed-monitoring is enabled (AWS only)
fileAssets
 *[FileAssetSpec](#fileassetspec-v1alpha2-kops) array*    | FileAssets is a collection of file assets for this instance group
hooks
 *[HookSpec](#hookspec-v1alpha2-kops) array*    | Hooks is a list of hooks for this instanceGroup, note: these can override the cluster wide ones if required
image
 *string*    | Image is the instance (ami etc) we should use
kubelet
 *[KubeletConfigSpec](#kubeletconfigspec-v1alpha2-kops)*    | Kubelet overrides kubelet config from the ClusterSpec
machineType
 *string*    | MachineType is the instance class
maxPrice
 *string*    | MaxPrice indicates this is a spot-pricing group, with the specified value as our max-price bid
maxSize
 *integer*    | MaxSize is the maximum size of the pool
minSize
 *integer*    | MinSize is the minimum size of the pool
nodeLabels
 *object*    | NodeLabels indicates the kubernetes labels for nodes in this group
role
 *string*    | Type determines the role of instances in this group: masters or nodes
rootVolumeIops
 *integer*    | If volume type is io1, then we need to specify the number of Iops.
rootVolumeOptimization
 *boolean*    | RootVolumeOptimization enables EBS optimization for an instance
rootVolumeSize
 *integer*    | RootVolumeSize is the size of the EBS root volume to use, in GB
rootVolumeType
 *string*    | RootVolumeType is the type of the EBS root volume to use (e.g. gp2)
subnets
 *string array*    | Subnets is the names of the Subnets (as specified in the Cluster) where machines in this instance group should be placed
suspendProcesses
 *string array*    | SuspendProcesses disables the listed Scaling Policies
taints
 *string array*    | Taints indicates the kubernetes taints for nodes in this group
tenancy
 *string*    | Describes the tenancy of the instance group. Can be either default or dedicated. Currently only applies to AWS.
zones
 *string array*    | Zones is the names of the Zones where machines in this instance group should be placed This is needed for regional subnets (e.g. GCE), to restrict placement to particular zones

### InstanceGroupList v1alpha2 kops

Field        | Description
------------ | -----------
apiVersion
 *string*    | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
items
 *[InstanceGroup](#instancegroup-v1alpha2-kops) array*    |
kind
 *string*    | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
metadata
 *[ListMeta](#listmeta-v1-meta)*    |

repository: qntfy/kops

repo_name: qntfy/kops


text:
<img src="citadel-logo.svg" alt="Citadel Logo" width="128" height="128">

# Citadel

[![CircleCI](https://circleci.com/gh/mikepjb/citadel.svg?style=svg)](https://circleci.com/gh/mikepjb/citadel)

A tool for Arch Linux, it helps you with 3 tasks:

1. Prepare a bootable Arch Linux image with X11, i3 and a few nice to haves, making initial setup easier.
2. Install Arch Linux, leading you through some best practices along the way.
3. Update your system according to a single configuration `system.edn` file.

### Features

This project is incomplete, here is the progress:

- [x] Install official packages via `system.edn`
- [x] Include essential system map to merge with user provided version
- [ ] Specify linux-lts (kernel choice) in `system.edn`
- [x] use repo url e.g toolkit to setup new machine
- [ ] BP: Check for encrypted root disk
- [ ] BP: Check for swap file
- [ ] BP: Check for automatic wifi connection (netctl-auto)
- [x] BP: ensure intel-ucode exists for processors that need it (any intel for now)
- [ ] Ensure Gimp font is set to a suitable size (gtkrc 2)
- [ ] write system font to all config files (e.g gtkrc 2, gtkrc 3.. whereever else? i3 config?)
- [ ] setting console font too.
- [ ] Mark versions for packages in `system.edn`
- [x] Install AUR packages via `system.edn`
- [ ] Include creating arch linux chroot jail in 'foreign' linux e.g RHEL/Ubuntu...
- [ ] Better error feedback for invalid system.edn (e.g noto-fonts-extra without description map -> {})
- [ ] Conch does not seem to stream output when installing AUR packages.

### Checks
- [ ] is using modesetting (better than intel)
- [ ] is a member of video group? (allows changing brightness using modesetting)
- [ ] is power button set to inactive (except for forcing) to prevent accidental shutdown?

### Try it out

`java -jar citadel.jar update ~/toolkit/system.edn`
`java -jar citadel.jar update https://raw.githubusercontent.com/mikepjb/toolkit/master/system.edn`

---

## Fake News.. (old description)

A citadel is the core fortified area of a town, city or in this case a computer system.

This citadel is a collection of code that sets up an Arch Linux system as a development environment.

### Getting Started

You can with just `clj` but in most cases you will want to integrate with your editor of choice over a nREPL connection, this should do the trick:
`clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.5.3"}}}' -m nrepl.cmdline`

Citadel can be run from the command line in this directory with:
`clj -m citadel.core ~/toolkit/system.edn`

### System Map Example

```
{:deps
 {ripgrep {}
  telegram-desktop {}
  openjdk8-src {:comment "for Clojure source jumping"}
  toolkit {:git "github.com/mikepjb/toolkit"}}}
```

### Development

You can build a new version of Citadel by running the make command.

#### References

[https://www.reddit.com/r/archlinux/comments/5r5ep8/make_your_arch_fonts_beautiful_easily/]
[https://wiki.archlinux.org/index.php/General_recommendations]

repository: mikepjb/citadel

repo_name: mikepjb/citadel


text:
# Tahoe Bike Map

This is a web app for finding efficient bike routes around the Lake Tahoe region. See it in action at http://map.tahoebike.org.

It allows users to specify a start and end point to a route and allows them to choose a route type. The route type can be one biased towards bike routes and bike lanes or a more direct route.

Bike routes are provided by the [Bikesy Server](https://github.com/brendannee/bikesy-server). The maps are rendered using the mapbox API and allow dragging and dropping start/end points.

The assumptions that go into the routes provided by the Bikesy API are documented on the [Bikesy API page](https://blog.bikesy.com/api/).

## Setup

Install node.js dependencies

    npm install

## Running Locally

To run locally:

    npm run develop

Then, open http://localhost:3000 in your browser. Gulp will listen for changes and reload automatically.

## Running in Production

    npm run build

    npm start

## Deployment

* This app is deployed through Heroku. Credentials are stored in the LTBC LastPass Account.
* Install the Heroku CLI locally: `brew install heroku/brew/heroku`
* `heroku login`
* From the repo, `git remote add prod https://git.heroku.com/tahoebike.git && git remote add staging https://git.heroku.com/tahoebike-stage.git`
* `git push staging|prod [localbranchname:]master`
* `heroku logs --tail -a tahoebike[stage]`
* `heroku run bash --remote staging|prod`

## Contributing

Contributions welcome. Contact [Nick Speal](http://www.speal.ca/contact/) to get involved with the [Lake Tahoe Bicycle Coalition](https://wwww.tahoebike.org)

## Credit

Originally developed by [Brendan Nee](https://github.com/brendannee) at [BlinkTag](https://blinktag.com/). Maintained by Nick Speal(https://github.com/nickspeal/) and the [Lake Tahoe Bicycle Coalition](https://wwww.tahoebike.org)

repository: BlinkTagInc/tahoebikemap

repo_name: BlinkTagInc/tahoebikemap


text:
# Salt Skillet
Panhandler Skillets to interface with Saltstack REST API.

This shows how to use the REST skillet type to perform the salt authentication, and send the payload.

This assumes your salt-master instance has state file called 'launch_container.sls'. See [here](https://github.com/nembery/salt-master-compose) for an example.

## Disclaimer

Provided as-is for use as a proof of concept only.


text:
# Architecture
**This document describes the high-level architecture of this project**

If you want to familiarize yourself with the code base and *generally* how it works, this is a good place to be.

## High Level TLDR

The frontend code gets loaded into `frontend/public/index`. `frontend/src/App.svelte` is the main svelte app. Everything in `frontend/src/pages/` is the routes.

## Code Map

#### Code Map Legend

`<file name>` for a file name

`<folder name>/` for a folder

`<folder name>/<file name>` for a file within a folder

### `frontend/public`

This is all the publicly accessible resources to be served. This includes(but not limited to) images, css, html, and javascript.

### `frontend/package.json`

This is the package list for javascript. It also includes workspaces and specialty commands.

### `frontend/webpack.config.js`

This is the config for webpack. Webpack is the bundling system we use for svelte, css, and html.

### `frontend/index.html`

This is the base html file where all of our svelte gets loaded.

### `frontend/public/build`

This is all the built svelte files. As svelte is a compiler, it needs to be built to javascript. This is where the files end up after being built.

### `frontend/src/`

This is the place where all of our svelte source code lives.

### `frontend/src/main.js`

This is the actual script that runs `frontend/src/App.svelte`. It is also the thing that gets loaded by `frontend/public/index.html`.

### `frontend/src/App.svelte`

This is the core and start of our svelte project. All code gets loaded and runs from here.

### `frontend/src/pages`

This is where the frontend routes live. We use [Routify](https://routify.dev/) for our frontend router so this file structure is based off of this. You can read more about it [here](https://routify.dev/guide/introduction/structure).

### `frontend/src/components`

This is where our components are put.

repository: GibJob-ai/GObjob

gha_language: Svelte

repo_name: GibJob-ai/GObjob


text:
[![Build Status](https://travis-ci.org/kaelzhang/npm-workstation.svg?branch=master)](https://travis-ci.org/kaelzhang/npm-workstation)
[![Coverage](https://codecov.io/gh/kaelzhang/npm-workstation/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/npm-workstation)
<!-- optional appveyor tst
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/npm-workstation?branch=master&svg=true)](https://ci.appveyor.com/project/kaelzhang/npm-workstation)
-->
<!-- optional npm version
[![NPM version](https://badge.fury.io/js/npm-workstation.svg)](http://badge.fury.io/js/npm-workstation)
-->
<!-- optional npm downloads
[![npm module downloads per month](http://img.shields.io/npm/dm/npm-workstation.svg)](https://www.npmjs.org/package/npm-workstation)
-->
<!-- optional dependency status
[![Dependency Status](https://david-dm.org/kaelzhang/npm-workstation.svg)](https://david-dm.org/kaelzhang/npm-workstation)
-->

# npm-workstation

A tool for managing multiple related JavaScript projects(npm packages), the better replacement of lerna.

## What can npm-workstation do?

With the help of `npm-workstation`, we need not to put multiple npm packages into a [monorepo](https://en.wikipedia.org/wiki/Monorepo), such as [`babel`](https://github.com/babel/babel).

`npm-workstation` could coordinate multiple arbitrary already-existed standalone but related npm packages.

Generally, if you want to do something as lerna does, and you don't want a monorepo, or can't put everything inside a monorepo (because the npm packages already exist), `npm-workstation` will be a good choice.

## Usage

```sh
# Install npmw
npm i -g npm-workstation

# Create a workstation
npmw create foo

cd /path/to/project-1
# Add the current directory to workstation foo,
npmw add . foo
#  or you can use `npmw add /path/to/project-1 foo`

npmw add /path/to/project-2 foo

# Then make changes to project-1 and project-2,
# inside /path/to/project-2
npmw publish
```

A vscode extension is also available to help it much easier to add repos into a single workstation.

## Commands

## Documentations

- Frequently asked questions

## License

[MIT](LICENSE)

repository: kaelzhang/npm-workstation

repo_name: kaelzhang/npm-workstation


text:
SlickSlack
======================================

A library for extraction and processing of Slack data.

### Extract Slack history

Based on https://gist.github.com/Chandler/fb7a070f52883849de35.

Get a slack token from https://api.slack.com/web

Unlike direct exports via Slack UI, this one uses the API to pull in public and private channels,
even direct messages if desired.

To run (and extract history in the current directory):

```
python -m slickslack.extract --token='123token' [--dryRun=True] [--skipDirectMessages] [--skipPrivateChannels]

```

### Parse extracted Slack history

```
import slickslack as sl
export_root='.'
users = sl.load_user_dict(export_root)
chans = sl.load_channels(export_root, includes=['myprefix*', '*myinfix*', 'w?ldc"rd'])
```

### Get / filter messages:

```
msgs = sum([], [m for c in chans
             for m in c['messages']
             if not m.get('is_intro') and not m.get('subtype')])
```

### Time series of interactions between users

Currently this comes from 1) '@' references, and 2) emoji reactions

```
for e in sl.iter_connections(msgs):
    # do stuff
```

repository: lorenzo-deepcode/buildit-all

repo_name: lorenzo-deepcode/buildit-all


text:
# If Statements
## Uses

If statements can be used on returned values to adjust the way the data is displayed. For example, replacing the value ```healthy``` with a healthy status image (check mark), or changing the displayed values color to display a threshold that has been breached.

# Examples
## Color replacement
Simple replacement based on the value uses HTML tags. For example, Low (Yellow), Warning (Orange), Critical (Red):

![image](https://user-images.githubusercontent.com/45064152/125918677-0844f670-8b79-4deb-af1a-290bd886f980.png)

### Custom Label

```
{{#if value == "low" }} <p style="color:Yellow;">{{value}} </p> {{elseif value == "critical" }} <p style="color:Red;">{{value}} </p>{{elseif value == "warning" }}  <p style="color:Orange;">{{value}} </p> {{/if}}
```

## Image replacement
In the image below, you can see the grid tile (SQL, PowerShell, Web API) is used with replacements of different values for the severity and integration logo:

![image](https://user-images.githubusercontent.com/45064152/125915926-e30ec5d6-c685-43dd-a6b3-749d46665e41.png)

This relies on an the referenced image being stored in the ```/images/``` folder within ```/inetpub/wwwroot/``` on the SquaredUp server.

The if statement is added in the grid columns configuration for Severity:

![image](https://user-images.githubusercontent.com/45064152/125916323-a3ca51d4-86b9-436c-ae66-35b1f3904f4a.png)

### Custom Label

```
{{#if value == "low" }}<img src="/images/healthy.png" width="16" />{{elseif value == "critical" }}<img src="/images/critical.png" width="16" />{{elseif value == "warning" }}<img src="/images/warning.png" width="16" />{{/if}}
```

And the Integrations column:

![image](https://user-images.githubusercontent.com/45064152/125917819-5cc1feb7-3e83-4c68-9412-2e91cde23c86.png)

### Custom Label

```
{{#if value.integration.summary == "Pingdom" }}<img src="/images/pingdom-dark.png" width="60" />{{/if}}
```

You'll note the above has a different key path to where the data is located - This can be found in the response data of your tile, or by using the mustache picker ```{{}}```

repository: billbodapolypore/samples

repo_name: billbodapolypore/samples


text:
# <img src="resources/maqslogo.ico" height="32" width="32"> Database FAQ

## What about DataTables
***MAQS and Dapper*** shifts away with DataTables and instead leveages a strategy around strongly typed and dynamic object lists. Migrating from MAQS 4 to 5 requires either a rewrite of queries to support the mapping strategy, or a conversion of the returned objects into a DataTable.

## How do use a provider besides SQL, SQLite and PostgreSql
There are multiple ways to use a custom provider.

* [Override the GetDataBaseConnection method](MAQS_6/Database/DatabaseBaseTest.md)
* [Create your own DatabaseDriver](MAQS_6/Database/DatabaseDriver.md)
* [Implement the IProvider Class](MAQS_6/Database/DatabaseProviders.md)

## Why doesn't MAQS directly support Oracle SQL anymore
The Oracle SQL library has a non-standard license and we are not confident it adheres to most user licensing standards.

## How Can to Connect to an Oracle SQL Database

### Adding the Oracle Database Connector
Adding the Oracle database connector can be added by adding the "Oracle.ManagedDataAccess.Core"  NuGet package.
### Setting Up the Connection Inline
```csharp
/// <summary>
/// Check that we get back the state table
/// </summary>
[TestMethod]
public void AddInTest()
{
    // Adding the connection inline
    this.TestObject.OverrideDatabaseConnection(() => new OracleConnection(DatabaseConfig.GetConnectionString()));

    var states = this.DatabaseDriver.Query("SELECT * FROM States").ToList();
    Assert.AreEqual(50, states.Count, "Expected 50 states.");
}
```

### Or Setting Up the Connection for All Tests In A Class
```csharp
[TestClass]
public class DatabaseCustomUnitTests : BaseDatabaseTest
{
    /// <summary>
    /// Overridde the database connection
    /// </summary>
    /// <returns>The database connection</returns>
    protected override IDbConnection GetDataBaseConnection()
    {
        return new OracleConnection(DatabaseConfig.GetConnectionString());
    }
```

repository: Magenic/MAQS

gha_language: C#

repo_name: Magenic/MAQS


text:
# Terraform code

Terraform scripts to deploy the PRS infrastructure on Microsoft Azure.

As you can see in `version.tf`, the terraform state is persisted in a storage account. The storage account and the container have been created manually.

## Prerequisites

The following tools need to be installed on your system where you run the scripts:
- [Kubectl](https://kubernetes.io/docs/tasks/tools/)
- [Helm](https://helm.sh/docs/intro/install/)
- [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli)
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)

## Quick start

Run the following commands to deploy the PoC infrastructure:

1. Sign-on to Azure and select the target subscription for the PoC landscape with `az login --tenant <catenax-tenant>`
1. Check whether the variables for your target environment have been correctly set `cat variables.tf`
1. From the main directory of this repository, run `terraform init`
1. Run `terraform plan`
1. Run `terraform apply`

## Viewing outputs

NB: this section is referenced from [Confluence: Browsing the database](https://confluence.catena-x.net/display/CXM/Browsing+the+database).

To see the outputs stored in the Terraform state, do the following:

1. Follow the steps above up to `terraform init`
1. Run `terraform output -json`

Note that some of these values are sensitive and should not be disclosed.


text:
***

# ReviewableTrait

A trait for reviewable objects.

* Full name: `\PhpDocumentorMarkdown\Example\ReviewableTrait`

## Properties

### reviews

```php
public static array $reviews
```

* This property is **static**.

***

## Methods

### isReviewed

Whether the object has been reviewed.

```php
public isReviewed(): bool
```

***

***
> Automatically generated from source code comments on 2022-04-20 using [phpDocumentor](http://www.phpdoc.org/) and [saggre/phpdocumentor-markdown](https://github.com/Saggre/phpDocumentor-markdown)

repository: Gokujo/postgresql-orm

repo_name: Gokujo/postgresql-orm


text:
---
title: Prestige
author: Jeremy
tags: [research, science, journals]
permalink: /198
date: 2019-11-15
---

![Researcher: "Must resist giving more credence to this research just because it was published in a popular jounal." (Later) Researcher: "...Oh year, this research is top-notch. After all, it was published in the prestigious journal Nature!" (What we say versus what we do.)](https://res.cloudinary.com/dh3hm8pb7/image/upload/c_scale,q_auto:best/v1535842782/Handwaving/Published/Prestige.png){: .centre-image }

Once I started noticing this in magazines and other science outreach publications, I couldn't unsee it. You're welcome.


text:
# we-use-cookies-banner
A light & flexible npm package for making your website GDPR compliant. Built as a polymer v2 web component! 🔥

# Usage
_(Note: Not yet ready for usage)_

This light & flexible component can be used in _ANY_ website. That means regardless of whether you use React, Angular, Vue, vanilla JavaScript, etc... you can easily use this library!

First, install the npm package in your project:
```
npm install we-use-cookies-banner --save
```

Then add the component in the root HTML file for your site:
```
<we-use-cookies-banner/>
```

The banner exposes various component attributes for customization. All attributes are optional and have default values.

---

- `lock-to` - Whether the banner should be locked to the top or bottom of the window.

   ### Valid values: `bottom` | `top`

   ### Default value: `bottom`

---

- `privacy-policy` - The url for the "Privacy Policy" link in the text.

   ### Default value: `https://gdpr.eu/wp-content/uploads/2019/01/Our-Company-Privacy-Policy.pdf`

---

- `text` - The message of text displayed in the banner.

    ### Default value: `This website stores cookies on your computer. These cookies are used to collect information about how you interact with our website and allow us to remember you. We use this information in order to improve and customize your browsing experience and for analytics and metrics about our visitors both on this website and other media. To find out more about the cookies we use, see our Privacy Policy. \n \n If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference not to be tracked.`

---

- `accept-button-label` - The label on the accept button.

- ### Default value: `Accept`

---

- `decline-button-label` - The label on the decline button.

- ### Default value: `Decline`

---

- `show-decline-button` - Whether to show or hide the decline button.

- ### Default value: `true`

---

# Customizing Styles

By defining these css classes in your code you can override the default css styles of the component.

- `we-use-cookies-banner-container`
- `we-use-cookies-banner-text`
- `we-use-cookies-banner-accept-btn`
- `we-use-cookies-banner-decline-btn`

# Disclaimer
Having a "we use cookies" banner on your site is one step towards being GDPR compliant, but really it's about more than just the banner.  Feel free to clone this repository and navigate into the `project` directory to see the full source code for this project. More details for working on this project can be found in the README file there.

# Scaffolding
This project was proudly intialized using the [easy-wc yeoman generator](https://github.com/Westbrook/generator-easy-wc). 🔥


text:
+++
# About/Biography widget.

widget = "about"
active = true
date = "2019-03-11T00:00:00"
author = "Thomas Yang"

# Order that this section will appear in.

weight = 5

# Display name

name = "Thomas Yang"

# Is this the primary user of the site?

superuser = false

# User group

user_groups = ["eex96"]

# Role/position

role = "Undergraduate Student"

# Organizations/Affiliations.

# Separate multiple entries with a comma, using the form: [ {name="Org1", url=""}, {name="Org2", url=""} ].

organizations = [ { name = "University of Hawaiʻi at Mānoa", url = "http://manoa.hawaii.edu/" }, { name = "Department of Electrical Engineering", url = "http://www.ee.hawaii.edu/"} ]

# List your academic interests.

interests = [ "Machine Learning", "Big Data", "Algorithms", "Artificial Intelligence" ]

# List your qualifications (such as academic degrees).

[[education.courses]]
  course = "B.S. student in Computer Engineering"
  institution = "University of Hawaiʻi at Mānoa"
  year = 2020

# Social/Academic Networking

# For available icons, see: https://sourcethemes.com/academic/docs/widgets/#icons

# For an email link, use "fas" icon pack, "envelope" icon, and a link in the

# form<EMAIL_ADDRESS>or "#contact" for contact widget.

[[social]]
  icon = "zotero"
  icon_pack = "ai"
  link = "https://www.zotero.org/thomasy4/"

[[social]]
  icon = "envelope"
  icon_pack = "fa"
  link =<EMAIL_ADDRESS>+++

I am currently an undergraduate student going into my fourth semester of Computer Engineering. I am interested in dealing with big data and AI, with a particular interest in self-learning AI. I am expected to graduate in Fall 2020, and am planning to pursue a Masters Degree in Computer Engineering, with a focus on machine learning.
<!--stackedit_data:
eyJoaXN0b3J5IjpbLTEyOTY2Nzg4MzBdfQ==
-->

repository: brackenw/academic-kickstart

gha_language: Shell

repo_name: brackenw/academic-kickstart


text:
# Samples

Samples for how this Cloud Native Buildpack is integrated with OpenFaaS.

### Prerequisites

- [Docker](https://docs.docker.com/install/)
- [Kind](https://github.com/kubernetes-sigs/kind#installation-and-usage)
- [faas-cli](https://github.com/openfaas/faas-cli#get-started-install-the-cli)
- [pack](https://buildpacks.io/docs/install-pack/)

### Environment

#### Start up

```shell script
./scripts/local.startup.sh
```

This command does the following:

- Start up a docker registry
- Starts a k8s cluster
- Installs OpenFaaS

#### Teardown

```shell script
./scripts/local.teardown.sh
```

### Build

Build and publish application to local registry.

```shell script
pack build localhost:5001/openfaas-cnb/streaming:latest \
  --path streaming/ \
  --builder heroku/buildpacks:18 \
  --buildpack from=builder \
  --buildpack jar013/openfaas-cnb:latest \
  --publish
```

### Run

```shell script
faas up -f stack.yml
```

### Troubleshooting

Some helpful commands:

```shell script
# list function pods
kubectl -n openfaas-fn get pods

# details of function pods
kubectl -n openfaas-fn describe pods
```

repository: jromero/openfaas-cnb

gha_language: Go

repo_name: jromero/openfaas-cnb


text:
# Tech-Blog-HW

## Description
This is a blog style website in which users can sign up and log in to post their thoughts. Each post has its own comment section, and the user can update or delete their own posts or comments. There is authentification functions in place such that users cannot access most of the features without logging in.

## Table of Contents
  - [Installation](#installation)
  - [Usage](#usage)
  - [License](#license)
  - [Contact me](#questions)

## Installation
This application requires a back end mysql database.
To run this application locally, clone this repository and install the dependencies using
`npm i`
Create a .env file with the information needed about the database.
To run the server, run this command in the terminal:
`npm start`

## Usage
To use the application, go to the [deployed link](https://tech-blog-el.herokuapp.com/).
The homepage consists of all the posts ever posted. To access many features, the user must first either sign up or log in.
When the user is logged in, they can check out specific posts by clicking on the post. They can then choose to add comments, or if they are the original poster of the post, they can edit the post or delete it.
The user can see all their posts on their dashboard. They can also add new posts by going to their dashboard and clicking the add post button.
  - [Deployed Application](https://tech-blog-el.herokuapp.com/)

![image](https://user-images.githubusercontent.com/28275237/126917164-026cdd11-bd85-4c4f-bc50-2d1deed589c0.png)
![image](https://user-images.githubusercontent.com/28275237/126917170-3e90d2bc-21e1-4af9-bd14-525633009acc.png)
![image](https://user-images.githubusercontent.com/28275237/126917177-5ace65ab-ca36-4680-a437-8b9175c61a7a.png)
![image](https://user-images.githubusercontent.com/28275237/126917185-fe6a4b48-3c6c-4d9d-ab4a-e97f7dc40d10.png)
![image](https://user-images.githubusercontent.com/28275237/126917200-0794c885-728f-4ed6-8da0-faba67eb8667.png)
![image](https://user-images.githubusercontent.com/28275237/126917221-8317c203-8497-4a35-9257-5f788f99f301.png)

## License
[MIT](https://spdx.org/licenses/MIT.html)
![License Badge](https://img.shields.io/badge/license-MIT-9cf)

## Questions
If you have any problems or questions, you can email me at<EMAIL_ADDRESS>or contact me on my Github.
Github Page: [elisonliu97](github.com/elisonliu97)


text:
---
layout: post
title: Use the Jetstream object store
categories: [openstack, jetstream]
---

I plan to collect here notes about using the Openstack object store
on Jetstream.

## Get Amazon-style credentials

Most of the ecosystem is used to Amazon S3, so Openstack Swift provides
Amazon compatible APIs, to access those, make sure your openstack client
can authenticate with the correct allocation, then run:

    openstack ec2 credentials create

This prints on the screen the Access and the Secret keys, those can be
used in all tools which expects Amazon APIs.

## Command line access to object store with s3cmd

One of the most convenient tools is [`s3cmd`](https://s3tools.org/s3cmd), which allows to list, upload
and download files from object store. It is included in most linux distributions.

First run the interactive configuration tool:

    s3cmd --configure

And set:

* Region: `RegionOne`
* Any password for encryption
* Use HTTPS: Yes
* Do not test
* Save the configuration

Now edit `~/.s3cfg`:

* set `check_ssl_certificate` and `check_ssl_hostname` to `False`
* set `host_base=JETSTREAM_SWIFT_ENDPOINT` where `JETSTREAM_SWIFT_ENDPOINT` is just the hostname, without `https://` and without `/swift/v1`, I prefer not to post publicly check on your Openstack dashboard or email me.

Now you can list the content of buckets/containers:

```
> s3cmd ls
2020-03-11 23:25  s3://data_store

> s3cmd ls s3://data_store
                       DIR   s3://data_store/bbb/
                       DIR   s3://data_store/data/
                       DIR   s3://data_store/fff/
2020-03-27 01:39       500   s3://data_store/nginx-cinder.yaml

> s3cmd put local_file.txt s3://data_store/fff/ggg
```

repository: zonca/zonca-blog

gha_language: Jupyter Notebook

repo_name: zonca/zonca-blog


text:
# cryptowatch
Local app to keep track of cryptocurrency markets

## Motivation

**Goal**

My goal is to create a local app that anyone can use to monitor and make trades on multiple markets. Using api keys from those markets just like others apps out there, except that the keys are local and not on someone elses server.

## Status

`Just started it`

repository: mikebobadilla/cryptowatch

repo_name: mikebobadilla/cryptowatch


text:
# Depth First of a Graph

## Challenge
Write a function that takes in an adjacency list as a graph. Write a function that traverses the graph depth first and returns a collection of vertex.

## Approach & Efficiency
We used a recursive function, and it isn't currently working. I think we are close to solving the issue, but need more time to work out bugs.

Efficiency is O(n). This is because the function tracks visited vertex.

## Solution
![Solution for Depth First Graph node list](../assets/depthFirstGraph.jpg)