text:
# S3-Copy-Objects
The Lambda function to copy incremental S3 objects for cross AWS Accounts

*Steps for copying:*

* Deploy the lambda in the source AWS account.
* The IAM role of the lambda should have Read access to the source s3 bucket.
* Below is the sample policy to add into the IAM role of Lambda to access the source s3 bucket.
```buildoutcfg
        {
            "Sid": "sourceBucketReadPolicy",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::sourceAccountNumber:role/lambdaRole"
            },
            "Action": [
                "s3:ListBucket",
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::sourcebucket",
                "arn:aws:s3:::sourcebucket/*"
            ]
        }
```
* It should also have write permission for the destination S3 bucket
```buildoutcfg
        {
            "Sid": "destinationBucketWritePolicy",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::sourceAccountNumber:role/lambdaRole"
            },
            "Action": [
                "s3:ListBucket",
                "s3:PutObject",
                "s3:PutObjectAcl"
            ],
            "Resource": [
                "arn:aws:s3:::destinationbucket",
                "arn:aws:s3:::destinationbucket/*"
            ]
        }
```
* Create an SNS event on the s3 bucket whose objects you want to copy.
* Add the IAM role of the lambda to the Bucket Policy of the Destination bucket with the write permission.
```buildoutcfg
        {
            "Sid": "lambdaRoleWritePolicy",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::sourceAccountNumber:role/lambdaRole"
            },
            "Action": [
                "s3:GetObject",
                "s3:ListBucket",
                "s3:PutObject",
                "s3:PutObjectAcl"
            ],
            "Resource": [
                "arn:aws:s3:::destinationbucket",
                "arn:aws:s3:::destinationbucket/*"
            ]
        }
```


text:
# Welcome to Rails Recipe Manager

A simply Ruby on Rails app to keep track of recipes.

* Add recipes with up to 5 items
* Track which recipes you've made most, and which are your favorites
* Discover other recipes using certain ingredients
* The app supports GitHub Login via Omniauth.

## Installation
* Fork and clone the repo, navigate to the directory, bundle install and give rails s a whirl

