text:
# Favorites

Plugin for [fman.io](https://fman.io) that gives you the ability to setup a list of favorite directories to go to.

You can install this plugin by pressing `<shift+cmd+p>` to open the command pallet. Then type `install plugin`. Look for the `favorite` plugin and select it.

After restarting **fman**, you will have the ability to set favorite directories, go to them, set path shorteners, remove path shorteners, remove favorites, and set/go to four directory locations kept in memory.

## Usage

### HotKeys Set

<Shift+f>  - Set a new Favorite directory. This makes the current directory in the active pane a favorite directory.

<Ctrl+f> - Remove a Favorite Directory.

<Ctrl+0> - Go to a Favorite Directory.

<Ctrl+1> - Pop up first previous directory.

<Ctrl+2> - Pop up second previous directory.

<Ctrl+3> - Pop up third previous directory.

<Ctrl+4> - Pop up fourth previous directory.

<Ctrl+5> - Pop up fifth previous directory.

<Ctrl+6> - Pop up sixth previous directory.

<Ctrl+7> - Pop up seventh previous directory.

<Ctrl+8> - Pop up the eighth previous directory.

<Cmd+1> - Set the first directory memory to the current panel's directory.

<Cmd+2> - Set the second directory memory to the current panel's directory.

<Cmd+3> - Set the third directory memory to the current panel's directory.

<Cmd+4> - Set the fourth directory memory to the current panel's directory.

<Alt+1> - Set the current panel to go to the first directory memory location.

<Alt+2> - Set the current panel to go to the second directory memory location.

<Alt+3> - Set the current panel to go to the third directory memory location.

<Alt+4> - Set the current panel to go to the fourth directory memory location.

### Commands

`Go To Favorite` - This command will display a list of favorites by their assigned names for the user to choose from. As you type letters in the name, the list is shortened. Once one is selected, the current panel is moved to that directory.

`Go To Favorite Pair` - This command will display a list of favorite directory pairs by their assigned name. When the user selects one, the left and right directories will be set as saved.

`Remove Favorite Directory` - This command will remove the selected favorite directory.

`Remove Favorite Directory Pair` - This command will remove the selected favorite directory pair.

`Set Favorite Directory` - This command sets the currently highlighted directory as a favorite. If the path contains a shortener's path, then it will be shortened to that shorener's name in double brackets.

`Set Favorite Dirctory Pair` - This command sets a left and right directory structure to save.

`Set Shorten Directory` - This command asks the user for a shortener name and creates a new shortener to that directory.

`Remove Shortener Directory` - This command removes a shortener directory from the shortener list. It then expands the shortener in all the favorites that had that shortener.

`Go to hot dir` - This command set the current panel to the directory store in the memory location specified in the dirNum argument. The default is 0.

`Set hot dir` - This command set the current panel to the directory store in the memory location 1 specified in the dirNum argument. The default is 0.

`pop directory` - This command pops to the previous directory.

### Files Created and Used

`~/.favoritedirs` - This file contains all of your favorite directories. Each line is the assigned name, a "|" symbol, and the path to the directory. If the path contains a directory in the `~/.shorenerdirs` file, then the path is removed and a placeholder is inserted instead.

`~/.shortenerdirs` - This file contains all the shortener directories and their names. It is in the same format as the `~/.favoritedirs` file. Once you create this file, copy it to your Dropbox location and link it back to this location. Now you can share your favorites between systems.

`~/.favoritepairs` - This file contains all the pair of directories stored.

### Suggested Usage

Once you install the plugin, set up your shortener directories. I setup one for each of my Dropbox locations. Then, create your favorites in the shorteners subdirectories. Once you have the favorites setup, move your `~/.favoritedirs` to your Dropbox location you want and  link to the original location and name. On the second system, setup the same shortener file using the same names and link the synced favoritedirs file to the normal location. Now you can go to the favorite directories inside these shortener directories easily! They also automatically update when you add new ones.

You can also save and restore directory locations in the internal memory. There are four memory locations set aside to use. Very useful for saving a location, going somewhere else, and then popping right back to the previous location. These locations are lost when exiting fman.

### Features

- The ability to set a favorite directory.
- The ability to go to a favorite directory.
- The ability to set a favorite directory pair.
- The ability to go to a favorite directory pair.
- Remove a favorite directory.
- Remove a favorite directory pair.
- Set up directories as shorteners with a name. Then all paths under that directory will be set to the shortener's name and expanded to that path when going to it. This gives the ability to share favorites between system just using the paths in common.
- There are four memory locations to set directory values that can be easily recalled as well. Store from any panel and restore to any panel.
- The ability to backtrack previously visited directories. Not panel specific.

repository: raguay/favorites

repo_name: raguay/favorites


text:
# What BERT Sees: Cross-Modal Transfer for Visual Question Generation

## Implementation

An official implementation of the code including T5 models for VQA/VQG can be find [here](https://github.com/hwanheelee1993/t5vqa)(soon publicly available).

## Results

For reproductibility purpose, we also make available the outputs used to compute the metrics in the [paper](https://drive.google.com/file/d/1XD4bsTK8QLHFjX1LHfN607W9vNMhJXk8/view?usp=sharing).

## Citation

```
@inproceedings{scialom2020bert,
  title={What BERT Sees: Cross-Modal Transfer for Visual Question Generation},
  author={Scialom, Thomas and Bordes, Patrick and Dray, Paul-Alexis and Staiano, Jacopo and Gallinari, Patrick},
  booktitle={Proceedings of the 13th International Conference on Natural Language Generation},
  pages={327--337},
  year={2020}
}
```

license: MIT

repository: ThomasScialom/BERT-can-see

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: ThomasScialom/BERT-can-see


text:
---
title: "Phoenix & React Channels"
cover: "https://unsplash.it/1280/500/?random?BoldMage"
author: "david"
date: "03/06/2018"
category: "tech"
tags:
    - programming
    - react
    - elixir
    - phoenix
    - channels
---

I finally found a nice excuse for messing around with Phoenix channels. I decided to start saving the deckstring whenever a user exports a deck in [hearthdecks](https://netdeck.xyz), this will be a pretty straighforward implementation. For an actual tutorial I recommend the official Phoenix docs on [Channels](https://hexdocs.pm/phoenix/Phoenix.Channel.html), they are very well done.

## Server Side

First thing we do is create a new socket module that uses Phoenix.Socket, phoenix automatically generates a UserSocket file that I edited to match below. We want to make sure the channel that we're defining is pointing to our new channel module that we'll add next. Important to note that the first argument "room" is known as the topic, if you have multiple channels you can do use a wildcard like: "room:\*" here, and then in your channel module do something like "room:" <> room_id to ensure you are matching correctly.

```elixir
defmodule HearthdecksWeb.DeckSocket do
  use Phoenix.Socket

  ## Channels
  channel("room", HearthdecksWeb.DeckChannel)

  ## Transports
  transport(:websocket, Phoenix.Transports.WebSocket)

  def connect(_params, socket) do
    {:ok, socket}
  end

  def id(_socket), do: nil
end
```

Next we'll create our new DeckChannel module, this will be what is handling any messages sent from the client. The first argument "room" in our join function is the topic, it matches with the channel we defined in our socket module, and also what we'll be initializing our channel connection to from React. All we need to do is return :ok, along with the socket info.

handle_in/3 takes an event command that is a string, "create_deck", and our deckstring value. By letting us use pattern matching on the string, its easy to to have multiple handle_in functions that all perform different operations. Handle_in then calls create_deck/1 to save the deckstring to the DB. The client doesn't care since about the operation in this use case so we're just returning :noreply.

```elixir
defmodule HearthdecksWeb.DeckChannel do
  use HearthdecksWeb, :channel
  alias Hearthdecks.Data

  def join("room", _params, socket) do
    {:ok, socket}
  end

  def handle_in("create_deck", deckstring, socket) do
    Data.create_deck(%{deckstring: deckstring})
    {:noreply, socket}
  end
end
```

## Client Side

Onwards to our React frontend. First thing we need to do is create a new socket.js file, we just need to import Socket from phoenix and add the following. A lot of this is generated by Phoenix as well.

```js
import { Socket } from "phoenix"

let socket = new Socket("/socket")
socket.connect()

export default socket
```

Our implementation is going to all go in one React component that is handling the deck exports, a better way to do this would be to wrap the functionality in a Higher order Component or in your middleware and then call any pushes to your channel in a reducer.

First off, make sure you import socket from socket.js. We've created setPhoenixChannel() that we're going to call in componentDidMount(), this function is going to call socket.channel, notice we're pass in "room", which matches with our "room" topic in phoenix modules. We're going to stash away channel in our components state so we can reference it when we actually want to transport our data.

Finally, when we are generating a deck string for a user, we grab channel in our components state, and push a message that has our desired event, "create_deck", and the created deckstring. If we wanted to do something based on success or not we could handle that in receive.

```js
// import the socket.
import socket from "../../socket.js"

export default class ExportDeck extends React.Component {
// ... a bunch of other normal component stuff.

// run a function that joins the phoenix channel after the component mounts.
componentDidMount() {
    this.setPhoenixChannel()
}

// create a function that joins the channel and set the channel in the components state.
setPhoenixChannel() {
    let channel = socket.channel("room", {})
    this.setState({ channel: channel })

    channel.join()
}

// whenever a user generates a deckstring we push it to the channel along with the "create_deck" message.
generateDeckString() {
    // ...other deckstring creation stuff.

    this.state.channel
    .push("create_deck", deckstring)
    .receive("ok", resp => {}))
}

}
```

repository: dberget/daveberget

branch_name: refs/heads/master

repo_name: dberget/daveberget


text:
# [cuda](https://en.wikipedia.org/wiki/CUDA)

CUDA computing platform for nvidia cards

## bitsandbytes

> Assuming you have python installed

If a program requires bitsandbytes it's best to compile it locally with the detected cuda version.

Clone bitsandbytes

```sh
git clone https://github.com/TimDettmers/bitsandbytes
cd bitsandbytes
```

Then make and install using pip **while being in the `venv` of the
tool you're using**.

> You can omit the `CUDA_VERSION` environmental variable when using this
> dotmodule as it already defines it in `17-cuda.conf`

```sh
CUDA_VERSION=121 make cuda11x
pip install .
```

> ! You have to reinstall it everytime the target tool overwrites it with a
> ! non-custom built version of bitsandbytes. It's best to completely take it
> ! out of thier requirement.txt and just do it yourself.

repository: AlexAegis/dotfiles

gha_language: Shell

gha_license_id: MIT

repo_name: AlexAegis/dotfiles


text:
Alteryx Tool Generator
===

Overview
---
The Alteryx Tool Generator scaffolds a custom Alteryx Designer tool using the HTML GUI SDK and either the Javascript or Alteryx macro engine.

To use, run the main Node script and answer the prompts to write the needed files.

Features
---
* __Program__: Tool generation script
* __Output__: Alteryx Designer compatible tool

Getting Started
---
- Install the generator using the command line
   1. Clone or download the tool generator repository: [alteryx/alteryx-tool-generator](https://github.com/alteryx/alteryx-tool-generator.git)
   2. Navigate to the directory housing *package.json*
   3. Use `npm install`
- Run the generator
   1. Use `node alteryx-tool-generator.js` to create your new tool
- Access the written tool files
   1. Navigate to the tool directory: *C:\Users\\%USERNAME%\AppData\Roaming\Alteryx\Tools*

Docs
---
* [The Alteryx HTML GUI SDK help page](https://help.alteryx.com/developer/current/index.htm#HTML/Overview.htm)
* [Engine Works Blog Post](https://community.alteryx.com/t5/Engine-Works-Blog/Alteryx-Tool-Generator/ba-p/75216)

Version Support
---

|Technology|Version|
|----------|------:|
|[Alteryx](http://downloads.alteryx.com/)   |   11.5|
|[node](https://nodejs.org/en/download/)      |  6.9.1|
|[npm](https://nodejs.org/en/download/)       | 3.10.8|

Contribute
---
 Contributions, questions, and comments are welcome and encouraged. To contribute code, submit a pull request. To report website-related issues, file a report using the Alteryx Tool Generator [issue tracker](https://github.com/alteryx/alteryx-tool-generator/issues/new).

License
---
* [MIT License](https://github.com/alteryx/alteryx-tool-generator/blob/master/LICENSE)
* Alteryx Copyright 2017

repository: ozzieD/alteryx-tool-generator

repo_name: ozzieD/alteryx-tool-generator


text:
# mrkdwn

By: Baskoro Indrayana

## Description

This is a Markdown previewer I built while learning in FreeCodeCamp. The user will be given two text area:

1. Plain text they create (sample text will be given)
2. Their text formatted in Markdown

**Tools used:** React, npm

## How to run

Preview is available in my [Codepen link](http://codepen.io/baskoroi/full/YZGZXN/).

To run this from your local environment:

1. `npm install` to install all the required packages.
2. `npm start` to start the server which hosts this application.

repository: baskoroi/mrkdwn

repo_name: baskoroi/mrkdwn


text:
# CurlGen

This Swift Package is a μframework for debugging with Swift Foundation's URLRequests, converting them to cURL commands that can easily be copy and pasted to execute or inspect details.

Example:

```sh
(lldb) po request.cURLCommand()

curl -v https://www.github.com -X POST \
--data {"data": {"key": "value"}} \
--header "Accept=application/json" \
--header "Content-Type=application/json"
```

## Prerequisites

- Xcode 11.0 or higher

## Installing

Just add the Swift Package to your Xcode project in Project settings, "Swift Packages."

## License

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

## Acknowledgments

* Inspired by Alamofire's cURL command generator, I wanted something similar, but useable in cases where I didn't use Alamofire.

## TODO
- [ ] Put all urls, headers, and body in single quotes for shell escaping

repository: yhkaplan/CurlGen

repo_name: yhkaplan/CurlGen


text:
---
title: Grilled Skirt Steak With Smoky Eggplant Chutney
date: "2019-08-01T23:46:37.121Z"
template: "post"
draft: false
slug: "/posts/Grilled-Skirt-Steak-With-Smoky-Eggplant-Chutney/"
category: "Crazy Recipes"
tags:
- "AI"
- "John Willoughby And Chris Schlesinger"
description: "A tasty AI-generated recipe. Endorsed by Obama."
socialImage: "https://static01.nyt.com/images/2014/03/05/dining/05steak/05steak-superJumbo.jpg"
---

![](https://static01.nyt.com/images/2014/03/05/dining/05steak/05steak-superJumbo.jpg)

*A heartfelt dinner that will surely put a smile on your face is an easy way to toast this special occasion.*

*Serves 6*
### Ingredients

For the eggplant chutney:

* 4 pounds eggplant, peeled and sliced into wedges

* 2 tablespoons olive oil

* 1 white onion, thinly sliced

* 2 garlic cloves, minced

* 1 1/2 teaspoons dried oregano

* 1 1/2 teaspoons coarse salt

Freshly ground black pepper

* 1/2 cup loosely packed cilantro leaves

* 1/2 cup dark raisins

* 1/2 cup shaved Parmesan cheese

For the grilled skirt steak:

* 2 tablespoons red wine vinegar

* 1 tablespoon Dijon mustard

* 1 1/2 teaspoons minced shallot

* 1 1/2 teaspoons salt

Freshly ground black pepper

* 2 tablespoons vegetable oil

* 1 1/2 pounds skirt steak, trimmed of excess fat
### Directions

1. For the eggplant chutney: Preheat oven to 375 degrees. Place eggplant on a baking sheet. Drizzle eggplant with olive oil and sprinkle with the onion, garlic, oregano, and salt and pepper. Roast until the eggplant is tender when pierced with a knife, about 45 minutes. Remove from oven and set aside to cool. Stir together remaining ingredients and add to eggplant. Cover and refrigerate at least 1 hour.

1. For the grill: Place a charcoal grill or grill pan over medium heat and douse with 1 tablespoon vegetable oil. Grill steak until thoroughly charred on the outside, about 4 minutes, and cooked through, 10 to 12 minutes longer. Lower heat to medium-low and continue to grill for another 2 to 3 minutes. Remove from heat. Set aside. Keep warm. Place 4 tablespoons red wine vinegar and 1 tablespoon mustard in a small bowl. Add salt and pepper and whisk well. Set aside.

1. For the grilled skirt steak: Place oil in a small bowl and add onion and garlic. SautÃ© over low heat until onion is lightly browned, 3 to 4 minutes. Stir in vinegar and mustard and season with salt and pepper. Add steak and toss. Cover and refrigerate for at least 1 hour. Heat grill or charcoal fire until hot and place grill pan over medium heat. Grill until the steak is rare to medium-rare, about 2 to 3 minutes. Turn over and grill about 4 minutes more. Keep warm.

1. Cook's notes: The eggplant chutney can be made up to 2 days ahead. Store covered in the refrigerator in an airtight container.

1. Check back here every Friday for a new recipe and keep up with all of the Times recipes here.

gha_language: Jupyter Notebook


text:
# Advanced techniques in module development

- Ways of storing settings
  - Site settings
  - Content type settings (e.g. Indexing)
  - Content part settings: part-level and type-level settings
- Caching:
  - `ICacheManager` for instance-level caching
  - `ICacheService` for farm-wide caching
- Recipes inside modules

Time requirement: 1h 30m

Dependencies: [Intermediate techniques in module development](IntermediateTechniquesInModuleDevelopment)

Parent topic: [Module development and APIs](./)

repository: Lombiq/Orchard-Dojo-Library

gha_language: Vim Snippet

repo_name: Lombiq/Orchard-Dojo-Library


text:
## Update Insured

This endpoint used to update a insured object. It can update using PUT for full update or PATCH for partial update

> Sample request PUT

```shell
curl "http://localhost:8080/api/insureds/f1466d54-d6bd-4718-9893-3fdba5bce606"
  -X PUT
  -H "Authorization: Bearer <token>"
  -H "Content-Type: application/json"
  -d '{
        "insuredName":"Joe West",
        "insuredAddress":"Bandung",
        "insuredPhone":"0218861234",
        "insuredFax":"12345678",
        "insuredHandphone":"0855778899",
<EMAIL_ADDRESS>      }'
```

> Sample request PATCH

```shell
curl "http://localhost:8080/api/insureds/f1466d54-d6bd-4718-9893-3fdba5bce606"
  -X PATCH
  -H "Authorization: Bearer <token>"
  -H "Content-Type: application/json"
  -d '{
        "insuredAddress":"Bandung"
      }'
```

> Success response

```json
{
    "insuredName": "Joe West",
    "insuredAddress": "Bandung",
    "insuredPhone": "0218861234",
    "insuredFax": "12345678",
    "insuredHandphone": "0855778899",
    "insuredEmail"<EMAIL_ADDRESS>    "_links": {
        "self": {
            "href": "http://localhost:8080/api/insureds/f1466d54-d6bd-4718-9893-3fdba5bce606"
        }
    }
}
```

### HTTP Request

`PUT http://localhost:8080/api/insureds/{insuredId}`

`PATCH http://localhost:8080/api/insureds/{insuredId}`

### URL Parameters

Parameter | Description
--------- | -----------
insuredId | Selected insured id

### Parameters

Parameter | Description | Format
--------- | ----------- | ------
insuredName | Fill with insured name | String
insuredAddress | Fill with insured address | String
insuredPhone | Fill with insured phone | String
insuredFax | Fill with insured fax | String
insuredHandphone | Fill with insured handphone | String
insuredEmail | Fill with insured email | String

repository: davideko/slate

repo_name: davideko/slate


text:
# Identify Dogs

### Table of Contents

1. [Motivation](#motivation)
2. [Libraries Used](#libraries)
3. [File Descriptions](#files)
4. [Instructions](#instructions)
5. [Results](#results)
6. [Licence and Acknowledgements](#license_acknowledgements)

## Motivation

In this project, I built and trained a neural network model with CNN
 (Convolutional Neural Networks) transfer learning, using 8351 dog images of 133 breeds.

 As said in the notebook, the task of assigning breed to dogs from images is
considered exceptionally challenging. There are many dog breed pairs with
minimal inter-class variation. Even with high intra-class variation in dog
breeds like different colored labradors can get challenging to conquer.
This motivated me to try and build a model that could achieve this. And this
 is what I try to build in this project.

I also wrote a companion article which explains the process in details. Read
 it<EMAIL_ADDRESS>

## Libraries Used
- For Machine learning and Neural Networks: Keras, scikit-learn
- For data manipulation and visualization: numpy, matplotlib
- Image processing - OpenCV-python
- Other libraries: pillow, tqdm

## File Descriptions

The project I chose is one of the Udacity suggested projects. The data (dog images) is from Udacity Deep Learning workspace which is huge and I tried but not able to download is. I will include the link of the datasets used in this project in Instructions below.

- `bottleneck_features/DogResnet50Data.npz`: bottleneck features from another
 pre-trained CNN, used in comparing models

    `bottleneck_features/DogVGG16Data.npz`: bottleneck features from another
  pre-trained CNN, used in comparing the models

    `bottleneck_features/DogVGG19Data.npz`bottleneck features from another
  pre-trained CNN, used in comparing the models

- `data/dog_names.csv`: The list of dog names extracted from the input
 dataset.

- `haarcascades/haarcascade_frontalface_alt.xml`: pre-trained face detector
 from keras for function face_detector

- `saved_models/weights.best.Resnet50.hdf5`: saved model weights with the best validation loss using Resnet50 bottleneck features

  `saved_models/weights.best.from_scratch.hdf5`: saved model weights with
    the best validation loss for model created from scratch

  `saved_models/weights.best.VGG16.hdf5`: saved model weights with the best
   validation loss using VGG16 bottleneck features

  `saved_models/weights.best.VGG19.hdf5`: saved model weights with the best
   validation loss using VGG19 bottleneck features

   `saved_models/weights.best.InceptionV3.hdf5`: saved model weights with the
    best validation loss using Inception bottleneck features

- `dog_app.ipynb`: jupyter notebook to showcase work related to the above questions. The notebooks is exploratory in building a Convolutional Neural Networks pertaining to the question showcased by the notebook title. Markdown cells & comments were used to assist in walking through the thought process for individual steps.

- `environment.yml` : Requirements file

- `uploads/*.jpg`: sample images to test the final algorithm

- `extract_bottleneck_features.py`: functions to extract bottleneck features

### Instructions

1. Clone the repository and navigate to the downloaded folder.

```commandline
git clone git@github.com:agpt8/identify-dogs.git
cd identify-dogs
```

2. Download the [dog dataset](https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/dogImages.zip).  Unzip the folder and place it in the repo, at location `path/to/identify-dogs/data/dog_images`.

3. Download the [human dataset](https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/lfw.zip).  Unzip the folder and place it in the repo, at location `path/to/identify-dogs/data/lfw`.  If you are using a Windows machine, you are encouraged to use [7zip](http://www.7-zip.org/) to extract the folder.

4. Download the [VGG-16 bottleneck features](https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/DogVGG16Data.npz) for the dog dataset. Place it in the repo, at location `path/to/identify-dogs/bottleneck_features`.

   Download the [ResNet50 bottleneck features](https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/DogResnet50Data.npz). Place it in the repo
    at location `path/to/identify-dogs/bottleneck_features`.

5. Create (and activate) a new environment.

    ```commandline
    conda env create -f environment.yml
    conda activate identify-dogs
    ```

6. Switch [Keras backend](https://keras.io/backend/) to TensorFlow.
    ```commandline
    set KERAS_BACKEND=tensorflow
    python -c "from keras import backend"
   ```

7. Run the jupyter server and start the notebook `jupyter notebook` and then
 select `dog_app.ipynb`.

## Results

In this project, I went through seven steps in testing and creation of an
 algorithm that would help me identify the breed of dogs and even tell a  resembling breed when a human image is provided.

I first create basic functions that would tell humans and dogs apart.
These functions would use Haar feature-based classifier from OpenCV and pre-trained ResNet50 model from Keras respectively. Using the ResNet50 model familiarized me with the preprocessing steps that are essential in getting the input in proper shape.

Then I created my own CNN model from scratch by preprocessing the images, defining, and architecting the model. Compiling, training, and testing the model is done afterward. These three steps are the same for every model I use here. Do note that I did not use transfer learning yet.

I then go through the process of training a model with transfer learning
. Here the notebook helps us by giving an example of the whole process i.e
. defining, architecting, compiling, training, and testing a model. Using this as a reference, I create my own ResNet50 model using the transfer learning technique. I choose ResNet50 for its accuracy, low computational needs, and simple architecture.

1. The CNN built from scratch to classify dog breeds, and attained the test accuracy about 4.42%.
2. The CNN built using transfer learning, pre-trained VGG-16 model as a fixed feature extractor, attained the test accuracy about 40.43%.
2. The CNN built using transfer learning, pre-trained ResNet50 model as a fixed feature extractor, attained the test accuracy about 82.29%.

Possible improvement can be implement:
1. Add image augmentation to handle different angles, magnitude, position and
 partial obstructions (glasses, masks, etc).
2. Enhance image pre-process step to remove the noise in background. Such as
 irrelevant human or dog or patterns which may affect the prediction.
3. Add the bounding boxes of the detected faces (and detected dog) and only feed the bounding box of the face in the image to the algorithm.
4. Detecting multiple dogs and there breeds. Same when there are multiple humans.
5. When there are human(s) and dog(s) in the same picture, detect the dog's breed(s) and resembling dog breed(s) for the human(s).
6. Using larger datasets for better accuracy.

## Licence and Acknowledgements

The code is shared under Apache 2.0 license.

- Credits must be given to Udacity for the starter codes and pre-computed files used by this project.
- The outline of the article was an inspiration from this one<EMAIL_ADDRESS>- Stackoverflow questions (many of them) and github issues including https://stackoverflow.com/questions/51231576/tensorflow-keras-expected-global-average-pooling2d-1-input-to-have-shape-1-1, https://github.com/keras-team/keras-applications/issues/167
- Course materials gave the idea for model architectures.
- Keras library documentation for ResNet50, VGG19, and other functions


text:
# UF decoder and MWPM decoder

## Conclusion

- They're the same in underlying mechanism, and their difference in decoding threshold (10.9% v.s. 9.8%) may **not** be an evidence of their inequivalence.

## Arguments

### Argument 1: MWPM decoder doesn't have a fixed threshold, even given the same matching graph

There might be some unnoticed arbitrary preference that leads to different decoding threshold of MWPM decoder. A standard MWPM decoder uses Blossom algorithm, which takes a weighted graph as input and output the matching pattern which minimizes the total weight sum. If two matching patterns having exactly the same total weight sum, the Blossom algorithm can give any one of them. I argue, that this arbitrary preference inside the Blossom algorithm can lead to different decoding threshold.

The blossom algorithm takes two inputs:

- the number of nodes `node_num`
- the list of weighted edges `[(a_index, b_index, weight)]`

In a straightforward understanding, it doesn't matter if we change the index of nodes, for example, by reversing all the indexes (`0` -> `node_num-1`, `1` -> `node_num-2`, ..., `node_num-2` -> `1`, `node_num-1` -> `0`) and changing the corresponding weighted edges as well (`[(a_index, b_index, weight)]` -> `[(node_num-1-a_index, node_num-1-b_index, weight)]`). This operation does not change the graph it represents, and it not ever limited in the description of MWPM decoder, so the straightforward understanding is that this operation will not change the decoding threshold, right?

This is not true, after some experiments.

Here is the result before inversing the nodes, d=3 and d=5 intersects at about 10.9%, d=5 and d=7 intersects at about 10.5%.

![](mwpm_decoder_threshold.jpg)

Here is the result after inversing the nodes, d=3 and d=5 intersects at about 9.6%, d=5 and d=7 intersects at about 10.1%.

![](MWPM_reverse_order.jpg)

I admit that the threshold is moving towards each other, and perhaps for enough large code distance, they might converge to a same value. (I will do further experiments to check this out).

But the point here is rather clear: changing the graph representation shouldn't have influence on the decoding accuracy, **but it actually does** (in a reason, for example, Blossom algorithm may choose to add nodes into alternating tree sequentially, so it might have a preference to match nodes in the front. In the original node order, virtual boundary nodes are at the end, so Blossom algorithm tends to match between error nodes, but in the inversed order, virtual boundary nodes are in the front, so Blossom algorithm tends to match error node to the boundary).

The code is below, using an option `feature=MWPM_reverse_order` to reverse the nodes' indices

```rust
pub fn safe_minimum_weight_perfect_matching(node_num: usize, input_weighted_edges: Vec<(usize, usize, f64)>) -> Vec<usize> {
    // reverse the nodes' indices
    let weighted_edges = if cfg!(feature="MWPM_reverse_order") {
        input_weighted_edges.iter().map(|(a, b, cost)| {
            (node_num - 1 - a, node_num - 1 - b, *cost)
        }).collect()
    } else {
        input_weighted_edges
    };
    // normal matching
    let edge_num = weighted_edges.len();
    let mut edges = Vec::with_capacity(2 * edge_num);
    let mut weights = Vec::with_capacity(edge_num);
    for i in 0..edge_num {
        let (i, j, weight) = weighted_edges[i];
        edges.push(i as c_int);
        edges.push(j as c_int);
        assert!(i < node_num && j < node_num);
        weights.push(weight);
    }
    let mut output = Vec::with_capacity(node_num);
    unsafe {
        minimum_weight_perfect_matching(node_num as c_int, edge_num as c_int, edges.as_ptr(), weights.as_ptr(), output.as_mut_ptr());
        output.set_len(node_num);
    }
    let output: Vec<usize> = output.iter().map(|x| *x as usize).collect();
    // recover the nodes' indices
    if cfg!(feature="MWPM_reverse_order") {
        let mut result = output.iter().map(|a| {
            node_num - 1 - a
        }).collect::<Vec<_>>();
        result.reverse();
        result
    } else {
        output
    }
}
```

### update 2022.6.30

The command of reproducing the above results are

```sh

# targeting 1e-3 relative error

cargo run --release -- tool benchmark [3] [0] [0.1] -e4000000 -p0 --decoder mwpm --decoder_config '{"pcmg":true}'
cargo run --release --features MWPM_reverse_order -- tool benchmark [3] [0] [0.1] -e4000000 -p0 --decoder mwpm --decoder_config '{"pcmg":true}'

cargo run --release -- tool benchmark [5] [0] [0.1] -e4000000 -p0 --decoder mwpm --decoder_config '{"pcmg":true}'
cargo run --release --features MWPM_reverse_order -- tool benchmark [5] [0] [0.1] -e4000000 -p0 --decoder mwpm --decoder_config '{"pcmg":true}'

cargo run --release -- tool benchmark [7] [0] [0.1] -e4000000 -p0 --decoder mwpm --decoder_config '{"pcmg":true}'
cargo run --release --features MWPM_reverse_order -- tool benchmark [7] [0] [0.1] -e4000000 -p0 --decoder mwpm --decoder_config '{"pcmg":true}'

cargo run --release -- tool benchmark [9] [0] [0.1] -e4000000 -p0 --decoder mwpm --decoder_config '{"pcmg":true}'
cargo run --release --features MWPM_reverse_order -- tool benchmark [9] [0] [0.1] -e4000000 -p0 --decoder mwpm --decoder_config '{"pcmg":true}'

```

repository: yuewuo/QEC-Playground

gha_language: Python

repo_name: yuewuo/QEC-Playground


text:
[![Build Status](https://travis-ci.org/Tweetsched/tweetsched-linkedin-publisher.svg?branch=master)](https://travis-ci.org/Tweetsched/tweetsched-linkedin-publisher)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)

# tweetsched-linkedin-publisher

REST service for publishing scheduled posts to Linkedin.

## Requirements:
 - Python 3.6 or higher
 - pip

## How to configure:

The service requires that next environmental variables should be setted:
 - SERVICE_KEY
 - SERVICE_PASS
 - CLIENT_KEY
 - CLIENT_SECRET
 - OAUTH_TOKEN
 - OAUTH_SECRET
 - RETURN_URL

## How to run locally:
 - `pip install -r requirements.txt`
 - `pip install --upgrade https://github.com/ozgur/python-linkedin/tarball/master`
 - `python app.py`


text:
Cyclid
======
# Documentation

See http://docs.cyclid.io/en/latest/ for full documentation, including [installation instructions](http://docs.cyclid.io/en/latest/server.html#installation).

# Development

Cyclid is an Open Source project and we welcome contributions. These instructions will help you get your development environment set up to develop & test Cyclid.

## Getting started
```
$ rbenv install 2.3.1
$ bundle install --path vendor/bundle
$ bundle exec rake db:migrate
$ CYCLID_CONFIG=config/development bundle exec bin/cyclid-db-init
```
Cyclid requires a Redis server for Sidekiq; you can either run a Redis server on your local machine or run `bundle exec rake redis` to start one.

You can start Cyclid under Webrick with `bundle exec rake rackup`, and then start Sidekiq with `bundle exec rake sidekiq`, or you can run both under Guard with `bundle exec rake guard`.

The Cyclid development server will run on localhost port 8361, which is the standard Cyclid API port.

`cyclid-db-init` will create sqlite3 database and the initial `admin` user and `admins` group. You'll need to make a note of the HMAC secret that is automatically generated & printed so that you can configure the Cyclid client to connect to your development server.

## Testing

RSpec tests are included. Run `bundle exec rake spec` to run the tests and generate a coverage report into the `coverage` directory. The tests do not affect any databases and external API calls are mocked.

The Cyclid source code is also expected to pass Rubocop; run `bundle exec rake rubocop` to lint the code.

## Documentation

Cyclid uses YARD to generate documentation for both the Ruby API (internal Modules, Classes & Methods) and the REST API. Run `bundle exec rake doc` to generate both sets of documentation. The Ruby documentation is placed in the `doc/api` directory, and the REST API documentation is placed in the `doc/rest` directory.

User documentation is hosted on [Read the Docs](https://readthedocs.org). The source can be found in the [Cyclid-docs](https://github.com/Cyclid/Cyclid-docs) repository.

repository: Cyclid/Cyclid

gha_language: Ruby

repo_name: Cyclid/Cyclid


text:
## Lead Full-stack Engineer

The successful applicant will be part of the front-end team which is responsible for micro-services serving both web applications as well as Restful APIs. The role does not require strong dev-ops skills, however knowledge of best practices in continuous integration and deployment is beneficial.

`<THE PRODUCT DESCRIPTION>`

You will be working on

- Server-side web applications (node, python)
- Restful APIs - OpenApi specification (node, python)
- Client-side web applications (react)
- Data visualization
- Database integration
- Test-driven development and continuous integration

For the right individual, the role will quickly evolve into a team lead position managing three to four server side and client side web developers.

### Requirements

- Degree/Master in computer science or engineering
- Minimum of 2 years of Industry experience in software development
- Python
- Server and client-side javascript (es6)
- Restful API design (OpenAPI specification)
- Database - PostgreSQL - Mongo
- Asynchronous programming
- Docker
- Best practice in TDD and CI
- Can work independently, and as part of a high performing team
- Good communication skills
- Curiosity, drive, enthusiasm, and willingness to roll sleeves up and get stuck in

### Desirable

- Opensource contributions
- Github/bitbucket projects
- React stack
- Start-up experience
- Team leadership and management
- Cloud platforms such as AWS and GCP
- HTTPS & Websockets
- Rust & go languages

repository: quantmind/startup

repo_name: quantmind/startup


text:
---
layout: post
title: On Hiatus
header-img: ""
tags:
author: Will Kirwin
github: ActivisionGameScience
---

<!--excerpt.start-->
Our Game Science team at Activision has recently gone through some personell changes as well as the yearly launch of our biggest title, Call of Duty - Infinite Warfare. Although we are working on more projects with more internal customers than ever, our team is down to about half the size it was last year. As a consequence, producing new content for this blog has, perhaps obviously, fallen by the wayside. Rather than leave the blog in limbo, we've decided to put the blog on official hiatus until we have the bandwidth to give it the love and attention it needs.

In principle, we have a lot of great content to post, but as we try to present content in a way that is relevant to the larger data science world (that is, without use of proprietary internal tooling and/or data sets), it is a significant time investment that we just can't afford right now. Although the blog has been inactive for a few months, it feels appropriate to make it official at the start of the new year and to unofficially put the revival of the Activision Game Science blog on my personal list of goals for 2017.

I'd like to thank all of our readers as well as those who submitted comments and PRs on our posts for actively contributing to the data science community. I wish you all a happy new year and look forward to all the data-driven fun that the future holds.

--Will Kirwin, Activision Game Science Team
<!--excerpt.end-->


text:
---
title: Introducing Ruby 2D
date: 2016-01-01
categories: release
author: blacktm
---

After a few years of experimenting and building prototypes, I’m excited to finally introduce Ruby 2D to the world with a [first beta release](https://github.com/ruby2d/ruby2d/releases/tag/v0.2.0).

Over the next few months, I'll share more about the project and my hopes for it. There's a lot left to do, but first, I just wanted to ship it, get people using it and start giving feedback. So, go on and [try it out](/learn/get-started/)!

Check back here for updates, view the project [on GitHub](https://github.com/ruby2d/ruby2d), and learn how to [contribute](/contribute). You can send feedback directly to [hello<EMAIL_ADDRESS>or tweet me at [@blacktm](https://twitter.com/blacktm).

Enjoy, and happy new year! 🎉

branch_name: refs/heads/gh-pages


text:
# Community
[![Build Status](https://travis-ci.org/pith/community.svg?branch=master)](https://travis-ci.org/pith/community)

A "good accounts make good friends" application.

*This is a work in progress.*

# Run

In order to run REST backend, execute the following commands:

    git clone https://github.com/pith/community.git
    cd community
    mvn spring-boot:run

Then serve the frontend with grunt:

    cd src/main/resources/public
    grunt serve

Then open your browser at [http://localhost:9000/](http://localhost:9000/) to access the w20 app.

The REST API is accessible from [http://localhost:8080/api](http://localhost:8080/api):

* Get the expenses: /api/expenses
* Get the debts: /api/debts

repository: adrienlauer/community

repo_name: adrienlauer/community


text:
# Release procedure

## Precheck

* Review the testing checklist (doc/testing-checklist.md)
* clang-tidy check with something like:
  * `cmake "-DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-11;-checks=-*,clang-analyzer-*,modernize-*,performance-*" ..`
  * `scan-build cmake .. && scan-build make`

## Release

* Run tools/release.sh $OLDVERSION $VERSION
  * Opens an editor to finalize NEWS.md
  * Bumps version numbers everywhere they need bumping
  * Commits changes, tags result with v$VERSION, pushes tag
  * Downloads new tarball and signs it
  * Upload signature to github
* Draft new release at https://github.com/dankamongmen/notcurses/releases
  * Title is "v$VERSION—some quip"
  * That's an em dash (U+2014, UTF-8 e2 80 94), get it right
* Upload new Rust crate with `cargo publish`
* Upload new Python pip with
  * `python3 setup.py sdist`
  * `twine upload dist/*`
* Generate and upload new HTML documentation via `make html`
  * `scp *.html ../doc/man/index.html qemfd.net:/var/www/notcurses/`
* Generate and upload new Doxygen documentation via `doxygen ../doc/Doxyfile`
  * `scp -r html qemfd.net:/var/www/notcurses/`

## Packaging

### Debian

* In gbp repository:
  * Update Debian changelog, if necessary: `dch -v $VERSION+dfsg.1-1`
  * Finalize Debian changelog with `dch -r`
  * Repack DFSG-safe tarball with uscan, upload to github
    * `uscan --repack --compression xz --force`
    * `gpg --sign --armor --detach-sign ../notcurses_$VERSION+dfsg.1.orig.tar.xz`
    * sign, upload dfsg+sig to github
    * import new version: `gbp import-orig ../notcurses_$VERSION+dfsg.1.orig.tar.xz`
    * `git push --tags`
    * build source package: `dpkg-buildpackage --build=source`
    * build binaries: `cd .. && export TERM=xterm-256color && sudo pbuilder build *dsc`
        * perform this in xterm with TERM=xterm-256color
        * beware: freak TERMs won't be present in pbuilder
* Copy `../*notcurses*$VERSION*` to apt repo, import with `reprepro`
* Update Debian changelog with `dch -v $NEXTVERSION-1`
* Update CMakeLists.txt with next version

### Fedora

* In pagure/notcurses master:
  * Update notcurses.spec, bump version, add changelog entry
  * clear out any old ersatz detritus
  * spectool -g notcurses.spec
  * fedpkg upload *.xz *.asc
  * fedpkg new-sources *.xz *.asc
  * fedpkg commit
  * git push
  * fedpkg build
  * fedpkg switch-branch f32
  * git merge master

### Arch

* Upload new AUR information
  * Update `pkgver` and `sha256sums` entries
  * `makepkg --printsrcinfo > .SRCINFO`
  * Test that package builds with `makepkg`
  * `git commit -a`

### FreeBSD

* Update svn checkout of Ports tree: `cd /usr/ports && svn up`
* Upgrade ports: `portupgrade -uap`
* `cd /usr/ports/devel/notcurses`
* Update `DISTVERSION` in `Makefile
* `sudo make makesum`
* `make stage`
* `make stage-qa`
* `portlint`
* `svn diff > ../`make -VPKGNAME`.diff
* File bug on devel/notcurses, attach diff

repository: pepe/notcurses

repo_name: pepe/notcurses


text:
title: What's New
type: guide
order: 2
version: 0.9
---

## Features
* [Caching support for ActiveRecord based resources](resource_caching.html)
* Ids are now fetched through a resource method which delegates to the model
* Requests are now handled internally in one operation.
* Exception backtraces and now configurable instead of defaulting to `!production`.
* Configuration option to whitelist all exceptions.
* Loosens Accept header check to allow header to start with :api_json

## Breaking Changes
* Removed deprecated `updateable` and `createable` methods (note misspellings). Use `updatable` and `creatable` instead.
* Drops support for Rails 4.1
* Requires Ruby 2.1
* Derived resources now use the model name of their base resource, if it is not abstract.
* When using client generated ids, e.g. for GUIDs, the `id` field must be added to the `creatable_fields` method.

And finally there were numerous bug fixes. Full details are in the [Release Notes](https://github.com/cerebris/jsonapi-resources/releases/tag/v0.9.0).


text:
# Lab 6: Spring Expression Language (SpEL)
In this lab we get to learn to play around with the Spring Expression Language (SpEL).

After completing this lab you should know the basic parts of the SpEL.

## Initial code

In the _initial_ project you find the following spring bean classes (PoJo's) to build this application:

* MyCalculatorService: A simple calculator (can do additions and subtractions)
* MySystemInfo: A simple service holding some system information like *user name* or 'java version*'

In addition you also find the following:

* SpELApplication: This is the class to start the application (contains a main() method)
* SpELConfiguration: This is a java application context configuration class for enabling component scan and importing the
additional xml application context
* application.xml: XML application context file containing definition of *MySystemInfo* bean

## Steps to complete

1. Look at the predefined sample SpEL expressions in *SpELApplication* class.

2. Put a SpEL expression in *value* attribute of *application.xml* in the line `<property name="javaVersion" value=""/>`

2. Play around and add more SpEL to learn more language elements. Remember you can add SpEL definitions
to the class *SpELApplication* and in the *application.xml*

***Tip:***
If you need any help then consult the [presentation](https://andifalk.github.io/spring-basics-training/presentation/index.html)
or the [Spring Reference Docs](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#expressions).
If you really have no clue you can always look into the finished reference code in _complete_ sub project

repository: andifalk/spring-basics-training

repo_name: andifalk/spring-basics-training


text:
IRR Non-Authoritative Object Cleanup Analyser
=============================================

A simple tool to show what IRR "Non Authoritative" objects are affected by RPKI ROAs. The motivation behind the tool is to help reduce the amount of RPKI Invalid IRR route objects in the IRR eco-system.

An IRR route object is validated following the Origin Validation procedure as described in [RFC 6811](https://tools.ietf.org/html/rfc6811).
The input into the procedure is the `route:` object's primary key: the prefix and the ASN value of the `origin:` attribute.

A predecessor of this tool facilitated testing the implementation of the [RIPE-731](https://www.ripe.net/publications/docs/ripe-731) policy.

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

`pip3 install irr-nonauth-cleanup`

Use
---

`$ irr-nonauth-cleanup -i ./somedatabase.db.gz`

You can download an assortment of IRR databases from the [RADB](http://radb.net) `ftp://ftp.radb.net/radb/dbase/` public IRR mirror service.

If add `-r YOUR_IRRd_OVERRIDE_PW` as command line arguments, the program will output data in a way that can be piped straight into an email to Legacy IRRd daemons.

```
hanna:~ job$ irr-nonauth-cleanup --help
usage: irr-nonauth-cleanup [-h] [-c CACHE] -i IRR [--afi AFI] [-a ASN]
                           [-p PREFIX] [-r RPSL] [-s STATE] [-v]

optional arguments:
  -h, --help     show this help message and exit
  -c CACHE       Location of the RPKI Cache in JSON format
                 (default: https://rpki.gin.ntt.net/api/export.json)
  -i IRR         Location of the IRR database file
                 (fetch a .db.gz file from ftp://ftp.radb.net/radb/dbase/)
  --afi AFI      [ ipv4 | ipv6 | mixed ]
                 (default: mixed
  -a ASN         Limit searching to this ROA Origin ASN
  -p PREFIX      Search for specific prefix (and all its more-specifics)
  -r RPSL        Specify IRR override password and present invalids in RPSL format for deletion
  -s STATE       RPKI Origin Validation State [ valid | invalid | unknown | all ]
                 (default: invalid)
  -v, --version  show program's version number and exit
```

Example output
--------------

```
VALID: IRR route object "<IP_ADDRESS>/24AS20940" matches ROA <IP_ADDRESS>/24, MaxLength 24, Origin AS20940 (apnic)
NOT-FOUND: IRR route object "<IP_ADDRESS>/24AS20940" is not covered by any ROAs
INVALID!

repository: job/irr-nonauth-cleanup

repo_name: job/irr-nonauth-cleanup


text:
# Vasont Inspire Models Documentation

## Introduction

The GlobalLink Inspire CCMS Models is an open-source connector library, maintained by GlobalLink Vasont in GitHub, that provides the specific class models used within the Vasont Inspire Api and SDK.

The Inspire Web API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). Our API has predictable resource-oriented URLs, accepts [form-encoded request bodies](https://en.wikipedia.org/wiki/POST_(HTTP)#Use_for_submitting_web_forms), in almost all cases returns [JSON-encoded responses](https://www.json.org/), returns [UTF-8](https://en.wikipedia.org/wiki/UTF-8) in most cases, and uses standard HTTP response codes, authentication, and verbs.

Developers who are working within the Inspire Preview environment (Sandbox, Demo, 3rd Party Developers) will work with Preview versions of the API and related SDK versions.

Live Inspire customers will work with [LTS](https://en.wikipedia.org/wiki/Long-term_support) versions of the API and related SDK versions.

## Just Getting Started?

Check out the [SDK Documentation](https://vasont-systems.github.io/Vasont.Inspire.SDK/sdk/Vasont.Inspire.SDK.html)

## Not A Developer?

Use apps and connectors developed by our partners to get started integrating your instance of Inspire with your tools and applications.

## Available Library Platforms

[.NET – Nuget.org](https://nuget.org/Vasont.Inspire.Models)

branch_name: refs/heads/develop

gha_language: C#


text:
---
layout: creature
name: "Armor Plated Beaver"
tags: [medium, beast, cr1, tome-of-horrors]
cha: 4 (-3)
wis: 11 (+0)
int: 5 (-3)
con: 13 (+1)
dex: 11 (+0)
str: 14 (+2)
size: Medium beast
alignment: unaligned
challenge: "1 (200 XP)"
languages: "--"
skills: "Survival +2"
senses: "passive Perception 10"
speed: "20 ft., swim 30 ft."
hit_points: "27 (5d8 + 5)"
armor_class: "17 (natural armor)"
---

***Hold Breath.*** The armor-plated beaver can hold its breath for up to 20
minutes.

***Keen Smell.*** The armor-plated beaver has advantage on Wisdom
(Perception) checks based on scent.

### Actions

***Bite.*** Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 6 (1d8
+ 2) piercing damage.

gha_language: CSS

gha_license_id: NOASSERTION


text:
# loginchecker
This program checks remote logins on a machine. It sends a notification when a logged in user
or his remote address is not set as allowed in the configuration file. You can set an interval
the program checks for logins. It will pause notifications for a detected user within the
configured gracetime.

## configuration
The programm will use `config.yml` in the execution path, you can also set a custom configuration
file by providing the configuration file via commandline argument.

If you leave the mail or slack key empty, no notification will be sent in this channel. There will always
be an output to stdout of the programm. When you want to enable mail or slack notification be sure to
set all configuration params described below. The basic configuration params have to be set in any way.

## basic configuration parameters

### `allowed_adresses` []string
Set allowed addresses and hostnames which are allowed

### `allowed_users` []string
Set allowed users which are allowed to connect to this machine

### `recheck_time` int64
Interval in seconds to check for logins

### `grace_time` int64
Interval in seconds to resend notification for already detected users

## mail configuration params within key `mail`

### `from` string
Mail from address in email notification header

### `from_name` string
Mail from name in email notification header

### `subject` string
Mail subject in email notification, current hostname will be appended

### `recipients` []string
Mail recipients who should get the notifications

## slack configuration params within key `slack`

### `webhook_url` string
Slack webhook URL for incoming webhook

### `channel` string
Channel to send the notification to

### `author` string
Displayed author of notification

### `message` string
Slack message subject,  current hostname will be appended

### `username` string
Displayed username of notification

### `icon_emoji` string
Slack emoji icon of notification

repository: derdanne/loginchecker

repo_name: derdanne/loginchecker


text:
# AndroidReactComponentKit

[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)
[![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16)
[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](http://opensource.org/licenses/MIT)

AndroidReactComponentKit is [ReactComponentKit](https://github.com/ReactComponentKit/ReactComponentKit) for Android. AndroidReactComponentKit is a library for building Activity or Fragment. You can make that based on Components. Also, It uses MVVM and Redux architectures for unidirectional data flow.

## Data Flow

 * (1) : Components dispatch actions
 * (2) : ViewModel passes the actions to the store. You can use beforeDispatch(action:) method to do some work before dispatching actions.
 * (3) : Store passes current state to the Mutation pipeline. Reducers make a new state.
 * (4) : New State comes out from the Mutation pipeline. It is passed to the store.
 * (5) : Store passes the new state to the ViewModel.
 * (6) : ViewModel passes the new state to the Components.

## Components

AndroidReactComponentKit provides four components basically.

 * ViewComponent
 	* ViewComponent is a view. It is an abstraction of the view that makes up the screen as a component. You can use ViewComponent to create a layout of the Activity or Fragment. It can also be used to create an item views in RecyclerView.
 * FragmentComponent
 	* FragmentComponet is a fragment. You can use FragmentComponent when creating an Activity. If you delegate responsibility for an Activity to a FragmentComponent, you can avoid creating a massive Activity.
 * RecyclerViewAdapter
 	* The RecyclerViewAdapter connects ViewComponent and RecyclerView. The RecyclerViewAdapter can use several types of views, but only one LayoutManager can be used.
 * CollectionViewAdapter
 	* The CollectionViewAdapter connects ViewComponent and RecyclerView. Unlike the RecyclerViewAdapter, you can use multiple LayoutManagers. In other words, you can use various LayoutManagers with different types of views.

## Examples

### [Hello Android RCK](https://github.com/ReactComponentKit/HelloAndroidRCK)

 ![](https://raw.githubusercontent.com/ReactComponentKit/HelloAndroidRCK/master/art/result.gif)

### [Hello Android RoomDB](https://github.com/ReactComponentKit/HelloRoom)

 ![](https://raw.githubusercontent.com/ReactComponentKit/HelloRoom/master/art/result.gif)

### [Counter](https://github.com/ReactComponentKit/AndroidReactComponentKit/tree/master/app/src/main/java/com/github/skyfe79/android/library/app/examples/counter2)

 ![](./art/counter.gif)

### [RecyclerView with DiffUtil](https://github.com/ReactComponentKit/AndroidReactComponentKit/tree/master/app/src/main/java/com/github/skyfe79/android/library/app/examples/emojicollection)

 ![](./art/emoji-diffutil.gif)

### [CollectionViewAdapter](https://github.com/ReactComponentKit/AndroidReactComponentKit/tree/master/app/src/main/java/com/github/skyfe79/android/library/app/examples/collectionview)

 ![](./art/collectionviewadapter.gif)

## Setup Gradle

### Project's build.gradle

```groovy
ext.kotlin_version = '1.3.31'
ext.anko_version='0.10.8'
ext.androidx_lifecycle_version='2.0.0'
ext.rxjava2_version='2.2.8'
ext.rxkotlin_version='2.3.0'
ext.rck_version='2.0.4'
```

### App's build.gradle

```groovy
dependencies {
	...
	implementation "io.reactivex.rxjava2:rxjava:$rxjava2_version"
	implementation "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version"
	implementation "org.jetbrains.anko:anko:$anko_version"
	implementation "androidx.lifecycle:lifecycle-extensions:$androidx_lifecycle_version"
	implementation "com.github.skyfe79.android:reactcomponentkit:$rck_version"
}
```

## MIT License

The MIT License (MIT)

Copyright (c) 2016 Sungcheol Kim, [https://github.com/ReactComponentKit/AndroidReactComponentKit](https://github.com/ReactComponentKit/AndroidReactComponentKit)

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

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

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

gha_language: Kotlin


text:
A simple ServiceNow client using Python 2.7.

USAGE:

- Install dependencies
- Add the client directory to your path
- chmod -x searchCMDB
- You should be able to call the script from anywhere e.g searchCMDB SERVERNAME


text:
# CHAPTER 6 | Databases

## Databases 101

_You won't be questioned in the exam about the next sections (up to AWS Databases).
It's just for your knowledge and very good for better understanding the course._

### [What is a relational DataBase](https://www.codecademy.com/articles/what-is-rdbms-sql)

A relational database is a type of database. It uses a structure that allows us to identify and access data in relation to another piece of data in the database. Often, data in a relational database is organized into tables.

### [What is a non relational DataBase](https://www.mongodb.com/scale/what-is-a-non-relational-database)

A non-relational database is any database that does not follow the relational model provided by traditional relational database management systems. This category of databases also referred to as NoSQL databases, has seen steady adoption growth in recent years with the rise of Big Data applications.

### [What is data warehousing](https://en.wikipedia.org/wiki/Data_warehouse)

Is a system used for reporting and data analysis, and is considered a core component of business intelligence.

### [OLTP vs. OLAP](https://www.datawarehouse4u.info/OLTP-vs-OLAP.html)

We can divide IT systems into transactional (OLTP) and analytical (OLAP). In general, we can assume that OLTP systems provide source data to data warehouses, whereas OLAP systems help to analyze it.

### [AWS Databases](https://aws.amazon.com/products/databases/)

### Relations ones

* SQL
* MySQL
* PostgreSQL
* Oracle
* Aurora
* MariaDB

# [Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html)
* Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database
* When you buy a server, you get CPU, memory, storage, and IOPS, all bundled together. With Amazon RDS, these are split apart so that you can scale them independently. If you need more CPU, less IOPS, or more storage, you can easily allocate them.
* Amazon RDS manages backups, software patching, automatic failure detection, and recovery.
* To deliver a managed service experience, Amazon RDS doesn't provide shell access to DB instances. It also restricts access to certain system procedures and tables that require advanced privileges.
* You can have automated backups performed when you need them, or manually create your own backup snapshot. You can use these backups to restore a database. The Amazon RDS restore process works reliably and efficiently.
* You can use the database products you are already familiar with: MySQL, MariaDB, PostgreSQL, Oracle, Microsoft SQL Server.
* You can get high availability with a primary instance and a synchronous secondary instance that you can fail over to when problems occur. You can also use MariaDB, Microsoft SQL Server, MySQL, Oracle, and PostgreSQL read replicas to increase read scaling.
* In addition to the security in your database package, you can help control who can access your RDS databases by using AWS Identity and Access Management (IAM) to define users and permissions. You can also help protect your databases by putting them in a virtual private cloud.
* A security group controls the access to a DB instance. It does so by allowing access to IP address ranges or Amazon EC2 instances that you specify

### RDS Instance Class Types
---
  * CPU optimized
  * Memory optimized
  * Burstable perofmance
* You can change the CPU and memory available to a DB instance by changing its DB instance class

### Amazon RDS storage types
---
* General purpose SSD
  * General Purpose SSD volumes offer cost-effective storage that is ideal for a broad range of workloads
  * Deliver single-digit millisecond latencies and the ability to burst to 3,000 IOPS for extended periods of time
* Provisioned IOPS
  * Provisioned IOPS storage is designed to meet the needs of I/O-intensive workloads, particularly database workloads, that require low I/O latency and consistent I/O throughput
* Magnetic
  * Amazon RDS also supports magnetic storage for backward compatibility

### High availability (Multi-AZ) for Amazon RDS
---
* Amazon RDS provides high availability and failover support for DB instances using Multi-AZ deployments for deployments for MariaDB, MySQL, Oracle, and PostgreSQL DB
* SQL Server DB instances use SQL Server Database Mirroring (DBM) or Always On Availability Groups (AGs)
* Amazon RDS automatically provisions and maintains a synchronous standby replica in a different Availability Zone
* The primary DB instance is synchronously replicated across Availability Zones to a standby replica to provide data redundancy, eliminate I/O freezes, and minimize latency spikes during system backups
* If you have a DB instance in a Single-AZ deployment and modify it to a Multi-AZ deployment
  * Amazon RDS takes a snapshot of the primary DB instance from your deployment
  * then restores the snapshot into another Availability Zone
  * New volumes created from existing EBS snapshots load lazily in the background
  * then sets up synchronous replication between your primary DB instance and the new instance
  * This action avoids downtime when you convert from Single-AZ to Multi-AZ, but you can experience a performance impact during and after converting to Multi-AZ
* **Failover** - In the event of a planned or unplanned outage of your DB instance, Amazon RDS automatically switches to a standby replica in another Availability Zone if you have enabled Multi-AZ

### Billing
---
DB instances are billed on the following components
* DB instance hours (per hour)
* Storage (per GiB per month)
* I/O requests (per 1 millisecond requests per month)
* Provisioned IOPS (per IOPS per month)
* Backup Storage (per GiB per month)
* GB transfer (per month)
* Amazon RDS provides the following purchasing options to enable you to optimize your costs based on your needs:
  * **On-Demand Instances** – Pay by the hour for the DB instance hours that you use. Pricing is listed on a per-hour basis, but bills are calculated down to the second and show times in decimal form. RDS usage is now billed in one second increments, with a minimum of 10 minutes.
  * **Reserved Instances** – Reserve a DB instance for a one-year or three-year term and get a significant discount compared to the on-demand DB instance pricing. Wi

### Security
---
* Run your DB instance in a virtual private cloud (VPC) based on the Amazon VPC service for the greatest possible network access control
* Use AWS Identity and Access Management (IAM) policies to assign permissions that determine who is allowed to manage Amazon RDS resources. For example, you can use IAM to determine who is allowed to create, describe, modify, and delete DB instances, tag resources, or modify security groups
* Use security groups to control what IP addresses or Amazon EC2 instances can connect to your databases on a DB instance. When you first create a DB instance, its firewall prevents any database access except through rules specified by an associated security group
* Use Secure Socket Layer (SSL) or Transport Layer Security (TLS) connections with DB instances running the MySQL, MariaDB, PostgreSQL, Oracle, or Microsoft SQL Server database engines
* Use Amazon RDS encryption to secure your DB instances and snapshots at rest. Amazon RDS encryption uses the industry standard AES-256 encryption algorithm to encrypt your data on the server that hosts your DB instance
* Use network encryption and transparent data encryption with Oracle DB instances; for more information, see Oracle native network encryption and Oracle Transparent Data Encryption
Use the security features of your DB engine to control who can log in to the databases on a DB instance

# [DynamoDB NoSQL](https://aws.amazon.com/dynamodb/)
* Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale.
* It's fully managed.
* Uses SSD storage
* Spread across 3 distinct data centres
* Eventual Consistent Reads (Default)
* Strongly Consistent Reads
* It's scalable
* DynamoDB can be very expensive for writes
* Amazon DynamoDB stores data in partitions. artitions are automatically replicated across multiple AZ's
* DynamoDB automatically particions and re-partitions your table as it grows in size

### DynamoDB Streams

DynamoDB Streams is an optional feature that captures data modification events in DynamoDB tables. The data about these events appear in the stream in near-real time, and in the order that the events occurred.

Each event is represented by a stream record. If you enable a stream on a table, DynamoDB Streams writes a stream record whenever one of the following events occurs:

* A new item is added to the table: The stream captures an image of the entire item, including all of its attributes.
* An item is updated: The stream captures the "before" and "after" image of any attributes that were modified in the item.
* An item is deleted from the table: The stream captures an image of the entire item before it was deleted.
Each stream record also contains the name of the table, the event timestamp, and other metadata. Stream records have a lifetime of 24 hours; after that, they are automatically removed from the stream.

You can use DynamoDB Streams together with AWS Lambda to create a trigger—code that runs automatically whenever an event of interest appears in a stream

### Read Consistency
* **Eventually Consistent Reads** - When you read data from a DynamoDB table, the response might not reflect the results of a recently completed write operation
* **Strongly Consistent Reads** - When you request a strongly consistent read, DynamoDB returns a response with the most up-to-date data, reflecting the updates from all prior write operations that were successful
  * A strongly consistent read might not be available if there is a network delay or outage. In this case, DynamoDB may return a server error (HTTP 500).
  * Strongly consistent reads may have higher latency than eventually consistent reads.
  * Strongly consistent reads are not supported on global secondary indexes.
  * Strongly consistent reads use more throughput capacity than eventually consistent reads

# [RedShift - OLAP - Used for DataWearhouse](https://aws.amazon.com/redshift/)

Amazon Redshift is a fast, scalable data warehouse that makes it simple and cost-effective to analyze all your data across your data warehouse.

Redshift stores data by [colums](https://en.wikipedia.org/wiki/Column-oriented_DBMS).  By storing data in columns rather than rows, the database can more precisely access the data it needs to answer a query rather than scanning and discarding unwanted data in rows. Query performance is increased for certain workloads.

Columnar data stores can be compressed much more than row-based data.

* Single node: You can start with a single node (Up to 160Gb of ram in one node)
* Multi-Node:
  * Leader node: Manages clients and distribute queries
  * Compute nodes: Store data and execute queries (up to 128 computer nodes max)

* Pricing:
  * You are charged for the total number of hours you run across all your compute nodes.
  * You are charged for backups
  * You are also charged for data transfer within a VPC

* Security:
  * Encrypted in transit using SSL
  * Encrypted at rest using AES-256 encryption
  * By default redshift takes care of key management.

* Availability:
  * Is available only in 1 AZ
  * Can restore the snapshot to new AZ's in the event of an outage.

# [RDS Aurora](https://aws.amazon.com/rds/aurora/)

Amazon Aurora is a MySQL and PostgreSQL-compatible relational database built for the cloud, that combines the performance and availability of traditional enterprise databases with the simplicity and cost-effectiveness of open source databases.

* Scaling:
  * Scales in 10GB Increments up to 64TB
  * Compute resources can scale up to 32vCPUs and 244GB of Memory
  * 2 Copies of your data are contained in each availability zone, with a minimum of 3 availability zones
  * Aurora handles the loss of up two to copies of data without affecting database **write** capability
  * Aurora handles the loss of up to three copies of data without affecting database **read** capability

* Replicas:
  * Aurora Replicas: Separate aurora replicas (up to 15 replicas)
  * MySQL Read replicas: (up to 5 replicas).
  * In case of loss of the primary aurora DB, failover will automatically occur on the Aurora replica, it will not in the MySQL read replica.

* Aurora global databases
  * An Aurora global database is a single database that spans multiple AWS Regions
  * enabling low-latency global reads and disaster recovery from any Region-wide outage
  * provides built-in fault tolerance for your deployment because the DB instance relies not on a single AWS Region, but upon multiple Regions and different Availability Zones

* Aurora Serverless
  * Aurora Serverless is an on-demand, auto-scaling feature designed to be a cost-effective approach to running intermittent or unpredictable workloads on Amazon Aurora
  * It automatically starts up, shuts down, and scales capacity up or down, as needed by your applications

* Amazon Aurora connection management
  * Amazon Aurora typically involves a cluster of DB instances instead of a single instance
  * When you connect to an Aurora cluster, the host name and port that you specify point to an intermediate handler called an endpoint
  * Aurora uses the endpoint mechanism to abstract these connections
  * For certain Aurora tasks, different instances or groups of instances perform different roles. For example, the primary instance handles all data definition language (DDL) and data manipulation language (DML) statements
    * Cluster endpoint
      * A cluster endpoint (or writer endpoint) for an Aurora DB cluster connects to the current primary DB instance for that DB cluster
      * Each Aurora DB cluster has one cluster endpoint and one primary DB instance
    * Reader endpoint
      * A reader endpoint for an Aurora DB cluster provides load-balancing support for read-only connections to the DB cluster
      * By processing those statements on the read-only Aurora Replicas, this endpoint reduces the overhead on the primary instance
    * Custom endpoint
      * A custom endpoint for an Aurora cluster represents a set of DB instances that you choose
      * You define which instances this endpoint refers to, and you decide what purpose the endpoint serves
      * An Aurora DB cluster has no custom endpoints until you create one
    * Instance endpoint
      * An instance endpoint connects to a specific DB instance within an Aurora cluster
      * Each DB instance in a DB cluster has its own unique instance endpoint. So there is one instance endpoint for the current primary DB instance of the DB cluster, and there is one instance endpoint for each of the Aurora Replicas in the DB cluster

![](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/AuroraArch001.png)

# Elasticache - In Memeory Caching
  * Redis
  * Memcached

|Database Type|Use Cases|AWS Service|
|--- |--- |--- |
|Relational|Traditional applications, ERP, CRM, e-commerce| Amazon Aurora,  Amazon RDS,  Amazon Redshift|
|Key-value|High-traffic web apps, e-commerce systems, gaming applications|Amazon DynamoDB|
|In-memory|Caching, session management, gaming leaderboards, geospatial applications|Amazon ElastiCache for Memcached, Amazon ElastiCache for Redis|
|Document|Content management, catalogs, user profiles|Amazon DocumentDB (with MongoDB compatibility)|
|Wide-column|High scale industrial apps for equipment maintenance, fleet management, and route optimization|Amazon Keyspaces (for Apache Cassandra)|
|Graph|Fraud detection, social networking, recommendation engines|Amazon Neptune|
|Time series|IoT applications, DevOps, industrial telemetry|Amazon Timestream|
|Ledger|Systems of record, supply chain, registrations, banking transactions|Amazon Quantum Ledger Database|

## [Use Cases]()
Internet scale applications
![](https://d1.awsstatic.com/webteam/category-pages/Databases/category-page-diagram_database_gaming.de2623720c885acfe788a9170db1837129758d8a.png)

Real-time applications
![](https://d1.awsstatic.com/webteam/category-pages/Databases/category-page-diagram_database_caching.959d5429c58d7a59fa08e3484ff7d43b4881ebdc.png)

Opensource application
![](https://d1.awsstatic.com/webteam/category-pages/Databases/category-page-diagram_database_open-source.b19513e06bb99e0cf4a9f98b389f3c891ebb2843.png)

Enterprise applications
![](https://d1.awsstatic.com/webteam/category-pages/Databases/Category-Page-Diagram_Datbases-on-AWS_Enterprise-Applications.fa44910d3054c6b9f6fc5140fb77b0e056dc8df7.png)

### [Automated Backups](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html)

There are two different types of backups for AWS:

* Automated: Are enabled by default, data is stored in S3 and are enable automatically.
    If you delete the DB, the backup will de belated too
* Database snapshots: Need to be done manually, they are kept even if you remove the DB.

When you restore a backup or a snapshot, the restored version of the database will be in a new RDS instance, with a new DNS name

[Encryption](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html) You can encrypt your Amazon RDS DB instances and snapshots at rest by enabling the encryption option on your Amazon RDS DB instances.

### [RDS Multi-AZ](https://aws.amazon.com/rds/details/multi-az/)

When you provision a Multi-AZ DB Instance, Amazon RDS automatically creates a primary DB Instance and synchronously replicates the data to a standby instance in a different Availability Zone

* it's for disaster recovery not for scaling.

### [RDS Read Replicas](https://aws.amazon.com/rds/details/read-replicas/)

This feature makes it easy to elastically scale out beyond the capacity constraints of a single DB Instance for read-heavy database workloads
The read replica operates as a DB instance that allows only **read-only** connections

* It's used for scaling not for disaster recovery
* You need to have automatic backups on in order to have a read replica.
* You can have up to 5 read replicas of any DB at the time of writing.
* Each replica has its own DNS name.
* Replicas can become their own databases.
* You can have a replica in a second region.
* You can enable encryption on your replica even if your master is not.

### [Elasticache](https://aws.amazon.com/elasticache/)

Elasticache: Managed, Redis or Memcached-compatible in-memory data store. Basically, it's a DB that saves everything in memory to increases I/O performance.

* Types of Elasticache:
  * Memcached
  * Redis: In memory key-value store


text:
---
title: AWS 사용하여 react프로젝트 업로드
date: "2019-11-09T18:05:32.169Z"
template: "post"
draft: false
slug: "/posts/AWS"
category: "AWS"
tags:
  - "AWS"

description: "EC2 사용법"
socialImage: "/media/AWS.png"
---

## AWS 이용하여 업로드 !!

![](/media/Etc/AWS/AWS1.PNG)

![](/media/Etc/AWS/AWS2.PNG)

![](/media/Etc/AWS/AWS3.PNG)

![](/media/Etc/AWS/AWS4.PNG)

![](/media/Etc/AWS/AWS5.PNG)

![](/media/Etc/AWS/AWS6.PNG)

![](/media/Etc/AWS/AWS7.PNG)

![](/media/Etc/AWS/AWS8.PNG)

![](/media/Etc/AWS/AWS9.PNG)

![](/media/Etc/AWS/AWS10.PNG)

![](/media/Etc/AWS/AWS11.PNG)

![](/media/Etc/AWS/AWS12.PNG)

![](/media/Etc/AWS/AWS13.PNG)

![](/media/Etc/AWS/AWS14.PNG)

![](/media/Etc/AWS/AWS15.PNG)

gha_language: JavaScript


text:
---
date: 2018-01-16 13:57:19 +0000
twitter_id:<PHONE_NUMBER>65793542
tags:
- WIPjoy
thread_to:<PHONE_NUMBER>99861760
title: ''
---

[#WIPjoy](https://twitter.com/hashtag/WIPjoy) Day 16: Due to the fact that I am human, 😆 today we have a twofer! Choose one prompt, or do both! Share a daring line, and/or tell us about any other creative outlets you have. pic.twitter.com/GZbMQTnitl
— Bethany A. Jennings✨ (@simmeringmind) January 16, 2018

Daring line:

“What makes you think you’ll succeed when everyone else has failed?” He smirked. “The people were smarter, and they failed. The AI units were top-of-the-line, and they failed. Your unit’s just an entry level!”

Creative outlet: [noisetrade.com/madcrasher](https://noisetrade.com/madcrasher)

[#WIPjoy](https://twitter.com/hashtag/WIPjoy)

repository: oddevan/microblog-archive

repo_name: oddevan/microblog-archive


text:
# Revshells
Online Reserve Shell Generator

# Features
'''
 Generate common listeners and reverse shells
 Raw mode to cURL shells to your machine.
 Button to increment the listening port number by 1
 URI and Base64 encoding
 LocalStorage to persist your configuration
 Dark and Light Modes
'''
# Dev

It's recommended to use the netlify dev command if you're wanting to modify any of the server functions, such as for raw link support:
```
npx netlify dev
```

# Using Docker
Simply run the following commands within this repository to spin up the instance locally using a Docker container
```
docker build -t revshells
```

```
docker run -d -p 80:80 revshells
```
Browse to http://localhost:80

repository: manjushavnair/revshells

repo_name: manjushavnair/revshells


text:
# GATrack.gs - a Google Analytics helper for Google Apps Script

GATrack is a Google Apps Script helper class which makes it easy to integrate Google Analytics tracking in your script project. Using the [Google Analytics Measurement Protocol](https://developers.google.com/analytics/devguides/collection/protocol/v1/) GATrack allows you to send any of the Google Analytics hit types during your script execution. Using the batch and queue time features of the Google Analytics Measurement Protocol GA Track minimises `UrlFetchApp` calls whilst also removing any latency in the hit data.

## Google Sheets Add-on Example

So how do we pull all of this together into a reusable pattern. In this GitHub repo a simply Google Sheets Add-on which integrates Google Analytics in `HtmlService` and server side. All the code is bound to [this copy of a Google Sheet](https://docs.google.com/spreadsheets/d/1Cks_SMXTvCFgQgrGBflH_o6xcQg-4Ru-SGotnZeKrNQ/copy) to make it easier for you to test.

In the example we are interacting with a third party API to pull back a random list of names. The example highlights some basic Google Analytics tracking techniques. The code includes a `GATrack.gs` helper which you can drop into your existing and new script projects.

## Setting up GATrack

To use GATrack in your own script project once `GATrack.gs` is copied you need to initialize it with your Google Analytics tracking ID, and optional User ID by calling:

`GATrack.init(TID, optUID);`

As GATrack uses a number of services such as Property Service and UrlFetchApp if you are using this in an Add-on and initializing in onOpen() you need to [handle this based on authorization mode](https://developers.google.com/apps-script/add-ons/lifecycle#opening), for example :

```
function onOpen(e) {
  var menu = SpreadsheetApp.getUi().createAddonMenu();
  if (e && e.authMode !== ScriptApp.AuthMode.NONE) {
    // As using Properties service and UrlFetchApp can only run when not in AuthMode.NONE
    GATrack.init('UA-48225260-5', Session.getTemporaryActiveUserKey());
    menu.addItem('Show Sidebar', 'showSidebar');
  } else {
    // Add a normal menu item (works in all authorization modes).
  }
  menu.addToUi();
}
```

## Building Google Analytics hits in your server side code

To build hits for your Google Analytics account you use the `addToGA()` method:

`GATrack.addToGA(hitsObject);`

The `hitsObject` is deliberately abstract to give you  complete flexibility in the hit you send. For example, to send an event hit type you could use:

`GATrack.addToGA({t: 'event', ec: 'GATrackDemo', ea: 'Name Gen.', el: 'Name Length', ev: 1});`

Or a timing hit with:

`GATrack.addToGA({t: 'timing', utc: 'GATrackDemo', utv: 'runtime', utt:time, utl:'Name Gen.' });`

You can keep adding Google Analytics hits throughout your script execution. If you add more than 20 hits GATrack will automatically send the queued data to Google Analytics allowing you to keep adding hits. All hits you add are also automatically timestamped so that their is no latency in the data.

## Flushing Google Analytics hits at the end of script execution

To flush any remaining queued hits you need to include the following line at the end of your script execution:

`GATrack.flushGAQueue();`

This is very important to do otherwise to you do as queued data is not persistent and is only stored for the duration of the script execution. If you are also using try/catch and still want to send data when there is an exception remember to include `.flushGAQueue()`. Google Analytics also has an exceptions hit type and the following code is used in the example:

```
function getLotsOfThings(){
  // ...
  try {
    // ...
    GATrack.addToGA(...);
    GATrack.flushGAQueue();
  } catch(e) {
    GATrack.addToGA({t: 'exception', exd: 'Line '+e.lineNumber+' '+e.message});
    GATrack.flushGAQueue();
  }
}
```
## GATrack and `doNotTrack`

GATrack also includes a `.setDoNotTrack()` method which allows your users to opt out of Google Analytics tracking:

`GATrack.setDoNotTrack(true);`

The setting is stored in Property Service as a User Property so it has persistence outwith a single script execution. GATrack doesn’t implement any UI so it is up to you to decide how to record user preferences. GATrack does however expose `.setDoNotTrack()` so that it can be used within  a HtmlService interface with:

`google.script.run.expose('GATrack','setDoNotTrack', true );`

Within `HtmlService` this can be combined with `Navigator.doNotTrack` as the example below demonstrates:

```
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-48225260-5"></script>
<script>
  // Respect do not track for all browsers. Except for IE 10 and 11 where we ignore it
  // https://hjnilsson.com/2015/11/30/setting-up-dnt/
  var dnt_isIe10or11 = (navigator.appVersion.indexOf("MSIE 10") !== -1) || (navigator.userAgent.indexOf("Trident") !== -1 && navigator.userAgent.indexOf("rv:11") !== -1);
  var DNT = (navigator.doNotTrack || navigator.msDoNotTrack || window.doNotTrack);
  DNT = !DNT || DNT == "unspecified" || DNT == "0" ? false : true;
  if (!DNT || dnt_isIe10or11) {
    // do track
    google.script.run.expose('GATrack','setDoNotTrack', '' );
  } else {
    // don't track
    window['ga-disable-YOUR_TRACKING_ID_HERE'] = true;
    google.script.run.expose('GATrack','setDoNotTrack', true );
  }

  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'YOUR_TRACKING_ID_HERE',{
    'page_title': GA.page_title,
    'page_location': GA.page_url,
    'user_id': GA.user_id
  });
</script>
```
## GATrack.gs
```
// Developed by mhawksey
// https://github.com/mhawksey/GATrack/blob/master/LICENSE
var GATrack = (function (ns) {

  // Globals
  var GA_BATCH = [];
  var TRACKING_KEY = 'GATrack_Pref';

  /*
  * Initialize with Google Analytics Tracking ID / Web Property ID.
  * @param {string} TID of Tracking ID / Web Property ID
  * @param {string} optUID setting optional User ID
  */
  ns.init = function (TID, optUID) {
    ns.setProp_('TID',TID);
    ns.setProp_('UID',optUID || '');
  };

  /*
  * Build data to send Google Analytics Measurement Protocol.
  * @param {Object} hitsObject to queue for Google Analytics
  */
  ns.addToGA = function (hitsObject){
    var base = {v:   '1',
                tid: ns.getProp_('TID')};

    if (ns.getProp_('UID')){
      base.uid = ns.getProp_('UID');
    }

    // merge hitsObject with base
    // https://stackoverflow.com/a/171256
    for (var a in base) {
      hitsObject[a] = base[a];
    }
    // turn obejct into querystring
    var payload = Object.keys(hitsObject).map(function(key) {
      return encodeURIComponent(key) + '=' + encodeURIComponent(hitsObject[key]);
    }).join('&');
    addToGABatch_(payload, new Date());
    // Uncomment the next line if you want to view what is being sent to GA in Stackdriver Logging
    // [As the measurement protocol returns no error for invalid hits the test_url can be used to validate]
    // console.log({call: 'addToGa',data:payload, test_url: 'https://ga-dev-tools.appspot.com/hit-builder/?'+payload});
  }

  /*
  * Adds our GA call to a queue and sends when it hits 20
  * @param {string} query for event to track
  * @param {Date} date of event to track
  */
  function addToGABatch_(query, date){
    GA_BATCH.push({query: query, time:date});
    if (GA_BATCH.length >= 20){
      ns.flushGAQueue();
    }
  }

  /*
  * Send data to GA from queue
  */
  ns.flushGAQueue = function (){
    // check tracking pref
    var doNotTrack = ns.getDoNotTrack();
    if (!doNotTrack){
      var payload = "";
      var ga_now = new Date().getTime();
      // build payload
      for (var i=0; i < GA_BATCH.length; i++){
        payload += GA_BATCH[i].query + "&qt=" + (ga_now - GA_BATCH[i].time) + "\n";
      }
      var options = {'method' : 'POST',
                     'payload' : payload };
      var rep_code = UrlFetchApp.fetch('https://www.google-analytics.com/batch', options).getResponseCode();
      if (rep_code < 200 || rep_code > 299){
        console.error({call: 'GATrack', error:rep_code});
      }
      GA_BATCH = [];
    }
  }

  /**
  * Gets tracking pref using caching.
  * @returns {Boolean} tracking pref.
  */
  ns.getDoNotTrack = function (){
    return ns.getProp_(TRACKING_KEY) == 'true'
  }

  /**
  * Sets tracking pref using caching.
  */
  ns.setDoNotTrack = function(pref){
    ns.setProp_(TRACKING_KEY, pref);
  }

  /**
  * Sets a static user property, using caching.
  * @param {string} key The property key.
  * @param {string} value The property value.
  */
  ns.setProp_ = function (key, value){
    PropertiesService.getUserProperties().setProperty(key, value);
    CacheService.getUserCache().put(key, value, 86400);
  }

  /**
  * Gets a static document property, using caching.
  * @param {string} key The property key.
  * @returns {string} The property value.
  */
  ns.getProp_ = function(key){
    var value = CacheService.getUserCache().get(key);
    if (!value){
      var value = PropertiesService.getUserProperties().getProperty(key);
      CacheService.getUserCache().put(key, value, 86400);
    }
    return value;
  }
  return ns;
})(GATrack || {});

// Expose Namespace methods for google.script.run
// http://ramblings.mcpher.com/Home/excelquirks/gassnips/exposeserver
function expose (namespace , method) {
  return this[namespace][method].apply(this,Array.prototype.slice.call(arguments,2));
}
```

repository: vitalvlasyuk/GATrack

repo_name: vitalvlasyuk/GATrack


text:
# YourAnime.moe utilities

Welcome to `tanoshimu_utils`! This gem is what I like to call "just a couple of utilities shared accross the apps to make development much easier."

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'tanoshimu_utils'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install tanoshimu_utils

## Usage

### Concerns

| `include`                                  | Description | Example |
| ------------------------------------------ | ----------- | ------- |
| `TanoshimuUtils::Concerns::GetRecord`      | Add `.record` to return a model from the table `.used_by_model` with primary key `.model_id`. | `Model.first.record` |
| `TanoshimuUtils::Concerns::Identifiable`   | Fills up the `.identification` field with a unique token. | Use with classes like `Admin`, `User`, `Staff`, etc... (anyone that can log on to the app) |
| `TanoshimuUtils::Concerns::ResourceFetch`  | For an ActiveStorage attachment `res`, adds `res_url` (get the url), `res_url!` (fetch from AWS), `res?` (make sure it is existant and attached) | Use classes that have attachments (like images). If `user` has `avatar`, then `user.avatar?`, `user.avatar_url`, `user.avatar_url!` are valid calls. |
| `TanoshimuUtils::Concerns::RespondToTypes` | Adds `respond_to_types` class method to add `field?` for a field `field`. | `respond_to_types [:admin, :regular, :guest]` is a valid class for a `User` class. |
| `TanoshimuUtils::Concerns::Translatable`   | Depending on the current locale, adds a `translates` class method to create a field that returns the value | `translates :value, through: [:en, :fr], default: :fr` creates a method `.value` that returns the field `.fr` if the locale is French, `.en` if the locale is English. French is returned if another available locale is set. |

### Validators

| `include`                                   | Description | Example |
| ------------------------------------------- | ----------- | ------- |
| `TanoshimuUtils::Validators::PresenceOneOf` | Adds the class method `validate_presence_one_of` to check if at lease one of the fields are set. | `validate_presence_one_of [:field1, :field2, :field3]` will validate if `:field1` or `field2` or `field3` is set. If none are set, fails. |
| `TanoshimuUtils::Validators::UserLike`      | Adds the class method `validate_like_user` to check if the user-like class (`User`, `Admin`, `Staff`, etc.) has a `name`, a `username` and a `user_type` (the latter must be in the array `user_types`). | `validate_like_user user_types: [:admin, :regular]` only allows user-like models to be either admin or regular. |

## Development

After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tanoshimu_utils.


text:
### Readme

This is basically an approach to bring the popular UINavigationController to Mac OS X.

This version is a fork of the original that implements animated views instead of view flattening. If for example your view would like to make an animation before it dissapears or an animation while it's appearing in, then you now have the option to do so.

---

### Installation

Include all files manually or add the following to your podfile:

```Ruby
pod 'BFNavigationController'
```

## How it works

BFNavigationController is easy to use and works almost exactly like a UINavigationController. All method names (and respective functionalities) have been derived from UINavigationController. You can therefore just look into
Apple's UIKit online documentation (http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html) for further references.

In contrast to their iOS counterparts, Mac apps should of course be more flexible when it comes to custom window sizes and layouts. Hence, you can intialize your BFNavigationController by providing an NSRect:

	_navigationController = [[BFNavigationController alloc] initWithFrame: YOUR_RECT rootViewController: YOUR_VIEW_CONTROLLER];
	[_window.contentView addSubview: _navigationController.view];

Navigation- and toolbars haven't been implemented yet. However, you can easily hook in some custom bars.
Setting a BFNavigationControllerDelegate and implementing the methods `-navigationController:willShowViewController:animated:` and `-navigationController:didShowViewController:animated:`
could be the perfect way to do this.

---
### Licensing

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

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

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

repository: lucasderraugh/BFNavigationController

gha_language: Objective-C

repo_name: lucasderraugh/BFNavigationController


text:
---
date: 2012-12-26T20:41:36.000Z
author: 'Pieter Colpaert'
title: 'Apps For Whisky'
tags:
  - 'apps for x'
---

_Apps For X is the working group led by Lieven Janssen which supports people who organise Apps For X events. With a bunch of volunteers he is setting up various events next year, including Apps For Ghent, Apps For Belgium, Apps For Students, Apps For Geo, Apps For Coast with Apps For Flanders, Apps For Ghent, Apps For Antwerp and Apps For Whisky as an example._

Apps For Whisky? Yes!

Apps For X events have always been more about networking than about the apps. Before everyone starts cursing in my general direction, let me explain. Out of all apps in the application stores, there are maybe 0.01% (mere guess) that keep getting used and keep on getting downloaded.

This is not a problem for open data, it’s a problem for apps. Apps, or applications, is a broader term than just the apps we can find in an appstore. Data applications are the result of applying data to something. Students, teachers, researchers, employees, developers, freelancers and so on need to know that these datasets are in the open and they need to know where to find them. It’s not the one killer application that we are looking for, it’s the integration of a lot of datasets in a lot of applications, whether they are usable on a smartphone, whether they are used to bolster a statement or whether to visualize something nifty.

Are our Apps For X events useful as a hackathon? Sure they are. We have gotten small “hits”, for instance [Ghendetta](http://ghendetta.be 'Ghendetta'), and we have had a lot of feedback on our platform The DataTank. As a networking event they are even more useful. They show to policy makers what people can do nowadays.

Our Apps For Whisky event was just that. A blend (pun intended) between good whisky and an open data possibilities chat.

The winners, who took home a 50 year old whisky, were bloggers [adramaday.com](http://www.adramaday.com) (Bart), [onversneden.com](http://onversneden.com) (Johan) and [whiskynotes.be](http://whiskynotes.be) (Ruben), and Michael De Blauwe.

![](IMG_80461.jpg)

A first special thanks to the [whiskyman](http://thewhiskyman.be/), who sadly couldn’t make it, for this wonderful evening. A second special thanks to Mathias Van Compernolle who was our host for the night.

Pieter

repository: openknowledgebe/website

repo_name: openknowledgebe/website