## Walkthrough
[Video](https://youtu.be/nNfVXJvSFKo)

## Contributing
1. Fork the repo
2. Create a branch for your feature
3. Commit and push your branch
4. Submit a pull request

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

license: MIT

repository: kylekinnear/recipe-manager-rails

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: kylekinnear/recipe-manager-rails


text:
author: Aaron Bieber<EMAIL_ADDRESS>title: Concurrent Hello with Erlang
description: A concurrent Hello World with Erlang
tags: Erlang
date: Fri, 12 Mar 2010 12:01:00 MST

I recently picked up a copy of Joe Armstrong’s superb Programming Erlang book ( from the folks @ pragprog.com ). While reading the chapter on concurrent programming I was completely stumped by one of the examples. It basically creates a “server” and “client” and allows for message passing between the two. I found it very difficult to follow the passing of messages from a to b, and back.

Enter `chello.erl`! I created a slightly modified version of Joe’s example that uses some `io:format` to tell you what’s going on. Hope someone finds this useful.

``` erlang
-module (chello).
-export ([loop/0, rpc/2]).

rpc(Pid, Request) ->
    io:format("rpc[~p]  sending ~p to ~p~n", [self(), Request, Pid]),
    Pid ! {self(), Request},
    receive
        Response ->
            io:format("rpc[~p]  responding with : ~p~n", [self(), Response]),
            {Pid,Response}
    end.

loop() ->
receive
    {From, {hello}} ->
        io:format("loop[~p] received info from: ~p~n", [self(), From]),
        From ! {self(), "Hello"},
        loop();
    {From, {goodbye}} ->
        io:format("loop[~p] received info from: ~p~n", [self(), From]),
        From ! {self(),"Goodbye"},
        loop();
    {From, Other} ->
        io:format("loop[~p] received info from: ~p~n", [self, From]),
        From ! {self(),{error, Other}},
        loop()
    end.
```

Run from the erl shell with:

    1> Pid = spawn(fun chello:loop/0).

    <0.38.0>

    2> chello:rpc(Pid, {hello}).
    rpc[<0.31.0>] sending {hello} to <0.38.0>

    loop[<0.38.0>] received info from: <0.31.0>

    rpc[<0.31.0>] responding with : {<0.38.0>,”Hello”}

    {<0.38.0>,{<0.38.0>,”Hello”}}

license: ISC

repository: qbit/deftly

repo_name: qbit/deftly


text:
---
layout: post
title: "January 25, 2014"
description: ""
category:
tags: ["stacks"]
prompt: "How would you design a stack which, in addition to push and pop, also has a function min which returns the minimum element? Push, pop and min should all operate in O(1) time."
time: "12 minutes"
code_time: "Unavailable"
gist: "https://gist.github.com/slunk/8636232"
---
{% include JB/setup %}
Approach: store the current minimum value in the stack along with the element being added.

Original c-like pseudocode:

    struct entry {
        int val;
        int min;
    }

    struct stack {
        entry *arr;
        int sz;
        int ptr;
    }

    void push(stack *skt, int val)
    {
        if (stk->sz > stk->ptr) {
            stk->arr[ptr].val = val; // Minor error here
            stk->arr[ptr].min = min_helper(stk, val);
            // Forgot to increment stk->ptr here
        } else {
            error();
        }
    }

    int pop(stack *stk)
    {
        if (stk->ptr <= 0)
            error();
        return stk->arr[--stk->ptr].val;
    }

    int min(stack *stk)
    {
        if (stk->ptr <= 0)
            error();
        return stk->ptr[stk->ptr - 1].min;
    }

    int min_helper(stack *stk, int val)
    {
        int last;
        if (stk->ptr == 0)
            return val;
        last = stk->arr[stk->ptr - 1].min;
        return val < last ? val : last;
    }

## Lessons

1. Always test by hand. Forgetting to increment the stack pointer is an easy mistake to make but I should have caught it.


text:
authauth
========

nodejs spike using Google OpenID for Authentication and a different service for Authorization

Installation
------------

Clone the git repository:

```bash
git clone https://github.com/enw/authauth.git
```
Install NPM modules:

```bash
npm install
```

Start web application:

```bash
node app.js
```

Open [http://localhost:3000/](http://localhost:3000/) in your browser to verify the application is running.

repository: enw/authauth

repo_name: enw/authauth


text:
{
  "title": "I finally have a legit blogdown website! 100000s of thank yous to @statsgen for putting up with my incessant questions today :D https://t.co/boSwJsvCNj 💪💪😅💯",
  "date": "2018-11-06"
}

# blogdown

> **Shila Ghazanfar** (@shazanfar; 26/2): I finally have a legit blogdown website! 100000s of thank yous to @statsgen for putting up with my incessant questions today :D
>
https://t.co/boSwJsvCNj
>
💪💪😅💯  [↪](https://twitter.com/xieyihui/status/1059328057012498432)

<!-- -->

> **Lorne Campbell** (@LorneJCampbell; 2/0): @kaitlynmwerner @JonMcphetres @thuyvytnguyen @EvoMellor @AmandaKMontoya @OSFramework @eplebel Work in progress, but I use R blogdown and add links to open stuff https://t.co/QU3G0Krb1m  [↪](https://twitter.com/xieyihui/status/1059562061066199040)

<!-- -->

> **Shila Ghazanfar** (@shazanfar; 2/0): @statsgen You know what they say, give a man a fish and he eats for a day. Give a man detailed and insightful blogdown tutorials and a live demo and he builds a website! 😅  [↪](https://twitter.com/xieyihui/status/1059390476774567936)

<!-- -->

> **Roope Kaaronen** (@RoopeKaaronen; 2/0): @lpsatchell Did mine (https://t.co/gNHIuCl3tq) with R Blogdown. Followed these steps, I quite like it:
>
https://t.co/3jnQyQmfko  [↪](https://twitter.com/xieyihui/status/1059537506943811586)

<!-- -->

> **Yohan J. Rodríguez** (@hasdid; 1/1): #R  #AutoTweet | Writing a CV in markdown so it can be rendered as HTML, a PDF, and a Word document https://t.co/6y74svTa3C  [↪](https://twitter.com/xieyihui/status/1059517453288554496)

<!-- -->

> **Shila Ghazanfar** (@shazanfar; 1/0): Also I found this blog by Tyler Clavelle @tclavL super helpful while figuring out how blogdown interacts with github etc, thank you for writing!
>
https://t.co/Y3sDdZml0S https://t.co/1CZF68IxGa  [↪](https://twitter.com/xieyihui/status/1059554176290631680)

<!-- -->

> **Darrin Speegle** (@speegled; 0/0): I realized this morning that this could sound like a criticism of #blogdown. It was intended to be just a lamentation of my own ineptitude. All the blogs I created with blogdown were beautiful and easy.  [↪](https://twitter.com/xieyihui/status/1059445222541877248)

<!-- -->

# bookdown

> **Zuguang Gu** (@jokergoo; 18/10): The new version of ComplexHeatmap is finally usable. There are a lot of new features and documentation is written with #bookdown. Currently, it only exists in GitHub https://t.co/rZUiE8SDEG https://t.co/K3veAQuoFr  [↪](https://twitter.com/xieyihui/status/1059428425256050688)

<!-- -->

> **Jack Dougherty** (@DoughertyJack; 0/0): Looking for open-access book platform using Markdown with web/pdf/ePub products? Consider @rstudio https://t.co/U4ZYkhM6N5. Examples in-progress: https://t.co/N5HQ1mNQ5H https://t.co/mQaS9bZiyi @kfitz  [↪](https://twitter.com/xieyihui/status/1059645796738572289)

<!-- -->

> **Dorris A. Scott** (@Dorris_Scott; 0/0): I seriously need to migrate @RReady2Map into #bookdown so I can make it nice so whoever will teach or guest lecture this module moving forward can easily refer to the materials and make changes accordingly. All about that reproducible life! https://t.co/YlsQmhglAn  [↪](https://twitter.com/xieyihui/status/1059460282957864961)

<!-- -->

> **Aliakbar Akbaritabar (Ali)** (@Akbaritabar; 0/0): @dr_d_allington The fist thing proved me how easier life can be (honestly, I couldn't believe how easier it gets with #bookdown). I simply checked-out (copied) the final version of each chapter to a new repo built with bookdown template and tweaked a bit and boom! done. really nice experience  [↪](https://twitter.com/xieyihui/status/1059453269632786432)

<!-- -->

> **Aliakbar Akbaritabar (Ali)** (@Akbaritabar; 0/0): @dr_d_allington Dear @dr_d_allington after near 3 months, 2 things happened and I returned to post a reply to this Tweet-versation
>
1- I compiled a collection of 6 chapters/articles as a #bookdown project and submitted it
2- I had to edit parts of a "plain text" in a repo and I did it online -->  [↪](https://twitter.com/xieyihui/status/1059452870423203842)

<!-- -->

# knitr

> **Katherine S.** (@kitkatbar429; 2/0): @ayanalytics @rstudio @RLadiesChicago OMG!! Please save me a knitr and rmarkdown one! Both are basically my life :D  [↪](https://twitter.com/xieyihui/status/1059604642655543296)

<!-- -->

> **Atom Editor Packages** (@Atom_Packages; 0/0): Atom-DiCy
>
Compile LaTeX, knitr, literate Agda, literate Haskell and Pweave documents using DiCy.
>
Installation
>
Use the Atom package manager and search for "dicy" or run apm install dicy from the command line.
>
TeX Distribution
>
In order to use this pac… https://t.co/gDJ8fJA2RK  [↪](https://twitter.com/xieyihui/status/1059432235819040768)

<!-- -->

# xaringan

> **Gina Reynolds** (@EvaMaeRey; 6/1): Wrangle. "From Middle English wranglen, from Low German wrangeln." Adapting @statsgen @grrrck reveal function to display piped wrangling steps (in addition to plotting steps) in #xaringan. https://t.co/UbSdxx6x8M  [↪](https://twitter.com/xieyihui/status/1059486674235707392)

<!-- -->

> **かつどん** (@nozma; 6/0): xaringanによるスライド作成入門 on @Qiita https://t.co/fHFiUQpZdd  [↪](https://twitter.com/xieyihui/status/1059585300089888768)

<!-- -->

> **Gina Reynolds** (@EvaMaeRey; 4/1): Pipe into ggplot() demo with @statsgen @grrrck reveal() and #xaringan #rstats #ggplot2 https://t.co/Z3PLpvBop4  [↪](https://twitter.com/xieyihui/status/1059606582340739072)

<!-- -->

> **かつどん** (@nozma; 1/0): そろそろxaringan覚えよう  [↪](https://twitter.com/xieyihui/status/1059387108949843968)

<!-- -->

> **uwe sterr** (@SterrUwe; 0/0): @jamietheriveter I use Xaringan https://t.co/xgKdfs44yp from #xieyihui. Best to use from within #rstudio. See example https://t.co/dBdvVy8HVz  [↪](https://twitter.com/xieyihui/status/1059336551187013632)

<!-- -->

# yihui.name

> **uwe sterr** (@SterrUwe; 0/0): @jamietheriveter I use Xaringan https://t.co/xgKdfs44yp from #xieyihui. Best to use from within #rstudio. See example https://t.co/dBdvVy8HVz  [↪](https://twitter.com/xieyihui/status/1059336551187013632)

<!-- -->

repository: cgpu/twitter-blogdown

gha_license_id: MIT

repo_name: cgpu/twitter-blogdown


text:
# Interceptor

Use this Python script to spot the attacker in your network.
The attacker who uses the wide spread tools: Responder, Inveigh and the alike.

## Attack

  There is a well-known technique which abuses the Microsoft Windows' single-sign-on functionality in order to
capture the user's Net-NTLMv1/v2 (sometimes named NTLMv1/v2) hashes. Those hashes can further be used to attack the other systems
on the network (Credential Relaying).

  There are hacking tools that use this technique, the most popular one is the Responder. Windows based analog is the Inveigh.
Both these tools (in fact, all tools that target this specific Windows' behaviour) rely on sniffing the network traffic, looking
for the broadcast name resolution requests and sending poisoned replies, eventually forcing the Windows client to connect to the
attacker's system and to expose the Net-NTLM hashes. The ones who seek more details about this attack can find lots of relevant information on the Net.

## Concept

  It is not something new that Responder can be detected by sending the dummy name resolution requests (NBNS, or LLMNR)
and rising an alert upon the received replies (from the Responder).

  The disadvantage of the existing solutions is that they require the sending system to be placed in the network segment, which
you wish to monitor. This happens because those solutions send requests to the real multicast (<IP_ADDRESS> in case of LLMNR)
or broadcast (in case of NBNS) addresses.
__It turns out that the Responder (nor Inveigh) does not check if the name resolution request
was sent to the actual broadcast address.__ That is to say, Responder sends poisoned replies even if it receives request that was sent
to the _unicast address_ (which is not how NBNS, LLMNR name resolution works).

  This creates a good opportunity to detect Responder. One can send dummy name resolution requests to every host in the multiple
higher risk networks from the single system and alert about the poisoned replies.
This is exactly what the Interceptor does.

## How it works

  Whilst Interceptor has some rough edges, the core functionality is ready:
  - It gets the list of the target subnets from the configuration file;
  - It sets up the sniffing thread;
  - It sends artificial NBNS and LLMNR name resolution requests, querying resources from the config file;
  - If the sniffer receives a reply, it logs a message in the log file (which you can monitor using your SIEM system)
    and (optionally) posts to the Slack channel;
  - It can establish SMB connection to the attacker's supplied address in order to send phishing NTLM auth information;
  - It runs non-stop (until Ctrl-C) with the interval (in seconds) between the destination networks

repository: ntdkom/Interceptor

repo_name: ntdkom/Interceptor


text:
# world-o-techno
Location-based techno with Sonic Pi and gpsd, for Bristol Mini Maker Faire 2015

See http://www.jarkman.co.uk/catalog/robots/worldotechno.htm for hardware details

## Getting started:

Check this repository out into ```/home/pi```

Install gpsd (thanks to http://blog.retep.org/2012/06/18/getting-gps-to-work-on-a-raspberry-pi/) with
```
pi@raspberrypi:~$ sudo apt-get install gpsd gpsd-clients python-gps
```
and start it with
```
pi@raspberrypi:~$ sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock
```

Check your GPS works with
```
pi@raspberrypi:~$ cgps -s
```

Install sonic-pi-cli to give Sonic Pi a command line (via https://github.com/Widdershin/sonic-pi-cli)
```
pi@raspberrypi:~$ gem install sonic-pi-cli
```

## Autostart

Make your pi start Sonic Pi and play our script when the Pi boots boot (thanks to
https://rbnrpi.wordpress.com/autoboot-for-telegram-and-sonic-pi-jukebox/)
```
pi@raspberrypi:~$ sudo vi /etc/xdg/lxsession/LXDE-pi/autostart
```
and add these lines at the end:
```
@sonic-pi
lxterminal --command "/home/pi/world-o-techno/startup.sh"
```

Now reboot your Pi and see if it works.

repository: gloomytree/world-o-techno

repo_name: gloomytree/world-o-techno


text:
# 🏠 [Home](../../) / [Examples](../) / Redux Fetch

## Redux Fetch

<!-- prettier-ignore-start -->
| callbag | most | RxJS | xstream |
| --- | --- | --- | --- |
| [`code`](https://git.io/fAZ1d) [`live`](https://codesandbox.io/s/github/fanduel-oss/refract/tree/master/examples/redux-fetch/callbag) | [`code`](https://git.io/fAZ1F) [`live`](https://codesandbox.io/s/github/fanduel-oss/refract/tree/master/examples/redux-fetch/most) | [`code`](https://git.io/fAZ1b) [`live`](https://codesandbox.io/s/github/fanduel-oss/refract/tree/master/examples/redux-fetch/rxjs) | [`code`](https://git.io/fAZ1A) [`live`](https://codesandbox.io/s/github/fanduel-oss/refract/tree/master/examples/redux-fetch/xstream) |
<!-- prettier-ignore-end -->

This basic example renders a single text input which prompts for a GitHub username. When the user submits the form (either by clicking the button or pressing return), it dispatches a plain action to Redux.

#### Aperture

Inside the Refract `aperture`, two observables are observed: the `USER_REQUEST` action, and the `getUsers` selector. Every time an action with the type `USER_REQUEST` is dispatched to the store, it is passed to the stream; every time the `users` object in the redux store changes, it is also passed to the stream.

These two streams are combined into one `combined$` - each time anything is sent to either stream, this new stream emits a new tuple containing the most recent value from _both_ source streams.

This combined stream is piped through various methods in two separate control flows: requests for users whose data is not yet in redux are mapped to a fetch request, with error handling built in; requests for users whose data _is_ already in the store are mapped to a `selectUser` action.

#### Handler

The Refract `handler` inspects the type of each effect, and causes different effects for different action types. If the effect is an error, it logs the effect; if the effect is either a `USER_RECEIVE` or a `USER_SELECT` effect, it is dispatched to the store.

#### Result

The end result is a form with some complex conditional, asynchronous logic built in an easily maintainable way.

repository: fanduel-oss/refract

gha_language: TypeScript

repo_name: fanduel-oss/refract


text:
# flask-ad-auth
Flask Azure AD Authorization Extension (based on flask-login)

This will use the login with Microsoft AZure AD functionality to authorize
users for you flask application. You can Check if an user has a azureAD
user in your organisation or if he belongs to a specific group.

## Register an Azure AD App ##

*Important*

This it the link to the Microsoft Doc for registering an App: https://learn.microsoft.com/en-us/graph/auth-register-app-v2
If you have problems use this documentation as I will not be able to always keep this doc up to date.

You need to register an app that has read permissions to the Azure AD. You'll need to add clientid and clientsecret of this app in order to run this sample against your Azure AD. Follow below steps to register an Azure app:
- Sign in to the Azure management portal and to the Azure Active Directory Tab: https://aad.portal.azure.com/
- Goto: "App Registrations" and click "New registration".
- Enter a friendly name for the application, for example "Example Azure AD Read App", select "Web" and use `http://localhost:5000/connect/get_token` as a Redirect URI.
- Find the Client ID value and copy it aside, you will need this later when configuring your application.
- While still in the Azure portal, click the "Certificates & secrets" tab of the application you created.
- Create a new "Client Secret" - the keyValue will be displayed after you save the configuration at the end - it will be displayed, and you should save this to a secure location. **Note, that the key value is only displayed once, and you will not be able to retrieve it later**.
- Configure Permissions - under the "Permissions to other applications" section, you will configure permissions to access the Graph.
- The following Permissions are needed to use all features of this library: Group.Read.All, User.Read, User.Read.All.
- Add additional Perimissions that you need here.

**To use this on a server you have to replace the REDIRECT_URL with your domain. You might also want to configure a "Front-channel logout URL" that redirects to your logout page.**

## Configuration
You need to set the following Flask Config Variables:
- AD_SQLITE_DB = "my_user_db.db3" # or use REDIS
- AD_APP_ID = "CLIENT ID FROM ABOVE"
- AD_APP_KEY = "SECRET VALUE FROM ABOVE"
- AD_TENANT_ID = "YOUR AZURE AD TENANT ID)
- AD_REDIRECT_URI = "http://localhost:5000/connect/get_token" # for testing on localhost

# Usage
```
# In you App Init
from flask import Flask
from flask import url_for, redirect, request
from flask_ad_auth import ADAuth

app = Flask(__name__)
app.secret_key = <SOME SECRET KEY>
app.config.update(
    AD_SQLITE_DB = "my_user_db.db3",
    AD_APP_ID = <YOUR CLIENT ID>,
    AD_APP_KEY = <YOUR SECRET>,
    AD_TENANT_ID = <TENANT>
    AD_REDIRECT_URI = "http://localhost:5000/connect/get_token",
    AD_LOGIN_REDIRECT = "/login_form"
)
ad_auth = ADAuth()
ad_auth.init_app(app)

# In you Views:
from flask_ad_auth import login_required, current_user, ad_group_required, logout_user

@app.route('/protected')
@login_required
def protected_view():
    return "Logged in as: {}".format(current_user.email)

@app.route('/group_protected')
@ad_group_required("sdadsad-6a93-d3432-a4be-f1cbsdsaa0d4")
def group_protected_view():
    return "Logged in as: {}".format(current_user.email)

@app.route('/logout')
def logout():
    logout_user()
    return 'Logged out<br/><a href="{}">goto login page</a>'.format(url_for("login_form"))

@app.route('/')
@app.route('/login_form')
def login_form():
    if current_user.is_authenticated:
        return 'logged in as {}<br/><a href="{}">logout</a>'.format(current_user.email, url_for("logout"))
    return 'not logged in<br/><a href="{}">login</a>'.format(ad_auth.sign_in_url)

if __name__ == '__main__':
	app.run( debug=True, host='<IP_ADDRESS>', port=5000)
```

# Build for PIP

```
python2 setup.py sdist bdist_wheel
python3 setup.py sdist bdist_wheel
twine upload dist/*
```

# Changes

### Version 1.0.1 ###

** This release might break compatibility! Make sure you are using the right config values **

* Rewrite using msal: https://github.com/AzureAD/microsoft-authentication-library-for-python
* Using new Auth Flow as recommended by Microsoft
* Removed some old stuff

### Version 0.8.2 ###

* Small changes to doc and example

### Version 0.8 ###

* Fixed Setup for pypi installs

### Version 0.7 ###

* Fixed an edge case in which the refresh token was not accepted anymore

### Version 0.6 ###

* New Config: "AD_AUTH_USER_BASECLASS" sets the base for all Users

### Version 0.5 ###

* Added Group Name Cache
* Group-Access now takes name or id of the group

### Version 0.4 ###

* Reload on Empty Database fixed

### Version 0.3 ###

* Fixed SQLite Storage (THX @mowoe)
* Added SQlite Database Test

repository: wuttem/flask-ad-auth

gha_language: Python

repo_name: wuttem/flask-ad-auth


text:
# Configuring zoe

Zoe relies on a pre-set configuration to infer most of the parameters at usage time when interacting with a cluster using the CLI. This is one of the key points that makes zoe easy to use.

Zoe loads its configuration from a variety of sources. It also has a complex override chain that makes it highly configurable even in the context of containers.

In this guide, we will discover the following points:

- [Config initialization](init.md): We will start with how to initialize zoe configuration files by either creating them from scratch or loading them from an existing source.
- [Environments](environments.md): We will see how zoe allows you to separate clusters' configuration into multiple environments and how we can select the appropriate environment when using zoe.
- [Configuration loading chain](chain.md): We will then tackle zoe's complex configuration loading chain and how configuration values can be overridden with environment variables.
- [Configuration reference](reference.md): This section contains the list of all possible values in zoe's configuration file.

repository: adevinta/zoe

gha_language: Kotlin

repo_name: adevinta/zoe


text:
This is a preview release of GraphObjects, a new graph persistence framework targeeting MacOS X and iOS. As such it is incomplete and has a number of issues.

__Support__

GraphObjects is intended to work on Mac OS X 10.6+ and iOS 4.2+. The underlying C++ based implementations should be portable to other platforms, and it is an eventual requirement that they work on Linux. The Objective C interfaces depend on features of the modern runtime and blocks, so they will not work on older Mac OS X or iOS releases.

__Building__

GraphObjects requires a clang 2.0 toolchain in order to build. that mean that no currently released build of Xcode can build it out of box. In order to build it you either need to build a a custom MacOS X 10.6 or iOS 4.2 SDK using a copy of clang pulled from their repository, hack up your system compilers, or use unreleased developer tool previews. While GraphObjects has occasionally been built for iOS, it currently is being primarily brought up on Mac OS X x86.

__Usage__

You probably don't want to use this yet unless you are intending to hack on it. It's API is similiar to CoreData, though there is no modeler (it derives object info directly from LGGOObjects). The only header files that should be considered public to framework clients are LGGOGraph.h and LGGOGraphContext.h, and even those currently leak some private details.

* Mailing List: [http://groups.google.com/group/graphobjects](http://groups.google.com/group/graphobjects)
* Contributor Agreement: [https://github.com/GLsoft/GraphObjects/raw/master/GCA.pdf](https://github.com/GLsoft/GraphObjects/raw/master/GCA.pdf)
* Github repo: [https://github.com/GLsoft/GraphObjects](https://github.com/GLsoft/GraphObjects)

repository: grubern/GraphObjects

repo_name: grubern/GraphObjects


text:
# [API](README.md).customerAddressBookContacts - Flow Commerce API - Node SDK Documentation

Preferences may indicate a contact is preferred for billing, invoicing, and/or shipping.

## Usage

```JavaScript
import client from '@flowio/node-sdk';

const customerAddressBookContacts = client().customerAddressBookContacts;
```

## Operations

##`get(organization, number, options = {})`

### Function Parameters

| Name  | Type | Description |
| ---- | ---- | ---- |
| organization | string | Refers to your organization's account identifier |
| number | string |  |

### Query Parameters

| Name  | Type | Description |
| ---- | ---- | ---- |
| id | [string] | Filter by one or more IDs of this resource |
| email | [string] | Find contacts by email |
| phone | [string] | Find contacts by phone |
| limit | long | The maximum number of results to return |
| offset | long | The number of results to skip before returning results |
| sort | string |  |

##`post(organization, number, options = {})`

### Function Parameters

| Name  | Type | Description |
| ---- | ---- | ---- |
| organization | string | Refers to your organization's account identifier |
| number | string |  |

##`getById(organization, number, id, options = {})`

### Function Parameters

| Name  | Type | Description |
| ---- | ---- | ---- |
| organization | string | Refers to your organization's account identifier |
| number | string |  |
| id | string | Filter by one or more IDs of this resource |

##`putById(organization, number, id, options = {})`

### Function Parameters

| Name  | Type | Description |
| ---- | ---- | ---- |
| organization | string | Refers to your organization's account identifier |
| number | string |  |
| id | string | Filter by one or more IDs of this resource |

##`deleteById(organization, number, id, options = {})`

### Function Parameters

| Name  | Type | Description |
| ---- | ---- | ---- |
| organization | string | Refers to your organization's account identifier |
| number | string |  |
| id | string | Filter by one or more IDs of this resource |

repository: flowcommerce/node-sdk

branch_name: refs/heads/main

gha_language: JavaScript

repo_name: flowcommerce/node-sdk


text:
---
title: Calva Sponsors
description: Meet the sponsors. Calva is open source and free to use. It is actively maintained during our free time, and it keeps improving.
search:
  boost: 7
---

# Calva Sponsors

Calva is open source and free to use. It is actively maintained during our free time, and it keeps improving. You can contribute in many different ways, one of which is sponsoring. You can sponsor Calva by directly [sponsoring any of us](#our-sponsoring-profiles).

If you are working at a company which benefits from Calva's existence and continued development, please consider sponsoring at the Calva Gold Sponsor tier.

Please see [this statement from Cognitect](https://cognitect.com/blog/2020/12/15/sponsoring-open-source-developers) about the importance of supporting open source developers.

## Patrons

The right kind of different

## Gold Sponsors

Scale your growth on mobile

MAKE. DO. SHIP.

## Silver Sponsors

## Clojurists Together

Significant additions to Calva have been made possible by funding from [Clojurists Together](https://www.clojuriststogether.org). And this has often been transformational for the whole project. Calva would not be where it is today without Clojurists Together.

## Our Sponsoring Profiles

These are the sponsoring profiles for the active maintainers of Calva (a.k.a. The Calva Team).

* [Peter Strömberg](https://github.com/sponsors/PEZ)
* [Brandon Ringe](https://github.com/sponsors/bpringe)
* [Cora Sutton](https://github.com/sponsors/corasaurus-hex)
* [Lukas Domagala](https://github.com/sponsors/Cyrik)

## README visibility

There is also a sponsors section in the [README](https://github.com/BetterThanTomorrow/calva#calva-sponsors-%EF%B8%8F) of the Calva project (which means it is also displayed in the [VS Code Extension Marketlace](https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva#calva-sponsors)).

repository: BetterThanTomorrow/calva

branch_name: refs/heads/published

gha_license_id: NOASSERTION

repo_name: BetterThanTomorrow/calva


text:
+++
date = "2016-09-23T13:43:54-07:00"
title = "Check"
description = "Check the Linkerd installation for potential problems."
weight = 1
aliases = [
  "/2/check-reference/"
]
[menu.l5d2docs]
  name = "check"
  parent = "cli"
+++

The `linkerd check` command validates the Linkerd installation for potential
problems, at varying stages of the Linkerd installation lifecycle.

Prior to running `linkerd install`, we recommend running prerequisite checks to
ensure you cluster is ready for installation:
```bash
linkerd check --pre
```

Once Linkerd is installed, you can run the default check command:
```bash
linkerd check
```

To validate a `linkerd inject` command succeeded, you can run additional checks
to verify each `linkerd-proxy` is operating normally:
```bash
linkerd check --proxy
```

For resolutions to common `linkerd check` failures, have a look at
[Resolutions for linkerd check failures](/2/installing/#check).

## Flags

{{< flags "check" >}}

### Global flags

{{< global-flags >}}

# Example output

```bash
$ linkerd check
kubernetes-api
--------------
√ can initialize the client
√ can query the Kubernetes API

kubernetes-version
------------------
√ is running the minimum Kubernetes API version

linkerd-existence
-----------------
√ control plane namespace exists
√ controller pod is running
√ can initialize the client
√ can query the control plane API

linkerd-api
-----------
√ control plane pods are ready
√ can query the control plane API
√ [kubernetes] control plane can talk to Kubernetes
√ [prometheus] control plane can talk to Prometheus

linkerd-service-profile
-----------------------
√ no invalid service profiles

linkerd-version
---------------
√ can determine the latest version
√ cli is up-to-date

control-plane-version
---------------------
√ control plane is up-to-date
√ control plane and cli versions match

Status check results are √
```

# Check options

```bash
$ linkerd check --help
Check the Linkerd installation for potential problems.

The check command will perform a series of checks to validate that the linkerd
CLI and control plane are configured correctly. If the command encounters a
failure it will print additional information about the failure and exit with a
non-zero exit code.

Usage:
  linkerd check [flags]

Examples:
  # Check that the Linkerd control plane is up and running
  linkerd check

  # Check that the Linkerd control plane can be installed in the "test" namespace
  linkerd check --pre --linkerd-namespace test

  # Check that the Linkerd data plane proxies in the "app" namespace are up and running
  linkerd check --proxy --namespace app

Flags:
      --expected-version string   Overrides the version used when checking if Linkerd is running the latest version (mostly for testing)
  -h, --help                      help for check
  -n, --namespace string          Namespace to use for --proxy checks (default: all namespaces)
      --pre                       Only run pre-installation checks, to determine if the control plane can be installed
      --proxy                     Only run data-plane checks, to determine if the data plane is healthy
      --single-namespace          When running pre-installation checks (--pre), only check the permissions required to operate the control plane in a single namespace
      --wait duration             Retry and wait for some checks to succeed if they don't pass the first time (default 5m0s)

Global Flags:
      --api-addr string            Override kubeconfig and communicate directly with the control plane at host:port (mostly for testing)
      --context string             Name of the kubeconfig context to use
      --kubeconfig string          Path to the kubeconfig file to use for CLI requests
  -l, --linkerd-namespace string   Namespace in which Linkerd is installed [$LINKERD_NAMESPACE] (default "linkerd")
      --verbose                    Turn on debug logging
```

repository: mbanikazemi/website

repo_name: mbanikazemi/website


text:
# animation_widgets(Beta release)

This is a Flutter package.
This provides animation widget.

## Getting Started

### 1. Write dependencies in 'pubspec.yaml'.
**pubspec.yaml**
```
dependencies:
  animation_widgets:
    git:
      url: git@github.com:matsuob/animation_widgets.git
      ref: master
```

### 2. Run flutter pub get in the terminal.
```
$flutter pub get
```

### 3. Write code such as sample.
```
import 'package:flutter/material.dart';
import 'package:animation_widgets/fade_widget.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(body: _PlayGround(),),
  ));
}

class _PlayGround extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(child:
      FadeWidget(
        fadeDuration: const Duration(seconds: 1),
        delayDuration: const Duration(seconds: 1),
        child:
          Text("Hello!",
            style: Theme.of(context).textTheme.headline6,
          ),
        ),
    );
  }
}
```


text:
# VSTS Windows Azure VM agent connection instructions

1. Go to https://resources.azure.com/subscriptions/84a65c9a-787d-45da-b10a-3a1cefce8060/resourceGroups/dnceng-build-agents/providers/Microsoft.Network/loadBalancers/LB-helixage/inboundNatRules

2. Machines are named as “helixage_[virtual machine #]” so look at the end of the `"name"` property which references the virtual machine # you care about.

    Example:
    ```JSON
    {
      "name": "LoadBalancerBEAddressNatPool.0",
    }
    ```

    This entry represents “helixage_0”

3. In that item, find the "port #" from the `"value.properties.frontendPort"` value

4. Connect to the machine: `mstsc /v: dnceng-helix.westus2.cloudapp.azure.com:[port #]`

    a. Username: dotnet-bot

    b. Password is available from **HelixProdKV** as *HelixVMAdminPassword*

Was this helpful? [![Yes](https://helix.dot.net/f/ip/5?p=Documentation%5CProject-Docs%5CVSTS%5Cvsts-windows-connection-instructions.md)](https://helix.dot.net/f/p/5?p=Documentation%5CProject-Docs%5CVSTS%5Cvsts-windows-connection-instructions.md) [![No](https://helix.dot.net/f/in)](https://helix.dot.net/f/n/5?p=Documentation%5CProject-Docs%5CVSTS%5Cvsts-windows-connection-instructions.md)

repository: dotnet/arcade

gha_language: C#

repo_name: dotnet/arcade


text:
# 2FA Directory API & Data

[![License](https://img.shields.io/badge/license-mit-9A0F2D.svg?style=for-the-badge)][license]
[![Twitter](https://img.shields.io/badge/Twitter-@2faorg-1DA1F2.svg?style=for-the-badge&logo=Twitter)][twitter]
[![Sponsor](https://img.shields.io/github/sponsors/2factorauth?color=db61a2&logo=GitHub&style=for-the-badge)][sponsor]

[2FA Directory][site_url] is an open source project that aims to improve online security by providing a directory of websites and services that support two-factor authentication (2FA). Our community-driven platform allows anyone to contribute to the list, making it the most comprehensive directory of its kind.

Our hope is that this directory can aid consumers who are deciding between alternative services based on the security they offer for their customers. This project also serves as an indicator of general security efforts used on a site.

## Contributing :pencil2:

[2FA Directory][site_url] is only possible thanks to community contributions. We welcome all contributions to the project.
If you would like to contribute, please read the entire guidelines in [CONTRIBUTING.md][contrib].

This repository contains the directory data for [2FA Directory][site_url].
For the website frontend code, see [2factorauth/frontend][frontend].

## Third party usage

We welcome anyone to use our data however we discourage scraping the data directly from this Git repository as changes we make might break your program.
Instead we recommend you use our [API][api].

We provide API access free of charge, however, the project does incur regular bills to maintain. Therefore, if you use the data for commercial purposes, please consider sponsoring us here on [GitHub][sponsor].

We always appreciate people letting us know how they use our data so please drop us a few lines about your project if you decide to use our API! 😊

## License :balance_scale:

This code is distributed under the MIT license. For more info, read the [LICENSE][license] file distributed with the source code.

[api]: https://2fa.directory/api/
[contrib]: /CONTRIBUTING.md
[frontend]: https://github.com/2factorauth/frontend/
[license]: /LICENSE.md
[site_url]: https://2fa.directory/
[sponsor]: https://github.com/sponsors/2factorauth/
[twitter]: https://twitter.com/2faorg/

repository: phallobst/twofactorauth

gha_language: SCSS

repo_name: phallobst/twofactorauth


text:
pouchdb-adapter-cordova-sqlite
======

PouchDB adapter using either [Cordova-sqlite-storage](https://github.com/litehelpers/Cordova-sqlite-storage) or
[cordova-plugin-sqlite-2](https://github.com/nolanlawson/cordova-plugin-sqlite-2) or
[cordova-plugin-websql](https://github.com/Microsoft/cordova-plugin-websql) as its backing store.

As long as there is a global `cordova.sqlitePlugin` (or `openDatabase`) available, this adapter should work. Its adapter name is `'cordova-sqlite'`.

_**Note:** Until v6.0.0, PouchDB's regular `websql` adapter supported the Cordova SQLite Plugin automatically. However, we found this
was confusing, error-prone, and difficult to configure, hence it's been extracted into a separate plugin._

### Usage

```bash
npm install pouchdb-adapter-cordova-sqlite
```

```js
PouchDB.plugin(require('pouchdb-adapter-cordova-sqlite'));
var db = new PouchDB('mydb.db', {adapter: 'cordova-sqlite'});
```

**Not using npm?** Just directly download the bundle file from:

  - [https://npmcdn.com/pouchdb-adapter-cordova-sqlite/dist/pouchdb.cordova-sqlite.js](https://npmcdn.com/pouchdb-adapter-cordova-sqlite/dist/pouchdb.cordova-sqlite.js)

Then do this:

```js
PouchDB.plugin(PouchAdapterCordovaSqlite);
var db = new PouchDB('mydb.db', {adapter: 'cordova-sqlite'});
```

This will create a SQLite database via native Cordova called `mydb.db`.

### Configuration

You can also pass in any options that are valid for Cordova-sqlite-storage, such as `location`,
`androidDatabaseImplementation`, etc.:

```js
var db = new PouchDB('mydb.db', {
  adapter: 'cordova-sqlite',
  iosDatabaseLocation: 'Library',
  androidDatabaseImplementation: 2
});
```

If you want to use the legacy `_pouch_mydb.db` format (with the `_pouch_` prefix), then do this:

```js
var PouchAdapterCordovaSqlite = require('pouchdb-adapter-cordova-sqlite');
cordovaSqlitePlugin.use_prefix = true; // use the legacy '_pouch' prefix
PouchDB.plugin(PouchAdapterCordovaSqlite);
var db = new PouchDB('mydb.db', {adapter: 'cordova-sqlite'});
```


text:
# Wasserstein BiGAN

PyTorch implementation of bidirectional generative adversarial network ([BiGAN](https://arxiv.org/abs/1605.09782), a.k.a. [ALI](https://arxiv.org/abs/1606.00704)) trained using Wasserstein distance (see [WGAN](https://arxiv.org/abs/1701.07875) and [WGAN-GP](https://arxiv.org/abs/1704.00028)). The code has been tested in a conda environment with Python 3 and PyTorch >= 1.0.

## Overview
This repository contains code for training BiGAN on SVHN, CIFAR-10 and Celeba datasets. Our implementation is different from the original BiGAN/ALI implementation in the following ways:

* We normalize pixel values to [-1, 1].
* Our training objective is Wasserstein distance, not Jenson-Shannon divergence. Our model hence has a critic network instead of a discriminator network.
* The critic network does **NOT** use normalization layers (batch norm, instance norm, etc.). We found that training fails if we incorporate normalization into the critic network.
* We apply gradient penalty to stablize training.

## Quick Start
* Update the loading and saving paths.
* Check (and update) the hyperparameters.
* Train on SVHN
```shell
python ./wali_svhn.py
```
* Train on CIFAR-10
```shell
python ./wali_cifar10.py
```
* Train on Celeba
```shell
python ./wali_celeba.py
```
* Interpolate between two randomly generated images
```shell
python ./interpolate.py --ckpt=[model path] --n=[number of interpolations] --save-path=[saving path]
```

## Results
All models are trained using default hyperparameter settings for 20,000 iterations. Note that the network architectures and training procedures are not carefully optimized for best performance.

* SVHN (32 x 32)

Generation            |  Reconstruction
:-------------------------:|:-------------------------:
![](https://raw.githubusercontent.com/fmu2/Wasserstein-BiGAN/master/results/svhn_gen.png)  |  ![](https://raw.githubusercontent.com/fmu2/Wasserstein-BiGAN/master/results/svhn_rec.png)

* CIFAR-10 (32 x 32)

Generation            |  Reconstruction
:-------------------------:|:-------------------------:
![](https://raw.githubusercontent.com/fmu2/Wasserstein-BiGAN/master/results/cifar10_gen.png)  |  ![](https://raw.githubusercontent.com/fmu2/Wasserstein-BiGAN/master/results/cifar10_rec.png)

* Celeba (aligned, 64 x 64)

Generation            |  Reconstruction
:-------------------------:|:-------------------------:
![](https://raw.githubusercontent.com/fmu2/Wasserstein-BiGAN/master/results/celeba_gen.png)  |  ![](https://raw.githubusercontent.com/fmu2/Wasserstein-BiGAN/master/results/celeba_rec.png)

We finally show the interpolation results for ten sets of randomly generated images.

![](https://raw.githubusercontent.com/fmu2/Wasserstein-BiGAN/master/results/intp.png)

## Contact
[Fangzhou Mu](http://pages.cs.wisc.edu/~fmu/<EMAIL_ADDRESS>
## Related Code Repositories
* BiGAN <https://github.com/jeffdonahue/bigan>
* ALI <https://github.com/IshmaelBelghazi/ALI>
* WGAN <https://github.com/martinarjovsky/WassersteinGAN>
* WGAN-GP <https://github.com/igul222/improved_wgan_training>

## References
```
@inproceedings{donahue2016adversarial,
  title={Adversarial feature learning},
  author={Donahue, Jeff and Kr{\"a}henb{\"u}hl, Philipp and Darrell, Trevor},
  booktitle={International Conference on Learning Representations (ICLR)},
  year={2017}
}

@inproceedings{dumoulin2016adversarially,
  title={Adversarially learned inference},
  author={Dumoulin, Vincent and Belghazi, Ishmael and Poole, Ben and Mastropietro, Olivier and Lamb, Alex and Arjovsky, Martin and Courville, Aaron},
  booktitle={International Conference on Learning Representations (ICLR)},
  year={2017}
}

@inproceedings{arjovsky2017wasserstein,
  title={Wasserstein gan},
  author={Arjovsky, Martin and Chintala, Soumith and Bottou, L{\'e}on},
  booktitle={International Conference on Machine Learning (ICML)},
  year={2017}
}

@inproceedings{gulrajani2017improved,
  title={Improved training of wasserstein gans},
  author={Gulrajani, Ishaan and Ahmed, Faruk and Arjovsky, Martin and Dumoulin, Vincent and Courville, Aaron C},
  booktitle={Advances in neural information processing systems (NeurIPS)},
  year={2017}
}
```


text:
# Estimote Mirror iOS SDK

[Estimote Mirror]: http://blog.estimote.com/post/150398268230/launching-estimote-mirror-the-worlds-first

[![CocoaPod Version](https://cocoapod-badges.herokuapp.com/v/EstimoteMirror/badge.png)](http://cocoapods.org/pods/estimotemirror)
[![Apache License 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))

*This SDK allows you to take control of the big screen from your iOS app with [Estimote Mirror][]*.

**Main features:**

* *Building Mirror experience based on mobile SDKs* - you can start prototyping your first Mirror application, using only mobile Display SDK. There is no need to upload any code or resources upfront to the Mirror.

* *Pre-defined views* - No need to design your first Mirror app view. iOS Mirror SDK lets you define customized screens based on pre-defined views; All you need to do is to declare basic styling and data.

* *Feedback from Mirror screen to mobile* - Whenever any display action is triggered, your mobile app gets notified about it. You can handle successful screen change and perform further actions inside your mobile app.

Please check the rest of README to get further details.

We really appreciate your [feedback about our SDKs](#your-feedback-and-questions), thank you!

# Table of Contents

* [Installation](#installation)
* [Quick start](#quick-start)
* [Your feedback and questions](#your-feedback-and-questions)
* [Changelog](#changelog)
* [License](#license)

# Installation

## Prerequisities
* 1 [Estimote Mirror][] w/ **1.0.15+** firmware version.
* An account in [Estimote Cloud](https://cloud.estimote.com/).
* An iOS device with Bluetooth Low Energy support. We suggest using iOS 10.0+ (on iPhone 5s or newer).

## Pod

Install via [CocoaPods](https://cocoapods.org/):
- `$ pod init` in the project root directory
- Edit your Podfile to include the following repositories under your project target
~~~
  pod 'EstimoteMirror'
  pod 'EstimoteBluetoothScanning'
  pod 'EstimoteProximitySDK'
~~~
- `$ pod install`

## Obtain app credentials from Estimote Cloud

To obtain Estimote Cloud credentials for your mobile application:

1. Log in to your [Estimote Cloud](https://cloud.estimote.com/) account.
2. Go to *Apps* section and click `Add new app` option.
3. Select `Your own app` option.
4. Save your *App Id/App Token* credentials.

# Quick start

Here is simple example for showing Poster View on the screen, when user appears in Mirror nearby range.

```Swift
// Declare mirrorClient and proximityObserver as class properties
let mirrorClient = MirrorClient(appID: "", appToken: "")
var proximityObserver: EPXProximityObserver!

// Inside you class implementation
// Prepare your customized Poster View
let sneakersBanner = Poster() { p in

    p.header = "Exceptional traction\nfrom your first to final mile"
    p.body = "Now 20% off!"
    p.image = .preloaded(path: "shoe_big.jpg")

    p.style = PosterStyle() { ps in

        ps.imagePosition = Position(horizontal: .center, vertical: .top(offset: 80))
        ps.textPosition = Position(horizontal: .center, vertical: .bottom(offset: 80))
        ps.textAlign = .center
        ps.headerFontSize = .percent(130)
    }
}

// Initialize your Estimote Cloud credentials
let credentials = CloudCredentials(appID: "", appToken: "")

// Build ProximityObserver with Cloud credentials
self.proximityObserver = ProximityObserver(credentials: credentials, onError: { error in

    print("\(error)")
})

// Define near proximity zone
let mirrorZone = ProximityZone(tag: "mirror", range: ProximityRange.near)
mirrorZone.onEnter = { zoneContext in

    print("Enter mirror")
    self.mirrorClient.display(sneakersBanner, onMirror: zoneContext.deviceIdentifier)
}
mirrorZone.onExit = { zoneContext in

    print("Exit mirror")
}

// Start proximity observation
self.proximityObserver.startObserving([mirrorZone])
```

Zone monitoring is based on Estimote Proximity SDK - the most reliable signal-processing technology.

To get more details, you can check out README for [iOS-Proximity-SDK](https://github.com/Estimote/iOS-Proximity-SDK).

# Your feedback and questions

At Estimote we believe in open feedback! Here are some common ways to share your thoughts with us:

* Posting issue/question/enhancement on [our issues page](../../../issues).
* Asking our community managers on our [Estimote SDK for Android forum](https://forums.estimote.com).

# Changelog

To see what has changed in recent versions of our SDK, please visit [our releases page](../../../releases).

# License

[Apache 2.0](../license.txt)

repository: Estimote/iOS-Mirror-SDK

gha_language: Swift

repo_name: Estimote/iOS-Mirror-SDK


text:
---
title: Put example
method: PUT
url: "{{API_URL}}/items/:id"
---

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

```param:path
- name: "id"
  type: "int"
  required: true,
  description: "ID"
```

```param:body
- name: "name"
  type: "string"
  required: true,
  description: "First and last name"
```

```request:cURL
curl --location --request PUT '{{API_URL}}/items/:id' \
--header 'Content-Type: application/json' \
--data-raw '{
	"name": "other example",
}'
```

```request:Python
import requests

url = "{{API_URL}}/items/:id"

payload = "{\"name\": \"other example\"}"
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
```

```response:200
{
	"success": true
}
```

```response:402
{
	"error": "name is required"
}
```

```response:404
{
	"error": "item not found"
}
```

url: https://raw.githubusercontent.com/vaneves/apirus/f9c607215264ed46910571a1e6ecfeab723e53a4/docs/01 - Requests Example/02 - Put example.md

repository: vaneves/apirus

filename: 02 - Put example.md

gha_language: PHP

repo_name: vaneves/apirus


text:
# Performance Tests with a large instance

As required by the checklist the Scrum Poker app is tested on a [large instance](https://confluence.atlassian.com/enterprise/jira-data-center-size-profiles-955171062.html).
This instance is created using [Data Generator for Jira](https://marketplace.atlassian.com/apps/1210725/data-generator-for-jira?hosting=server&tab=overview) and has the following sizing:

## Sizing

* Issues	1530046
* Projects	977
* Users	17057
* Custom Fields	913
* Workflows	300
* Groups	8040
* Comments	6210973
* Permission Schemes 200
* Issue Security Schemes 300

repository: codescape/jira-scrum-poker

gha_language: Java

repo_name: codescape/jira-scrum-poker


text:
# Eat-Da-Burger

This is a restaurant app that lets users input the names of burgers they’d like to eat. Whenever a user submits a burger’s name, your app will display the burger on the left side of the page — waiting to be devoured. Each burger in the waiting area also has a Devour it! button. When the user clicks it, the burger will move to the right side of the page. Your app will store every burger in a database, whether devoured or not.

## Getting Started

Download the repository using your preferred method:

```
Option #1 (SSH): git@github.com:paichunwang/Eat-Da-Burger.git
Option #2 (HTTPS): https://github.com/paichunwang/Eat-Da-Burger.git
Option #3 (ZIP): https://github.com/paichunwang/Eat-Da-Burger/archive/master.zip
```

## Prerequisites

```
Requirement #1: A heroku account that can host the files
Requirement #2: ClearDB Heroku extension added on the heroku account to serve as database
Requirement #3: Edits made to the dotenv.example.txt to establish connections to Heroku's ClearDB

```

### Installing

Once cloned or downloaded using your preferred method in 'Getting Started', open the eat-da-burger file with the terminal of your choice. While in the root folder, run the command "npm install", this will install all package dependency required to run this application. Then *rename* dotenv.example.txt to ".env" furthermore, if deployment to a web-service, please follow the deployment method below, otherwise include the database credential inside the .env file to establish connection to the localhost database.

## Testing Phase

To test this functionality,
1. open the eat-da-burger app either locally with "npm start" or on a web-service.
2. Enter the the burger name on the left column to be devoured.
3. Once render for the burger appears on the right, click Devour it! to remove it from the page.

## Deployment

1. download the whole repository.
2. create and enter all the required key in the .env file. *Refer to the "INSTALLING" for .env setup and structure.

## Built With

* [HTML](https://www.w3.org/standards/webdesign/htmlcss) - the language for describing the structure of Web page.
* [Bootstrap MAXCDN 3.3.7](http://blog.getbootstrap.com/2016/07/25/bootstrap-3-3-7-released/) - version of bootstrap used to dynamically format HTML webpages.
* [VSCode](https://code.visualstudio.com/) - free code editor that is used to redefine and optimize for the building and debugging modern web and cloud applications.
* [Node.js](https://nodejs.org/en/) - JavaScript runtime built on Chrome's V8 JavaScript engine.
* [Heroku](https://www.heroku.com/) - Cloud platform as a service supporting several programming languages.

## Contributing

This webpage with build under the aid and instruction of affiliated instructors at the [UTAUS201805FSF4-Class Coding BootCamp](https://techbootcamps.utexas.edu/coding/).

## Authors

* **Patrick Wang** - [Firebase-Train-RPS](https://github.com/paichunwang/Firebase-Train-RPS)

## License

This project is licensed under the MIT License - see the [MIT License](https://opensource.org/licenses/MIT) website for details

## Acknowledgments

[Antonio Gage](https://github.com/antoniojgage) - help with initial development and structure/refinement of github pages and files.

repository: paichunwang/Eat-Da-Burger

repo_name: paichunwang/Eat-Da-Burger


text:
# haskell-src-exts-qq: quasiquote Haskell

[![Build Status](https://travis-ci.org/mboes/haskell-src-exts-qq.svg?branch=master)](https://travis-ci.org/mboes/haskell-src-exts-qq)
[![Hackage](https://img.shields.io/hackage/v/haskell-src-exts-qq.svg)](https://hackage.haskell.org/package/haskell-src-exts-qq)

Write programs that generate Haskell programs much more concisely and
legibly. This package supports:

* Antiquotations, denoted by stealing the splice syntax of Template
Haskell, for example:
    ```Haskell
    [hs| $x ++ $(Hs.strE "bar") |]
    ```
Splices may not nested.

* Antiquoting pattern variables in patterns, using double parentheses.
For instance:
    ```Haskell
    let x = Hs.name "n"
    in [hs| \ ((x)) -> $(Hs.Var (Hs.UnQual x)) + 1 |]
    ```

* Antiquoting bound names. Names that are antiquoted appear surrounded
by double underscores. For instance:
    ```Haskell
    let f = "incr"
        fE = Hs.Var $ Hs.UnQual $ Hs.name f
    in [hs| let __f__ x = x + 1 in $fE 10 |]
    ```

We need three different syntaxes for antiquotations, because we do not
extend the [haskell-src-exts][haskell-src-exts] parser in any way and
the Template Haskell splicing syntax is only available in expression
contexts.

[haskell-src-exts]: http://hackage.haskell.org/package/haskell-src-exts

repository: mboes/haskell-src-exts-qq

gha_language: Haskell

repo_name: mboes/haskell-src-exts-qq


text:
## [Unreleased]

## [19.9.0] - 2019-09-04
  - Added the **tenable-sc-get-all-scan-results** command, which retrieves all the scan results in Tenable SC.
  - Added the **Port** and **Protocol** fields to the **Hosts** output in the **get-vulnerability** command.

## [19.8.2] - 2019-08-22
  -

repository: cloudshark/content

repo_name: cloudshark/content


text:
+++
type = "post"
date = "2017-09-19"
title = "Types and Programming Languages"
tags = ["programming", "types"]
draft = true
+++

In the previous article I wrote about different styles of programming and how
each style influences how we model our application. In this article I will write
about dynamic and statically typed languages.

<!--#### Type-->
<!--At an abstract level, a type is a constraint which defines the set of valid -->
<!--values which conform to it. In programming languages, types are typically used-->
<!--to both classify values, and to determine the valid operations for a given type.-->

#### Type Systems
_Type system_ is a collections of rules for checking the _consistency_ of
programs. The fundamental purpose of a type system is to prevent the occurrence
of _execution errors_ during the running of a program.

Programming languages can be grouped in to two distinct categories -

  * __Untyped__ - no checks are done to validate the consistency of the
  program. Examples: Assembly languages
  * __Typed__ - languages various checks are either during the compile time and/or at
  run-time for consistency

Typed languages are further classified into

  * _Statically_ typed languages
  * _Dynamically_ typed languages

There are other terms that are associated with type systems - strongly typed,
weakly typed, safe, sound and duck typing

repository: vijayanant/fossick

repo_name: vijayanant/fossick


text:
# SimonGameJQ
Simon Game using mostly JQuery Library

** Play here ==> https://bilalsarimeseli.github.io/SimonGameJQ/.

** Built using HTML, CSS, JavaScript, and JQuery.

JavaScript produces random sequence of colors and user test his/her memory by clicking on the buttons, following the patterns and levelling up.

Please feel free to add any comment, contribute on open-source and contact me at<EMAIL_ADDRESS>

### SCREENSHOT

![image](https://github.com/bilalsarimeseli/SimonGameJQ/blob/master/Screen%20Shot%202020-05-03%20at%203.08.11%20PM.png?raw=true)

repository: bilalsarimeseli/SimonGameJQ

repo_name: bilalsarimeseli/SimonGameJQ


text:
// Databricks notebook source exported at Sun, 19 Jun 2016 02:59:22 UTC

# [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)

### prepared by [Raazesh Sainudiin](https://nz.linkedin.com/in/raazesh-sainudiin-45955845) and [Sivanand Sivaram](https://www.linkedin.com/in/sivanand)

*supported by* [![](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/images/databricks_logoTM_200px.png)](https://databricks.com/)
and
[![](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/images/AWS_logoTM_200px.png)](https://www.awseducate.com/microsite/CommunitiesEngageHome)

This is an elaboration of the [Apache Spark 1.6 mllib-progamming-guide on mllib-data-types](http://spark.apache.org/docs/latest/mllib-data-types.html).

# [Overview](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/000_MLlibProgGuide)

## [Data Types - MLlib Programming Guide](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/000_dataTypesProgGuide)

-   [Local vector](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/001_LocalVector) and [URL](http://spark.apache.org/docs/latest/mllib-data-types.html#local-vector)
-   [Labeled point](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/002_LabeledPoint) and [URL](http://spark.apache.org/docs/latest/mllib-data-types.html#labeled-point)
-   [Local matrix](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/003_LocalMatrix) and [URL](http://spark.apache.org/docs/latest/mllib-data-types.html#local-matrix)
-   [Distributed matrix](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/004_DistributedMatrix) and [URL](http://spark.apache.org/docs/latest/mllib-data-types.html#distributed-matrix)
    -   [RowMatrix](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/005_RowMatrix) and [URL](http://spark.apache.org/docs/latest/mllib-data-types.html#rowmatrix)
    -   [IndexedRowMatrix](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/006_IndexedRowMatrix) and [URL](http://spark.apache.org/docs/latest/mllib-data-types.html#indexedrowmatrix)
    -   [CoordinateMatrix](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/007_CoordinateMatrix) and [URL](http://spark.apache.org/docs/latest/mllib-data-types.html#coordinatematrix)
    -   [BlockMatrix](/#workspace/scalable-data-science/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/008_BlockMatrix) and [URL](http://spark.apache.org/docs/latest/mllib-data-types.html#blockmatrix)

MLlib supports local vectors and matrices stored on a single machine, as
well as distributed matrices backed by one or more RDDs. Local vectors
and local matrices are simple data models that serve as public
interfaces. The underlying linear algebra operations are provided by
[Breeze](http://www.scalanlp.org/) and [jblas](http://jblas.org/). A
training example used in supervised learning is called a “labeled point”
in MLlib.

Labeled point in Scala
-------------

A labeled point is a local vector, either dense or sparse, associated
with a label/response. In MLlib, labeled points are used in supervised
learning algorithms.

We use a double to store a label, so we can use
labeled points in both regression and classification.

For binary classification, a label should be either `0` (negative) or `1`
(positive). For multiclass classification, labels should be class
indices starting from zero: `0, 1, 2, ...`.

A labeled point is represented by the case class
[`LabeledPoint`](http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.mllib.regression.LabeledPoint).

Refer to the [`LabeledPoint` Scala docs](http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.mllib.regression.LabeledPoint)
for details on the API.

```scala

//import first
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.regression.LabeledPoint

```
```scala

// Create a labeled point with a "positive" label and a dense feature vector.
val pos = LabeledPoint(1.0, Vectors.dense(1.0, 0.0, 3.0))

```
```scala

// Create a labeled point with a "negative" label and a sparse feature vector.
val neg = LabeledPoint(0.0, Vectors.sparse(3, Array(0, 2), Array(1.0, 3.0)))

```

***Sparse data in Scala***

It is very common in practice to have sparse training data. MLlib
supports reading training examples stored in `LIBSVM` format, which is
the default format used by
[`LIBSVM`](http://www.csie.ntu.edu.tw/~cjlin/libsvm/) and
[`LIBLINEAR`](http://www.csie.ntu.edu.tw/~cjlin/liblinear/). It is a
text format in which each line represents a labeled sparse feature
vector using the following format:

    label index1:value1 index2:value2 ...

where the indices are one-based and in ascending order. After loading,
the feature indices are converted to zero-based.

[`MLUtils.loadLibSVMFile`](http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.mllib.util.MLUtils$)
reads training examples stored in LIBSVM format.

Refer to the [`MLUtils` Scala docs](http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.mllib.util.MLUtils)
for details on the API.

```scala

import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.mllib.util.MLUtils
import org.apache.spark.rdd.RDD

//val examples: RDD[LabeledPoint] = MLUtils.loadLibSVMFile(sc, "data/mllib/sample_libsvm_data.txt") // from prog guide but no such data here - can wget from github

```

## Load MNIST training and test datasets

Our datasets are vectors of pixels representing images of handwritten digits.  For example:

![Image of a digit](http://training.databricks.com/databricks_guide/digit.png)
![Image of all 10 digits](http://training.databricks.com/databricks_guide/MNIST-small.png)

```scala

display(dbutils.fs.ls("/databricks-datasets/mnist-digits/data-001/mnist-digits-train.txt"))

```
```scala

val examples: RDD[LabeledPoint] = MLUtils.loadLibSVMFile(sc, "/databricks-datasets/mnist-digits/data-001/mnist-digits-train.txt")

```
```scala

examples.take(1)

```

Display our data.  Each image has the true label (the `label` column) and a vector of `features` which represent pixel intensities (see below for details of what is in `training`).

```scala

display(examples.toDF) // covert to DataFrame and display for convenient db visualization

```

The pixel intensities are represented in `features` as a sparse vector, for example the first observation, as seen in row 1 of the output to `display(training)` below, has `label` as `5`, i.e. the hand-written image is for the number 5.  And this hand-written image is the following sparse vector (just click the triangle to the left of the feature in first row to see the following):
```
type: 0
size: 780
indices: [152,153,155,...,682,683]
values: [3, 18, 18,18,126,...,132,16]
```
Here
* `type: 0` says we hve a sparse vector.
* `size: 780` says the vector has 780 indices in total
 * these indices from 0,...,779 are a unidimensional indexing of the two-dimensional array of pixels in the image
* `indices: [152,153,155,...,682,683]` are the indices from the `[0,1,...,779]` possible indices with non-zero values
  * a value is an integer encoding the gray-level at the pixel index
* `values: [3, 18, 18,18,126,...,132,16]` are the actual gray level values, for example:
  * at pixed index `152` the gray-level value is `3`,
  * at index `153` the gray-level value is `18`,
  * ..., and finally at
  * at index `683` the gray-level value is `18`

***
***
Labeled point in Python
-------------
A labeled point is represented by
[`LabeledPoint`](http://spark.apache.org/docs/latest/api/python/pyspark.mllib.html#pyspark.mllib.regression.LabeledPoint).

Refer to the [`LabeledPoint` Python
docs](http://spark.apache.org/docs/latest/api/python/pyspark.mllib.html#pyspark.mllib.regression.LabeledPoint)
for more details on the API.

```scala

%py
# import first
from pyspark.mllib.linalg import SparseVector
from pyspark.mllib.regression import LabeledPoint

# Create a labeled point with a positive label and a dense feature vector.
pos = LabeledPoint(1.0, [1.0, 0.0, 3.0])

# Create a labeled point with a negative label and a sparse feature vector.
neg = LabeledPoint(0.0, SparseVector(3, [0, 2], [1.0, 3.0]))

```

***Sparse data in Python***

[`MLUtils.loadLibSVMFile`](http://spark.apache.org/docs/latest/api/python/pyspark.mllib.html#pyspark.mllib.util.MLUtils)
reads training examples stored in LIBSVM format.

Refer to the [`MLUtils` Python docs](http://spark.apache.org/docs/latest/api/python/pyspark.mllib.html#pyspark.mllib.util.MLUtils)
for more details on the API.

```scala

%py
from pyspark.mllib.util import MLUtils

# examples = MLUtils.loadLibSVMFile(sc, "data/mllib/sample_libsvm_data.txt") #from prog guide but no such data here - can wget from github
examples = MLUtils.loadLibSVMFile(sc, "/databricks-datasets/mnist-digits/data-001/mnist-digits-train.txt")

```
```scala

examples.take(1)

```

# [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)

### prepared by [Raazesh Sainudiin](https://nz.linkedin.com/in/raazesh-sainudiin-45955845) and [Sivanand Sivaram](https://www.linkedin.com/in/sivanand)

*supported by* [![](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/images/databricks_logoTM_200px.png)](https://databricks.com/)
and
[![](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/images/AWS_logoTM_200px.png)](https://www.awseducate.com/microsite/CommunitiesEngageHome)

license: Unlicense

repository: SheperoMah/scalable-data-science

gha_license_id: Unlicense

repo_name: SheperoMah/scalable-data-science


text:
MSearch: A personalised movie search engine
================================
###Author Information

>
- Name: Weiwei SUN, Monash University
- Mail<EMAIL_ADDRESS>- Home: <wwsun.github.com>

###Project Introduction
MSearch is a personalized search engine which integrate with several real world web services. Clients send their requests to the MSearch server, and then the requests will be handled. Based on different request types, requests will make MSearch Server consumes different web services. For example, Alice want to get some relevant images about her favorite movie Inception, he could use the MSearch Image Search service, after type the keywords, the query will be sent to the MSearch server, and then sent to Flickr for requesting the relevant images, that is to say, the actual work is done on the servers in Flickr. The home page of MSearch is shown in Figure 1.

![MSearch Homepage](/img/homepage.png "Figure 1: MSearch homepage")

The system architecture of MSearch is shown in Figure 2. In the center part is MSearch server, which handles the requests form user clients. Five child modules are comprised in MSearch, including Local search for popular movie detail, Image Search integrated with Flickr API, Video Search integrated with YouTube API, Content Search integrated with Google API, and also a simple Sentiment Analysis integrated with Viraheat API. Each function have a counterpart web service provided by different corporations. It is important to note that the Movie Detail is developed by ourselves, consuming the RESTful web service provided by MovieDB Server, all data stored in a MySQL database.

![MSearch arch](/img/arch.png "Figure 2: MSearch architecture")


text:
---
layout: post
title:      "Lessons Learned: Week 10"
date:       2019-04-30 12:27:24 -0400
permalink:  lessons_learned_week_10
---

This past week, my most frequent errors were all from my sinatra routes.

Long story short - I thought I was being RESTful, and I wasn't.

Sometimes I would confuse the new and create action.
Sometimes I got mixed up between my new page and my edit action.
Sometimes I wouldn't properly set the HTML forms to patch or delete.

The most helpful thing for me to do was to extract information from the Learn.co lessons, and make my own cheat sheet.
This allowed me to be more familiar with the appropriate code and purpose of each action.

Below is my cheat sheet:

***

GET    '/articles'    index action    index page to display all articles

get '/articles' do

  @articles = Article.all

  erb :index

end

GET        '/articles/new'          new action      displays create article form

get '/articles/new' do
  erb :new
end

POST    '/articles'      create action    creates one article

post '/articles' do

  @article = Article.create(:title => params[:title], :content => params[:content])

  redirect to<EMAIL_ADDRESS>end

GET        '/articles/:id'    show action      displays one article based on ID in the url

get '/articles/:id' do
  @article = Article.find_by_id(params[:id])
  erb :show
end

GET    '/articles/:id/edit'    edit action    displays edit form based on ID in the url

get '/articles/:id/edit' do  #load edit form
    @article = Article.find_by_id(params[:id])
    erb :edit
  end

*Note: for patch or put: make sure to make it so that the params are specific that it is saving. if you just do params,
it will spaz out because there is no method variable*

PATCH    '/articles/:id'    update action    modifies an existing article based on ID in the url. like repainting.

patch '/articles/:id' do #edit action

  @article = Article.find_by_id(params[:id])

  @article.title = params[:title]

  @article.content = params[:content]

  @article.save

  redirect to<EMAIL_ADDRESS>end

make sure your form has this & use Rack::MethodOverride in application controller above all controllers

PUT    '/articles/:id'    update action   replaces an existing article based on ID in the url. completely starts with a new article.

DELETE    '/articles/:id'    delete action   deletes one article based on ID in the url

delete '/articles/:id/delete' do #delete action

  @article = Article.find_by_id(params[:id])

  @article.delete

  redirect to '/articles'

end

remember the hidden input field

extension: markdown


text:
## Event

The contract between event implementations and Collector

## FutureListener

event handler for a future completion

## FutureCompletion

internal class that binds a listener to a future

## EventContext

Captures the current context, base class for all event source implementations

## Future

The base class for value objects

## FutureWait

Synchronization point for a Future.)

## Queue

A simple FIFO

## CollectorExecutor

Fire events one by one with no locks held

## Collector

An active queue of events. Each event will fire sequentially, one by one. Multiple instances of Collector are not serialized with eachother and may run in parallel.

## TimeoutListener

Timeout expiry handler

## TimeoutExpiry

Timeout expiry event

## Timeout

Timeout

## TLSContextInitializer

internal

## Context

The logical stack for async stuff.

## TLSInitializer

## TLS

## Mutex

## Lock

## Condition

repository: bozzzzo/quark

repo_name: bozzzzo/quark


text:
# Below are the progressive processes of how the building was constructed.
* Bush clearing. The bush clearing ..........
* Gathering of materials for example pit......
* Foundation setting The foundation...........
![](https://github.com/pato-baba/tomato-plantation-1/blob/main/img/4.jpg)


text:
# Beep boop

Beep boop is a little framework for building “if this then that” automation
for projects hosted on GitHub.

You can use it to make your own [GitHub Action][gh-actions], describing how your
project should be automated.

It is very much in beta, so that we can can test it out in [unified][].
Oh about tests: there are no tests (yet).

Beep boop consists of two parts: beep and boop

## Beep

Beep is the task runner.
You give it tasks, beep runs them, and handles recursion (GH Actions isn’t
recursive but we are).

Here is an example:

```yaml
- if: on:post-opened
  then: add-labels:phase/new
```

The above file defines a single **task**.
The task has a **condition**: if a post (issue or pull request) is opened.
And an action: add certain labels to that post.

A more complex task is:

```yml
- if: on:post-labeled:no/duplicate
  then:
    - remove-labels:no/{external,invalid,question,wontfix}
    - comment:no,no-duplicate
    - unminimize-comments:no
    - sleep:30s
    - if-not: marked-as-duplicate
      then: comment:no-duplicate-maintainers
```

Which in prose does the following when a certain label is applied:

*   remove certain labels
*   post a new, or update an existing, comment
*   show that comment (this makes sense because a different task minimizes it)
*   wait a while
*   if the post is not marked as a duplicate: post/update another comment

You can code your own conditions and actions, or you can use the built-in boop.

## Boop

Boop defines several conditions and actions.
It’s rather opinionated and currently pretty limited, because for now beep boop
is only made to handle unified’s issue tracker.

You can make your own boop!
A condition is just a function resolving to a boolean.
And an action is also only a function that does whatever.

## Install

[npm][] (currently not published, but you can get the repo):

```sh
npm install wooorm/beep-boop
```

## Use

```js
var fs = require('fs')
var yaml = require('js-yaml')
var beep = require('beep-boop')

beep({tasks: yaml.load(String(fs.readFileSync('tasks.yml')))})
```

### Action

The above code can be made into a [GitHub Action][gh-actions].
GH Actions in JavaScript must be bundles.
You can bundle the code up with [`@vercel/ncc`][ncc] (after installing the used
dependencies):

```sh
ncc build index.cjs -o .github/actions/my-action --license license
```

This example creates a [local action][gh-action-location], but you might want to
put it in its own repo.

For the action to work, it needs an [`action.yml`][gh-action-yml] file.

Minimum action.yml

```yml
inputs:
  repo-token:
    description: Token for the repository. Can be passed in using {{secrets.GITHUB_TOKEN}}
    required: true
runs:
  using: node12
  main: index.cjs
```

### Workflow

Next, you need a workflow in the repos you want to be automated that runs your
action.
Workflows can be added to `.github/workflows`.

Example bb.yml workflow to act on all issue and PR events

```yml
name: bb
on:
  issues:
    types: [opened, reopened, edited, closed, labeled, unlabeled]
  pull_request_target:
    types: [opened, reopened, edited, closed, labeled, unlabeled]
jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2 # Needed if your action is local
      - uses: ./.github/actions/my-action # Assuming local
        with:
          repo-token: ${{secrets.GITHUB_TOKEN}}
```

### Automation

The last thing to do is define your automation.
With the above set up, a `tasks.yml` file is expected that defines beep boop
automation.
Put that file in the place where you build your action from.
For example:

```yml
- if: on:post-opened
  then: close-post
```

The above makes sure that any opened issue or PR is immediately closed!
There, problem solves: open source is now scalable. 💪

[npm]: https://docs.npmjs.com/cli/install

[unified]: https://unifiedjs.com

[gh-actions]: https://github.com/features/actions

[gh-action-location]: https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/about-actions#choosing-a-location-for-your-action

[gh-action-yml]: https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions

[ncc]: https://github.com/vercel/ncc

repository: unifiedjs/beep-boop-beta

detected_licenses: MIT ISC Apache-2.0

repo_name: unifiedjs/beep-boop-beta


text:
## Set up Stripe production keys

* In Stripe with admin access grab the live key and secret from account -> keys
* Create application.production.yml based on application.staging.yml,it should have a production hash similar to the staging hash from the staging one. Paste the Stripe keys in here.

## Other production Rails config

* Check these all exist and contain sensible stuff
    * config/application.production.yml
    * config/database.production.yml
    * config/deploy/production.rb
    * config/environments/production.rb

## Create production & staging EC2 instance

* Log in to AWS and go to EC2
* Select Launch
    * Select instance type, probably you want t2.small, hit Next
    * Configure instance details: 2 instances, default network, any subnet, enable public IP, everything else default, hit Next
    * Add storage: Size 16GB, general SSD, everything else as default, hit Next
    * Tags: I don't use these, hit next
    * Security groups: select existing, select default, hit review and launch
    * Hit launch
    * Keypairs: choose create new

## Create production & staging RDS instance

* Log in to AWS and go to RDS
* Select Launch
    * Select instance type, probably you want t2.micro
    * General SSD 20 GB, no Multi Availability (unless you want otherwire, but it's very expensive, so is the provisioned IOPS)
    * Instance identifier: *app*-staging, username: *app*, click next
    * VPC group default, subnet default, public: probably no, VPC: choose create new. It should be a group allowing the access only from ec2 security group
    * database_name: *app*-staging,

## Getting access to the server

1. Find your created keypair
2. Move keypair file `***.pem` to ~/.ssh/ folder
3. Run `chmod 400 ~/.ssh/***.pem` so that only you can have access to the file
4. Open `~/ssh/config` and add following text to that:
```
Host app-stage
  HostName <IP_ADDRESS> # IP of your EC2 stage instance
  User deploy
  IdentityFile ~/.ssh/***.pem # keypair file name
  ControlMaster auto
  ForwardAgent yes

Host app-prod
  HostName <IP_ADDRESS> # IP of your EC2 production instance
  User deploy
  IdentityFile ~/.ssh/***.pem # keypair file name
  ControlMaster auto
  ForwardAgent yes
```

Add your public key to Git system you are using. To get public key from private key run `ssh-keygen -y -f ~/.ssh/***.pem`.
Then run from within project folder

```
ssh-add ~/.ssh/***.pem
```

You should run this if you have problems with accessing git.

Then go to EC2 security groups find default ec2 group and add inbound rule for ssh and also http and https inbound for Anywhere

5. Now you can connect with command `ssh ubuntu@app-stage`

## Setting up EC2 instance from scratch

1. Connect to EC2 instance as root user using `ssh ubuntu@app-stage`
2. Install software
```
sudo apt-get update
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev runit emacs libpq-dev nginx nodejs npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
```

3. Add `deploy` user
```
sudo adduser deploy
sudo passwd -l deploy
```

4. Add `deploy` user to sudoers file so it can make some capistrano commands without prompt.
```
sudo visudo
```

Add deploy user under root, then to exit vim and save - hit Ctrl+X, then Y, Enter.
```
root    ALL=(ALL:ALL) ALL
deploy  ALL=(ALL:ALL) NOPASSWD:ALL
```

4.1 Switch to `deploy` user and install ruby for `deploy` user

```
sudo su - deploy

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.5.0 # Your ruby version
rbenv global 2.5.0

echo "gem: --no-document" > ~/.gemrc
gem install bundler
```

4.2 Create folder for app
```
sudo mkdir /srv/[ app name ]
sudo chown deploy /srv/[ app name ]
```

5. Copy ssh keys, so you can `ssh` under that user.

```
mkdir .ssh
sudo cp /home/ubuntu/.ssh/authorized_keys ~/.ssh/
sudo chown deploy ~/.ssh/authorized_keys
```

Now you, and capistrano, can ssh into server under `deploy` user with a `ssh<EMAIL_ADDRESS>command.

5.1 Run next commands:
```
sudo mkdir /etc/nginx/ssl/
sudo openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
sudo rm /etc/nginx/sites-enabled/default
bundle config github.https true
echo 'cd /srv/[ app name ]/current' >> ~/.bashrc
```

6. Fill next files:
```
config/application.production.yml # Do not commit this file into git
config/database.production.yml # Do not commit this file into git
config/deploy/production.rb
```

7. Exit from server. Edit your `config/deploy/***.rb` capistrano file to disable SSL for a while.
```
set :nginx_use_ssl, false
```

Next, run several capistrano commands on your local machine from within rails project directory.
If you get `You are trying to install in deployment mode after changing
your Gemfile. Run bundle install elsewhere and add the
updated Gemfile.lock to version control.` error, just run `bundle config github.https true` as `deploy` user on remote server.

```
bundle exec cap production setup
git add .
git commit -m 'Deploy'
git push origin master
bundle exec cap production deploy
```

8. Login to the server and run these commands on server to handle SSL encryption
```
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx

sudo certbot certonly --nginx -d www.your_domain.com -d api.your_domain.com -d app.your_domain.com
```

9. Exit from server. Edit your `config/deploy/***.rb` capistrano file to enable SSL back.
```
set :nginx_use_ssl, true
```

And provision server
```
bundle exec cap production setup nginx:reload
```

### Email setup

1. Set up the inbox email at<EMAIL_ADDRESS>according to this instruction https://github.com/arithmetric/aws-lambda-ses-forwarder

## Create production & staging Elasticache instance
* Log in to AWS and go to Elasticache
* Click on Get Started Now
    * Redis should be Cluster Engine selected
    * name: *app*-staging,
    * Select node type, probably you want cache.t2.micro
    * VPC group create new, use a VPC that has the port selected in inbound, if none exists, add the selected port(6379 the default) to inbound rule.
    * Mark at least one subnet.

### Congratulations 🎉, you're done!

gha_language: Ruby


text:
---
layout: post
date:   2012-01-07
title:  "Find the Next Available Working Day using T-SQL"
permalink: ./blog/index.php/2012/01/find-the-next-available-working-day-using-t-sql/
categories: blog
published: true
tags: [Code Samples, Database Design, T-SQL Programming, datetime, Development, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2]
comments: false
---
A while ago I helped a colleague develop a T-SQL function that would increment a date by an integer value and return the first working day following and closest to the resulting date.  The requirements were not complex - a date is incremented by a number of days and the next working date identified.  The only complexity was how to make sure that the date did not fall on a weekend or "non-working" days such as public or national holidays.

The first step would be to have a table that stores what I will call non-working days.  The table was filled with samle data which incidentally are Maltese Public and National holidays (obtained from the [Department of Information - Malta](http://www.doi.gov.mt/en/archive/publicholidays/pholidays12.asp) website).    Further checks verify whether the date falls on a weekday, and if the date is one of the pre-defined non-working days.  If either of these conditions fail the date is incremented further by another day.  These checks are repeated until the calculated date is valid.

``` sql
CREATE FUNCTION [dbo].[fn_NextWorkingDay] (@StartDate as datetime, @NoDays int)
RETURNS datetime
AS
BEGIN
    IF (@StartDate IS NULL) OR (@NoDays IS NULL)
        RETURN NULL;

    DECLARE @NextDate datetime;
    DECLARE @DateFound bit;

    SET @DateFound = 0;
    -- increase the @StartDate by the @NoDays value to reduce iterations
    -- from the below
    SET @NextDate = DATEADD(d, @NoDays, @StartDate);

    WHILE (@DateFound = 0)
    BEGIN
        -- if the date is between Mon and Fri
        IF DATEPART(weekday, @NextDate) IN (2,3,4,5,6)
        BEGIN
            IF EXISTS(
                SELECT 1 FROM dbo.tb_nonworkingdays WHERE nwd_date = @NextDate)
            BEGIN
                -- add one day if the date is a Public/National holiday
                SET @NextDate = DATEADD(d, 1, @NextDate); -- add one day
            END
            ELSE
            BEGIN
                -- the next date has been identified
                SET @DateFound = 1;
            END
        END
        ELSE
        BEGIN
            -- if the date is NOT between Mon and Fri (i.e. falls on a weekend)
            SET @NextDate = DATEADD(d, 1, @NextDate); -- add one day
        END
    END

    RETURN (@NextDate);
END
GO
```

As you can see the function is quite simple. The functionality can be extended further for other business areas and rules, such as for example:

* In the catering inductry both checks for weekdays and holidays would probably not apply;
* Most hair salons in Malta work Tuesdays to Saturdays;
* Teachers' non-working days include the Easter, Summer and Christmas periods (not that they don't work during these days...);
* The function can be made to exclude an employee's vacation leave bookings.

Other than that I'm sure it is a good starting point for the above-mentioned scenarios, or more.

gha_language: HTML


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

### Description

tecrail Responsive FileManager 9.13.4 allows remote attackers to delete an arbitrary file as a consequence of a paths[0] path traversal mitigation bypass through the delete_file action in execute.php.

### POC

#### Reference
- https://www.exploit-db.com/exploits/45987

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
## Foundation DB tuple layer in golang without C-GO dependencies

### FDB Tuple layer
Is a cross language standarized binary packing for arbitrary data where packed bytes have predictable byte sort order. Meant to build keys in a key/value store.

### Why
The packing is usefull in most byte ordered key value store to create key spaces. This fork only removes the dependency of c-go which foundation db bidings ships with.

### Details
See official foundation db documentation

https://apple.github.io/foundationdb/developer-guide.html#namespace-management
https://godoc.org/github.com/apple/foundationdb/bindings/go/src/fdb/tuple

repository: Zatte/fdbtuple

repo_name: Zatte/fdbtuple


text:
# Topic

> 食物外送好好賺？紐約外送員現身說法 (Can You Make a Living as a Delivery App Bike Messenger?)

> But despite this, Frankie sees plenty of upsides.

> 儘管如此，Frankie 還是有看到這個工作的一些優點。

[![Image](https://cdn.voicetube.com/assets/thumbnails/2I0fxeeI1sg.jpg)](https://www.youtube.com/embed/2I0fxeeI1sg?rel=0&showinfo=0&cc_load_policy=0&controls=1&autoplay=1&iv_load_policy=3&playsinline=1&wmode=transparent&start=202&end=206&enablejsapi=1&origin=https://tw.voicetube.com&widgetid=1)

Host: Winnie Liao

Today issue: Happy Halloween guys!

[Host record](https://cdn.voicetube.com/tmp/everyday_records/callmeboss901/3631.mp3)

## learning points
1. _
	* despite [dɪˋspaɪt] (prep.) 不管；儘管；無論
		- I still had a great time despite the accident.
			+ 儘管發生事故，我仍然過得很愉快。

2. _
	* plenty [ˋplɛntɪ] (n.)  豐富；充足；大量
		- plenty of food
		- There's plenty of fish in the sea.
			+ 海裡有很多魚。

3. _
	* upside [ˋʌpˋsaɪd] (n.) 優點；好處；有利的一面
		- <=> downside
		- The upside of traveling in January and September this year is that the tickets are cheaper.
			+ 今年一月和九月旅行的好處是票價便宜。
		- => Most of time when people are getting hurt it's because they think that they can do they can just do what they see everyone else is doing and it's not necessarily true.


text:
## Generic Parsor for Tab separated files

This is a script that parses a list of tab separated data files and appends them into a JSON data object

The script can be adapted by editing the configuration variables at the top.

1. VARIABLENAMES : the list of the column names & their types (current types supported : number, text, boolean).

2. DELIMINER : can alter the deliminer used in the file.

3. FILENAME_PATTERN : specifies the files that are going to be used.

4. EXTRACT_FILENAME_PATTERN : used to extract the filename from the extension.

5. INPUT_FILETYPE : specified the extension of the file described by the data file.

## Use

1. `./tab2JSON.py <input_folder> <output_filename>`

## Dependencies

Python 3 needs to be installed (might work with 2.7 but not tested).

## Sample output structure

```json
{
  "/path/to/file/filename.wav": [
    {
      <columns dictionary>
    }
  ],
  "/path/to/file/filename.wav": [
    {
       <columns dictionary>
    }
  ]
}
```

input & output samples in the data folder.

repository: nhamilakis/erec

repo_name: nhamilakis/erec


text:
---
{
  "title": "Pixel Recurrent Neural Networks",
  "date": "2016-01-25",
  "authors": [
    "A. Oord",
    "Nal Kalchbrenner",
    "K. Kavukcuoglu"
  ],
  "abstract": "Modeling the distribution of natural images is a landmark problem in unsupervised learning. This task requires an image model that is at once expressive, tractable and scalable. We present a deep neural network that sequentially predicts the pixels in an image along the two spatial dimensions. Our method models the discrete probability of the raw pixel values and encodes the complete set of dependencies in the image. Architectural novelties include fast two-dimensional recurrent layers and an effective use of residual connections in deep recurrent networks. We achieve log-likelihood scores on natural images that are considerably better than the previous state of the art. Our main results also provide benchmarks on the diverse ImageNet dataset. Samples generated from the model appear crisp, varied and globally coherent.",
  "links": [
    {
      "resource": "PDF",
      "icon": "pdf",
      "url": "https://arxiv.org/pdf/1601.06759.pdf"
    },
    {
      "resource": "arXiv.org",
      "icon": "arxiv",
      "url": "https://arxiv.org/abs/1601.06759"
    },
    {
      "resource": "Semantic Scholar",
      "icon": "semanticscholar",
      "url": "https://www.semanticscholar.org/paper/41f1d50c85d3180476c4c7b3eea121278b0d8474"
    }
  ],
  "supervision": [],
  "tasks": [],
  "methods": [],
  "thumbnail": "pixel-recurrent-neural-networks-thumb.jpg",
  "card": "pixel-recurrent-neural-networks-card.jpg",
  "s2_paper_id": "41f1d50c85d3180476c4c7b3eea121278b0d8474"
}
---

repository: virtualgraham/unsupervisedpapers

repo_name: virtualgraham/unsupervisedpapers


text:
# nginxapp
This repository provides a simple web app based on **nginx:alpine**.  It runs in a Docker container or a Kubernetes cluster. The initial version comes with just one static "index.html" file in the the "/app" folder.

## Running the app in simple Docker container.
The script "app.sh" provides common Docker commands. Type "./app.sh" for help.
The first section of the script defines global variables.

````bash
# 1. Set variables
REPO="mkuegeler/nginxapp:latest"
IMAGE="nginx-alpine-image"
CONTAINER="nginx-alpine-container"
HOST="localhost"
INTERNAL_PORT="80"
EXTERNAL_PORT="8081"
````

Update the variables IMAGE, CONTAINER, HOST, EXTERNAL_PORT according your custom environment.

## Running the application on Kubernetes
Requirements
 - A Kubernetes cluster (i.e. Docker Desktop)
 - Helm

### 1. Create a helm chart

```bash
helm create nginxweb
```
Note: you can use a custom name instead of 'nginxweb'.

### 2. Customize values.yaml
Open the file "values.yaml" in directory "nginxweb".

In "values.yaml", update the image keys to reference the nginx image:

```yaml
image:
  repository: mkuegeler/nginxapp
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: "latest"
```

### 4. Validate the chart
 Run the chart through the linter to ensure that your template is well-formed.

````bash
helm lint ./nginxweb
````

### 3. Install chart
Run "helm install" to deploy the application:

````bash
helm install nx-example ./nginxweb --set service.type=NodePort
````
"nx-example" is the name of your deployment.

The output of helm install displays a handy summary of the state of the release, what objects were created, and the rendered NOTES.txt file to explain what to do next. Run the commands in the output to get a URL to access the service and pull it up in your browser.

````bash
NAME: nx-example
LAST DEPLOYED: Tue Sep  8 13:38:14 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
  export NODE_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services nx-example-nginxweb)
  export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}")
  echo http://$NODE_IP:$NODE_PORT
````

### 4. Run the application
 Run the commands in the NOTES to get a URL to access our application.

````bash
export NODE_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services nx-example-nginxweb)
````

````bash
export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}")
````

````bash
echo http://$NODE_IP:$NODE_PORT
````

### 5. Delete the service
If you want to delete the service, type:

````bash
helm delete nx-example
````

repository: shubhambhagwat/nginxapp

repo_name: shubhambhagwat/nginxapp