text:
# Module 1 - Software and Data Preparation

**What will you learn from this module?**

- Installing QGIS and PyLUSAT, and loading _LUCIS-OPEN Tools for QGIS_,
- Be familiar with the user interface of QGIS 3.10.8,
- Visualizing GIS data and creating maps.

## 1. Software Installation

> :pushpin: Note on installation:

> Follow the [instruction](https://github.com/SERVIR-WA/GALUP/wiki/Install)
> to install [QGIS 3.10.8](https://qgis.org/en/site/) and
> [PyLUSAT v0.5.2](https://github.com/chjch/pylusat), which must be installed
> before we can successfully load and run the tools GALUP have developed.

## 2. GIS Datasets

- The table below lists the GIS datasets used for this module.
- They can be found within the downloaded _zip_ folder from the previous
  section at `GALUP-master -> training -> 1_lu -> datasets`.

| ID | File Name                        | Data Format | Type    | Description                     |
|----|----------------------------------|-------------|---------|---------------------------------|
| 1  | Gh_260_MMDA.shp                  | vector      | polygon | Districts of Ghana              |
| 2  | population_gha_2018-10-01.tif    | raster      | tiff    | Population of Ghana in 2018     |
| 3  | healthsites.shp                  | vector      | point   | Health facilities in Ghana      |
| 4  | GHARoads2020PrimarySecondary.shp | vector      | line    | Primary and secondary roads in Ghana |

## 3. Working with QGIS 3.10.8

In this section, we will explore the QGIS
[Graphical User Interface](https://docs.qgis.org/3.10/en/docs/user_manual/introduction/qgis_gui.html)
(GUI) and the basic functions including visualizing GIS data and creating maps.

To get an overview and understand each GUI element's purposes, including
(1) **Layers List / Browser Panel**, (2) **Toolbars**, (3) **Map canvas**,
(4) **Status bar**, (5) **Side Toolbar**, (6) **Locator bar**, please checkout
this [page](https://docs.qgis.org/3.10/en/docs/training_manual/basic_map/overview.html).

Moreover, you can customize the GUI by dragging and moving _Panels_ and
_Toolbars_ to the place you prefer (see the animation below).
![gui_custom](../../../img/gif/m1_custom_gui.gif)

### 3.1 Add Data to [_Map Canvas_](https://docs.qgis.org/3.10/en/docs/training_manual/basic_map/mapviewnavigation.html)

1. The primary way to add data to QGIS Map Canvas is by **Drag-and-Drop**
   items in the [Browser panel](https://docs.qgis.org/3.10/en/docs/user_manual/introduction/browser.html?#the-browser-panel).
2. Another way to add data is by
   [**loading layer from a file**](https://docs.qgis.org/3.10/en/docs/user_manual/managing_data_source/opening_data.html?#loading-a-layer-from-a-file).

   > :pushpin: Use Favorites to quickly get to the data you used frequently:

   > In the Browser Panel, you can also add the folder you frequently used to
   > [Favorites](https://docs.qgis.org/3.10/en/docs/training_manual/basic_map/overview.html?highlight=Favorites#basic-the-browser-panel). To avoid long path shown in
   > the Favorites, you can also `Rename Favorite...`.
3. Now, lets load _Districts of Ghana_, _Road Network_, and _Health Facility_
to Map Canvas, as shown in below.

|               Add Data to Map Canvas            |
|:-------------------------------------------------:|
|  |

### 3.2 Check data in the _Attribute Table_

The [Attribute Table](https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?highlight=attribute#introducing-the-attribute-table-interface) displays
information on features of a selected layer.

- Right click the layer of your interest, and
  click `Open Attribute Table`.
- As circled in the image below, the title of the Attribute Table window
  includes: 1) the title of the layer, 2) the total number of the features in
  the layer, 3) the number of features are filtered, and 4) the number of
  features are selected.

|               Attribute Table           |
|:-------------------------------------------------:|
|  |

### 3.3 Change Symbology of a Layer

The symbology of a layer is one of important functions in GIS. By presenting the
data with a dynamic visual appearance on the map, you can better explore the data
as you are working with it.

- Symbolize the vector layers using
  [Single Symbology](https://docs.qgis.org/3.10/en/docs/training_manual/basic_map/symbology.html?#basic-fa-changing-colors)
  in the layer properties.
- Choose the [Categorized](https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/vector_properties.html?#categorized-renderer)
  option to present the data, if you have data that is
  broken into categories (the image in the middle is using region column).
- Choose the [Graduated](https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/vector_properties.html?#graduated-renderer)
  option to present the data, if you have numeric data you want
  to symbolize (the image on the right is using the population column).

|  Single Symbology  |  Categorized Symbology |  Graduated Symbology  |
|:------------------:|:----------------------:|:---------------------:|
| ![basemap](../../../img/map/m1_Single.png)  | ![basemap](../../../img/map/m1_Categorized.png)  | ![basemap](../../../img/map/m1_Graduated.png)  |

### 3.4 Add a _Basemap_ to Map Canvas

A [Basemap](https://rdkb.sgrc.selkirk.ca/Help/Content/Client_APIs/SV_User/SVU_AboutBaseMaps.htm)
is a layer with geographic information that serves as a background. A base map
provides context for additional layers that are overlaid on top of the base map.
In this module, we use [**QuickMapServices**](https://docs.qgis.org/3.10/en/docs/training_manual/qgis_plugins/plugin_examples.html#basic-fa-the-quickmapservices-plugin), a QGIS
[Plugin](https://docs.qgis.org/3.10/en/docs/user_manual/plugins/plugins.html),
to add basemap to Map Canvas.

1. Open the [**Plugins**](https://docs.qgis.org/3.10/en/docs/training_manual/qgis_plugins/fetching_plugins.html?#basic-fa-managing-plugins)
window at the _main menu toolbar_,
and click `Manage and Install Plugins...`.
2. Search and [install a new Plugin](https://docs.qgis.org/3.10/en/docs/training_manual/qgis_plugins/fetching_plugins.html?#basic-fa-installing-new-plugins) called **QuickMapServices**.
3. After installation, open the **QuickMapServices Settings** window, click the
_More Services_ tab, and click _Get contributed pack_ to get more basemaps.
For details, please check out this [tutorial](https://opengislab.com/blog/2018/4/15/add-basemaps-in-qgis-30).
4. Choose one basemap from the **QuickMapServices** and add it to Map Canvas.
   ![icons](../../../img/gui/menu/qms_web_icons.png)

|                Layer with a Basemap                  |
|:-------------------------------------------------:|
|  |

### 3.5 Create a _Layout_ to Print Your Map

After setting up the map, you are now ready to [layout](https://docs.qgis.org/3.10/en/docs/training_manual/map_composer/map_composer.html#ls-using-print-layout) your map and print it (as a pdf file)
to share with your colleagues.

- Open the [**Layout Manager**](https://docs.qgis.org/3.10/en/docs/training_manual/map_composer/map_composer.html#basic-fa-the-layout-manager) window, click the _Create..._ button, and
name your map and click _OK_ to open the map window.
- In the map window, click the [`Add Item`](https://docs.qgis.org/3.10/en/docs/user_manual/print_composer/overview_composer.html#add-item-menu) button on the main menu bar, and
  click add map.
- In order to have a decent map, you need: 1) a [**Title**](https://docs.qgis.org/3.10/en/docs/training_manual/map_composer/map_composer.html#basic-fa-adding-a-title) for your map, 2) a
[**Legend**](https://docs.qgis.org/3.10/en/docs/training_manual/map_composer/map_composer.html#basic-fa-adding-a-legend)
to identify the elements in the map, 3) a [**Scale Bar**](https://docs.qgis.org/3.10/en/docs/user_manual/print_composer/composer_items/composer_scale_bar.html?#the-scale-bar-item)
to indicates the scale of the map, 4) a [**North Arrow**](https://docs.qgis.org/3.10/en/docs/user_manual/print_composer/composer_items/composer_image.html?#the-picture-and-the-north-arrow-items) to
indicate the direction. You can add these items under the `Add Item` button.
- After you finishing all the layout of your map, click the `Layout` button on
  the main menu bar, and click [`Export as PDF...`](https://docs.qgis.org/3.10/en/docs/user_manual/print_composer/create_output.html#export-layout-pdf) to export your map. (If the basemap cannot be rendered
  in the PDF file, try a lower _dpi_ (e.g., 150 dpi) in the
  [**Export Setting**](https://docs.qgis.org/3.10/en/docs/user_manual/print_composer/overview_composer.html#export-settings )
  in the [**Layout Panel**](https://docs.qgis.org/3.10/en/docs/user_manual/print_composer/overview_composer.html#the-layout-panel).)
- See the example map in PDF file [here](../pdf_download/PopulationMap.pdf).

## 4. Exercises and Post-training Survey

- Please complete the [Exercise 1](https://github.com/SERVIR-WA/GALUP/blob/master/training/1_lu/exercises/m1_exercise1.md#exercise-1).
- Please complete the [Exercise 2](https://github.com/SERVIR-WA/GALUP/blob/master/training/1_lu/exercises/m1_exercise2.md#exercise-2).
- Please take this post-training
  [survey](https://ufl.qualtrics.com/jfe/form/SV_3n21W1ko0UPJNLo) (required).
- Please submit your exercises [here](https://github.com/SERVIR-WA/GALUP/issues/new?assignees=&labels=submission+w1m1&template=exercise-submission-template.md&title=Module+1+exercises+%5Breplace+with+your+name%5D).

## 5. Additional Resources

- [QGIS User Guide](https://docs.qgis.org/3.16/en/docs/user_manual/)
- [What is GIS and why use QGIS](https://www.youtube.com/watch?v=8oEnJvLzDnQ)
  (YouTube video by [Statistics Canada](https://www.youtube.com/channel/UCvfquhvHW5ffRamjLHdXDtQ))
- [Git & GitHub Tutorials for Beginners](https://www.youtube.com/playlist?list=PL4cUxeGkcC9goXbgTDQ0n_4TBzOO0ocPR)
  (YouTube playlist by [The Net Ninja](https://www.youtube.com/c/TheNetNinja))
- [OpenSourceOptions Tutorials](https://opensourceoptions.com/blog/)

## 6. What's Next?

Module 2 - Introduction to LUCIS-OPEN Tools for QGIS.

repository: Bar-bara/GALUP

repo_name: Bar-bara/GALUP


text:
# Validation for IoT Reliability Simulation

This repo holds the real-world experiment setup, scripts, data and result analysis for ReLIoT, a reliability simulating module on ns-3. The content in each directory is summarized in the following:

```
├── data                      // experiment scenarios, collected data and processing scripts
├── esp8266                   // code running on ESP8266s
├── model-characterization    // scripts and results of modeling power & execution time
|			  											// of RPi3 and RPi0
├── README.md                 // this file
├── rpi-broker                // scripts to fire the experiment on RPi3
├── rpi-mesh-setup            // scripts to setup mesh network with RPis
├── rpi-mqtt                  // scripts running on each RPi during experiment
├── script                    // handy scripts on RPi to change frequency and bandwidth
└── sensor                    // handy module to read power and temperature from external
                              // sensors

```

Refer to the README in each directory for more details regarding each part.

license: MIT

repository: UCSD-SEELab/iotsim-validation

branch_name: refs/heads/master

extension: md

gha_language: Python

gha_license_id: MIT

license_type: permissive

repo_name: UCSD-SEELab/iotsim-validation


text:
---
published: true
layout: post
---

### Installation

- Install the Ionic framework if it is not installed yet:
	- `$ npm install -g cordova ionic gulp ios-sim`

>	If you already have ionic installed you can see you version by `$ ionic -version`.  '$ npm update' will update any npm packages.

- **OPTIONAL:** Install the Android SDK & Emulator (if you want to target Android):
	- `$ brew install ant`.  To see the version:  `$ ant -version`
    - `$ brew install android-sdk` installs it to `/usr/local/opt/android-sdk/23.0.2`

    >	`$ brew update` will update brew.  `$ brew upgrade` will upgrade all brew features.

    - ``$ export ANDROID_HOME=`brew --prefix android` `` or `$ export ANDROID_HOME=/usr/local/opt/android-sdk`
    - Install sdk 19

    	- `$ tools/`
        - `$ android sdk`
        - Select `Android 4.4.2 (API 19)` and Install.

    - Emulator Option #1:  Install Genymotion emulator for Android.  This is the preferred method because the Android emulator is so slow.

        - Goto [Genemotion](https://www.genymotion.com/) and sign up for a new account
        - Follow these [instructions](https://www.genymotion.com/?utm_source=dlvr.it&utm_medium=twitter#!/developers/user-guide) to download and install Genemotion.

            - NOTE: You will need to install VirtualBox first if running on OS X
            - The Ionic page on Genymotion is [here](http://ionicframework.com/docs/ionic-cli-faq/#genymotion)
            - NOTE: Running in a virtual Android 4.4 and above device will run slow because of the switch to use the new Cromeview imbeded browser.  The solution is to target the vitual device to 4.2.2.

    - Emulator Option #2:  Use the Android emulator

    	- Create an emulator (avd). I created a adv called `my19`:

            - `$ android create avd -n my19 -t android-19 -b default/x86`
            - `$ android avd` will allow you to edit the adv or enter new ones.

    	- Install HAXM.  This is hardware accelerator required for the emulator.

        	- Download the [zip file](https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager) for the Mac.
            - Install `IntelHAXM_1.1.1_for-10_9_and_above.dmg`

### Create a test app

```
$ ionic start myApp tabs (start with the tabs app, you can also start with ‘blank’ or ’sideMenu’)
$ cd myApp
$ ionic platform add ios
$ ionic platform add android
```

### Run in the iOS emulator _(ctrl-C to exit)_

```
$ ionic build ios
$ ionic emulate ios
```

>	`command-shift-h` then `h` again simulates double tapping the home button.

>	Alternatively, you should probably do most of your testing in your browser with `$ ionic serve`, as it's much quicker (note: features such as the camera will not be available for testing if you use this method).

>	When in the iOS simulator you can view `console.log` line by double-clicking `\<app dir>\platforms\ios\cordova\console.log`.

### Run in the Android emulator _(ctrl-C to exit)_

```
$ ionic build android
$ ionic emulate android

--- for Genymotion do the following:

$ ionic run android
```

### Resouces

- Ionic Guide: http://ionicframework.com/docs/guide/installation.html
- Max’s video walkthrough:  https://www.youtube.com/watch?v=C-UwOWB9Io4&feature=youtu.be
- Android help:
	- http://dara.azurewebsites.net/ionic-android-osx/
    - http://ionicframework.com/docs/ionic-cli-faq/#android-sdk


text:
# Health Checks

Health checks provide a mechanism for the client to know whether or not it's dependant services are still up and running.
This would prevent unnecessary requests to dead servers. There are various ways that these checks can be implemented. For this
sample, the API service provides a health endpoint accessible at `/api/health/status`.

Make sure you have Consul running:
```
consul agent -dev
```

Next start the API service. Open 2 command terminals and navigate to the location of the API project:
```
dotnet run
```

The service will register itself with Consul to use health checks.You should now see requests being made every 10 seconds or so to `/api/health/status`; also available at the service tab in the Consul UI.

Also, do a `dotnet run` in a command terminal in the directory of the client project. The client will check the health of the service
before make a request for data.

Next [Load Balancing](../LoadBalancing/README.MD)

branch_name: refs/heads/main


text:
# NBA Images Client

[![Build Status](https://travis-ci.org/jaebradley/nba_images_client.svg?branch=master)](https://travis-ci.org/jaebradley/nba_images_client)
[![codecov](https://codecov.io/gh/jaebradley/nba_images_client/branch/master/graph/badge.svg)](https://codecov.io/gh/jaebradley/nba_images_client)
[![PyPI version](https://badge.fury.io/py/nba_images_client.svg)](https://badge.fury.io/py/nba_images_client)

## Introduction
A Python client to retrieve team logo and player head shot images from NBA.com

## Installation
`pip install nba_images_client`

## API

### Get Team Logo
Returns a team's logo as bytes. Returns `PNG` (default) or `JPG`. Also,
allows resizing, based on input dimensions.  Returns `PNG` (default) or `JPG`.
Allows resizing, based on input dimensions. The default dimensions are `260x190`.

```python
from nba_images_client import NbaImagesClient, Team, FileType, ImageDimensions

# Get a PNG of Isaiah Thomas' head shot in bytes
isaiah_thomas_head_shot = NbaImagesClient.get_player_head_shot(player_id=202738)

# Get a 400x400 JPG of Isaiah Thomas' head shot in bytes
isaiah_thomas_head_shot_400_by_400_jpg = NbaImagesClient.get_player_head_shot(player_id=202738, file_type=FileType.JPG, image_dimensions=ImageDimensions(height=400, length=400))
```


text:
# LWCF - The Lightweight Command-Line Framework

LWCF is an open-source lightweight command-line framework, focused on simplicity and performance as well as accessibility.

It's focused on TypeScript and Javascript not binding to any specific language, it provides run-time running of TypeScript as well if someone might use that idk.

> TIP: The application can be packaged by using `@zeit/pkg`, making it super easy to create an executable for all platforms, without having to install NodeJS on the machine.

> WARNING: The project is in heavy development, and might introduce breaking changes later on.
> Using the project in production will require you to revalidate the code, and target your version directly to the version you are sure works. ( Just make sure to test it before releasing it )
---

## Requirements

For development, you will only need Node.js and a node global package, Yarn, installed in your environement.

### Node

- #### Node installation on Windows

  Just go on [official Node.js website](https://nodejs.org/) and download the installer.
  Also, be sure to have `git` available in your PATH, `npm` might need it (You can find git [here](https://git-scm.com/)).

- #### Node installation on Ubuntu

  You can install nodejs and npm easily with apt install, just run the following commands.

      $ sudo apt install nodejs
      $ sudo apt install npm

- #### Other Operating Systems
  You can find more information about the installation on the [official Node.js website](https://nodejs.org/) and the [official NPM website](https://npmjs.org/).

If the installation was successful, you should be able to run the following command.

    $ node --version
    v12.15.0

    $ npm --version
    6.13.4

If you need to update `npm`, you can make it using `npm`! Cool right? After running the following command, just open again the command line and be happy.

    $ npm install npm -g

### Yarn installation

After installing node, this project will need yarn too, so just run the following command.

      $ npm install -g yarn

---

## Install

    $ git clone git@github.com:ch99q/lwcf.git
    $ cd lwcf
    $ yarn bootstrap

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/ch99q/lwcf/tags).

## Authors

- **Christian Hansen** - _Initial work_ - [ch99q](https://github.com/ch99q)

See also the list of [contributors](https://github.com/ch99q/lwcf/contributors) who participated in this project.

## License

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

gha_language: TypeScript


text:
---
layout: page
title: Get Involved
permalink: /contact/
---

The UKPA maintains a node on the [Matrix network](https://matrix.org/).

To connect with us, you can either follow this [invitation link](https://matrix.to/#/!PxQLUASvEmbvzsdrmS:uk.python.org?via=matrix.org) or:

1. Choose a [matrix client](https://matrix.org/clients/). Element is the best known and has desktop, mobile and browser versions.
2. Register an account on a matrix node. matrix.org is the best known open node but there are [many others](https://www.hello-matrix.net/public_servers.php).
3. Join our main room. Its address is #community:uk.python.org

Alternatively, you can [contact the trustees via email](mailto:trustees@uk.python.org).

gha_language: HTML


text:
Graph Meter
===

![Showcase](https://i.imgur.com/UMOzONH.gif)

Graph-based FFXIV overlay skin for ACT OverlayPlugin.

Features
---

* Retains history of past encounters
* Statistic being graphed can be switched on the fly
* Snazzy y-axis labels with icons
* It's a graph, what more do you want
* Oh it's also sorta configurable but only sorta
* Shit code that was primarily written late at night

Installation
---

1. [Download a zip release thingy](https://github.com/ackwell/graph-meter/archive/master.zip)
2. Extract it somewhere, location is unimportant. I'd recommend near any other skins you have.
3. In ACT, go to Plugins -> OverlayPlugin.dll, and click "New".
4. Give it a name, and make sure "Type" is set to "Mini Parse".
5. Click the "..." next to URL and select the `index.html` file that you extracted.
6. Move it into position and lock it!

 Pull requests, I guess?

To configure the overlay, open `config.js` in the same folder as the `index.html` from earlier, and edit the values there. You'll need to reload the overlay in the OverlayPlugin settings to see effects take place. `config.js` is commented with what the values do.

As mentioned in `config.js`, further config can be achieved by editing files in `lib/` such as `lib/palette.js`, but you'll want a half-decent understanting of JavaScript before diving in there.

Todo
---

In no particular order:

* [ ] Snazzy x-axis with timestamps and cool stuff!
* [ ] Pet splitting/joining (do people actually use this?)
* [ ] Better styling of controls, groupings for encounters and stats
* [ ] Config editing without editing a bloody text file

Reporting Bugs
---

Before reporting a bug, check if it looks like any of [these outputs](https://imgur.com/a/VSeBv). While frustrating, these are caused by ACT mistaking an enemy for an ally or visa versa (or both), and there's nothing I can do about it without trying to fudge data - I'd prefer not to.

That said, if you come across a bug, toss a pull request in, or raise an issue here on GitHub. Alternatively, message me on reddit (`/u/ackwell`), or PM me on Discord (`ackwell#3835`).

repository: ackwell/graph-meter

repo_name: ackwell/graph-meter


text:
# Challenge #2: Push image to Docker registry

## Description

Your goal is to push the Docker image from [Challenge #1](./1-dockerize.md) to a private Docker registry. In these labs, we will use Azure Container Registry, alternatively you could use DockerHub.

Azure Container Registry allows you to store and manage images for all types of container deployments including DC/OS, Docker Swarm, Kubernetes, and Azure services such as App Service, Batch, Service Fabric, and others. It will allow you to efficiently manage a single registry replicated across multiple regions and eliminate ingress/egress charges by keeping your Docker registry in the same data center as your deployments. As Azure Container Registry is compatible with the open-source Docker Registry v2, you can use the same open-source Docker CLI tools you already know and the skills you have to efficiently interact with the registry.

## Success criteria

Everyone on your team must push a Docker image to your Azure Container Registry and you should verify that they exist in the registry when logging into the [Azure portal](https://portal.azure.com/).
_Hint_: Use image tags to separate the images from each other.

## References

[Deploy and use Azure Container Registry](https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-acr)
[Azure Container Registry Documentation](https://docs.microsoft.com/en-us/azure/container-registry/)
[Authenticate with Azure Container Registry from Azure Container Service](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks)
[Azure CLI Reference](https://docs.microsoft.com/en-us/cli/azure/get-started-with-azure-cli)
[Docker CLI Reference](https://docs.docker.com/engine/reference/commandline/cli/)

repository: lulzzz/aks-workshop

repo_name: lulzzz/aks-workshop


text:
# Magento 2 NGINX/PHP-FPM

In a Dockerfile for PHP 7.3, with 10.x LTS version of NodeJS:
```Dockerfile
FROM quay.io/continuouspipe/magento2-nginx-php7.3-ng:latest

ARG GITHUB_TOKEN=
ARG MAGENTO_USERNAME=
ARG MAGENTO_PASSWORD=
ARG IMAGE_VERSION=3

COPY . /app
RUN container build
```

In a Dockerfile for PHP 7.2, with 10.x LTS version of NodeJS:
```Dockerfile
FROM quay.io/continuouspipe/magento2-nginx-php7.2-ng:latest

ARG GITHUB_TOKEN=
ARG MAGENTO_USERNAME=
ARG MAGENTO_PASSWORD=
ARG IMAGE_VERSION=3

COPY . /app
RUN container build
```

In a Dockerfile for PHP 7.1 without Hem and 6.x version of NodeJS:
```Dockerfile
FROM quay.io/continuouspipe/magento2-nginx-php7.1-ng:latest

ARG GITHUB_TOKEN=
ARG MAGENTO_USERNAME=
ARG MAGENTO_PASSWORD=
ARG IMAGE_VERSION=3

COPY . /app
RUN container build
```

In a Dockerfile for PHP 7.1 with Hem and 6.x version of NodeJS:
```Dockerfile
FROM quay.io/continuouspipe/magento2-nginx-php7.1:latest

ARG GITHUB_TOKEN=
ARG MAGENTO_USERNAME=
ARG MAGENTO_PASSWORD=
ARG IMAGE_VERSION=3

COPY . /app
RUN container build
```

In a Dockerfile for PHP 7 without Hem and 6.x version of NodeJS:
```Dockerfile
FROM quay.io/continuouspipe/magento2-nginx-php7-ng:latest

ARG GITHUB_TOKEN=
ARG MAGENTO_USERNAME=
ARG MAGENTO_PASSWORD=
ARG IMAGE_VERSION=3

COPY . /app
RUN container build
```

In a Dockerfile for PHP 7 with Hem and 6.x version of NodeJS:
```Dockerfile
FROM quay.io/continuouspipe/magento2-nginx-php7:latest

ARG GITHUB_TOKEN=
ARG MAGENTO_USERNAME=
ARG MAGENTO_PASSWORD=
ARG IMAGE_VERSION=3

COPY . /app
RUN container build
```

## How to build
```bash

docker-compose build magento2_php72_nginx_ng
docker-compose push magento2_php72_nginx_ng

docker-compose build magento2_php71_nginx_ng
docker-compose push magento2_php71_nginx_ng

docker-compose build magento2_php71_nginx
docker-compose push magento2_php71_nginx

docker-compose build magento2_php70_nginx_ng
docker-compose push magento2_php70_nginx_ng

docker-compose build magento2_php70_nginx
docker-compose push magento2_php70_nginx
```

## About

This is a Docker image that can install and serve a Magento 2 installation via NGINX and PHP 7.

## How to use

As for all images based on the ubuntu base image, see
[the base image README](../../ubuntu/16.04/README.md)

Before starting services, on boot the container will call the following scripts:

1. `bash /usr/local/share/magento2/install_magento.sh`, which is shared by the Dockerfile build, and should not contain
   references to external services such as databases which will not be present when built.
2. `bash /usr/local/share/magento2/install_magento_finalise.sh` which can contain calls to databases, redis, etc.

### Custom build and startup scripts

To run commands during the build and startup sequences that the base images add,
please add `usr/local/share/container/plan.sh` for a project, or
`usr/local/share/container/baseimage-{number}.sh` if creating another base image.

This allows you to define and override bash functions that the base images add.

In addition to the bash functions defined in this base image's parent images:
* [the base image functions](../../ubuntu/16.04/README.md#custom-build-and-startup-scripts)
* [the php-nginx image functions](../../php/nginx/README.md#custom-build-and-startup-scripts)

This base image adds the following bash functions:

function | description | executed on
--- | --- | ---
do_magento2_install | Builds Magento | do_build
do_magento2_development_start | Installs Magento | do_development_start

These functions can be triggered via the /usr/local/bin/container command, dropping off the "do_" part. e.g:

/usr/local/bin/container build # runs do_build
/usr/local/bin/container start_supervisord # runs do_start_supervisord

#### Environment variables

The following variables are supported

Variable | Description | Expected values | Default
--- | --- | --- | ----
IMAGE_VERSION | The docker image version to use. Version 1 uses the install_magento*.sh scripts which can be hard to customise. Version 2 uses magento_functions.sh and does a temporary database installation during the "build" phase. Version 3 removes the legacy assets installation and supports Magento's [pipeline deployment](https://devdocs.magento.com/guides/v2.2/config-guide/deployment/pipeline/) in Magento 2.2+. | 1/2/3 | 3
PHP_MEMORY_LIMIT | PHP memory limit | - | 768M
PHP_MAX_EXECUTION_TIME | Amount of time in seconds that PHP is allowed to execute for | integer | 600
PRODUCTION_ENVIRONMENT | If true, magento DI will be compiled | true/false | false
APP_HOSTNAME | Web server's host name | \<projectname\>.docker | magento.docker
PUBLIC_ADDRESS | Magento base URL. Note that an underscore should not be used due to magento admin login using PHP's filter_var to check for domain validity. "_" is not a valid character in a domain name. |  https://\<projectname\>.docker/ | https://magento.docker/
FORCE_DATABASE_DROP | Drops the existing database before importing from assets | true/false | false
DATABASE_NAME | Magento database name | - | magentodb
DATABASE_USER | Magento database user | - | magento
DATABASE_USER_HOST | Host for the DATABASE_USER to be granted access from | hostname/ip/wildcard | %
DATABASE_PASSWORD | Magento database password | - | magento
DATABASE_ADMIN_USER | Optional MySQL database password to perform DBA operations, DATABASE_USER will be used if not specified | - | -
DATABASE_ADMIN_PASSWORD | Optional MySQL database password to perform DBA operations, DATABASE_PASSWORD will be used if not specified | - | -
DATABASE_HOST | Magento database host | - | database
ADDITIONAL_SETUP_SQL | Any additional SQL query which should be executed after database import (changing base URLs and setting varnish host/port is added by default) | SQL Query | -
FRONTEND_INSTALL_DIRECTORY | NPM modules will be installed within this directory (if it exists) | absolute path (normally we mount the source at /app) | /app/tools/inviqa
FRONTEND_BUILD_DIRECTORY | Gulp command will be executed within this directory (if it exists) | absolute path (normally we mount the source at /app) | /app/tools/inviqa
FRONTEND_BUILD_ACTION | Gulp command to run | gulp command name | build
GULP_BUILD_THEME_NAME | If specified, will be passed to gulp command as "--theme=<theme name>" | - | -
MAGENTO_MODE | Used to set Magento mode. If set to "production", static content will be deployed | default/developer/production | production
MAGENTO_RUN_CODE_MAPPING | Mapped to http_host and default store name. First part of the value is the host name and second part is magento's store code (separated by space). Don't forget to add ";" at the end. | - | magento_web.docker default;
MAGENTO_RUN_TYPE | Used to set Magento store type. | store/website | store
FRONTEND_COMPILE_LANGUAGES | Used during static content deployment. It can be multiple language codes. | language code(s) separated by space | en_GB
MAGENTO_DEPENDENCY_INJECTION_COMPILE_COMMAND | Magento DI compile command | - | bin/magento setup:di:compile
MAGENTO_CRYPT_KEY | Magneto crypt key | - | -
COMPOSER_CUSTOM_CONFIG_COMMAND | Used to set any custom composer configuration, will be executed before composer install | composer config .. | -
AMQP_HOST | The hostname where RabbitMQ is installed. | string |
AMQP_PORT | The port to use to connect to RabbitMQ. | port number | 5672
AMQP_USER | The username for connecting to RabbitMQ. | string |
AMQP_PASSWORD | The password for connecting to RabbitMQ. | string |
AMQP_VIRTUALHOST | The virtual host for connecting to RabbitMQ. | string | "/"
MAGENTO_ENABLE_QUEUE | Should AMQP be used for queuing? | true/false | false
REDIS_HOST | Redis host name (to store cache and sessions) | - | redis
REDIS_PORT | Redis port | port number | 6379
MAGENTO_ENABLE_CACHE | Should redis be used for cache? | true/false | true
MAGENTO_USE_REDIS | Should redis be used for sessions? | true/false | true
REDIS_USE_SENTINEL | If you are running a redis cluster watched by sentinels and have Cm_Cache_Redis_Backend v1.10.x, set this to true to avoid trying to write to the redis followers | boolean | true/false
REDIS_SENTINEL_HOSTS | Comma seperated list of sentinel protocol/host/ports to talk to to find out which redis server is the leader | CSV of protocol/hostname/ports | tcp://redis-sentinel-0.redis-sentinel-headless:26379,tcp://redis-sentinel-1.redis-sentinel-headless:26379,tcp://redis-sentinel-2.redis-sentinel-headless:26379
REDIS_SENTINEL_MASTER | The name of the leader to ask the redis sentinels regarding. | string | mymaster
REDIS_SENTINEL_SERVICE_HOST | The hostname of the redis sentinel service. Used whilst magento_clear_redis_cache() function runs | hostname | redis-sentinel-headless
REDIS_SENTINEL_SERVICE_PORT | The port of the redis sentinel service. Used whilst magento_clear_redis_cache() function runs | 1-65535 | 26379
MAGENTO_REDIS_CACHE_DATABASE | Redis database number to store block cache | database number | 0
MAGENTO_REDIS_FULL_PAGE_CACHE_DATABASE | Redis database number to store full page cache | database number | 1
MAGENTO_REDIS_SESSION_DATABASE | Redis database number to store sessions | database number | 2
MAGENTO_REDIS_FORCE_STANDALONE | Should the extension phpredis be used, or should Credis be forced to use it's own standalone implementation of the redis protocol. Set by default to true (use the standalone implementation) as it is more able to handle connection problems than phpredis. | true/false | true
MAGENTO_ADMIN_FRONTNAME | Magento backend frontname | - | admin
MAGENTO_ADMIN_FRONTNAME_REGEX_ESCAPED | The admin URL "front name" that is configured for the magento application. Please escape any regular expression special characters. | regex escaped string | value of MAGENTO_ADMIN_FRONTNAME
MAGENTO_PROTECT_ADMIN | Should IP whitelisting/Basic Auth be deployed for the MAGENTO_ADMIN_FRONTNAME_REGEX_ESCAPED path? | true/false | false
MAGENTO_ADMIN_HTPASSWD | The htpasswd format `username:hashed_password` to protect admin with. Leave blank to just use IP Whitelisting. | htpasswd format username/passwords | empty
MAGENTO_ADMIN_IP_WHITELIST | The comma separated list of whitelisted IP addresses that can visit the admin path. Leave blank to just use htpasswd | CSV of IP addresses | Value of $AUTH_IP_WHITELIST, which may be blank or "<IP_ADDRESS>/32, ::1, <IP_ADDRESS>/14"
MAGENTO_ADMIN_USERNAME | If you would like to configure an admin user automatically (i.e. for development purposes), set this value to be the username for the admin user and MAGENTO_ADMIN_PASSWORD too. | string | empty
MAGENTO_ADMIN_PASSWORD | If you would like to configure an admin user automatically (i.e. for development purposes), set this value to be the password for the admin user (please make it secure!) and MAGENTO_ADMIN_USERNAME too. | string | empty
START_MODE | Start in "web" mode to serve a site, or "cron" mode to run the cron | (web|cron) | web
START_CRON | Start the cron if "true", regardless of START_MODE | true/false | false
RUN_REPORTS_CRON | When cron is running, should the outputting of the last minute's reports to stderr happen? | true/false | true
RUN_MAGENTO_CRON | When cron is running, should the magento cron run, or just the supporting web services that output logs? | true/false | true
MAGENTO_HTTP_CACHE_HOSTS | Comma separated list of upstream HTTP cache hosts (for example, varnish) that magento will PURGE when clearing full page cache | CSV of hostnames/IPs | empty
MAGENTO_HTTP_CACHE_PORT | Port to talk to on the upstream HTTP cache hosts | 1-65535 | 80
MAGENTO_ALLOW_ACCESS_TO_SETUP | Whether to allow access to the /setup URL or not | true/false | true
MAGENTO_ALLOW_ACCESS_TO_UPDATE | Whether to allow access to the /update URL or not | true/false | true
MAGENTO_CACHE_STATIC_ASSETS | If true, static assets under /static will be cached in varnish and potentially browsers for a very long time. We have made this an opt-in feature as you should ensure that the config value `dev/static/sign` is set to `1`, or you will find the next deployment doesn't update the assets for visitors who have visited your site before. | true/false | false
MAGENTO_ENABLE_CONFIG_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_LAYOUT_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_BLOCK_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_COLLECTION_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_REFLECTION_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_DDL_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_EAV_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_NOTIFICATION_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_FULLPAGE_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_CONFIG_INTEGRATION_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_CONFIG_INTEGRATION_API_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_TRANSLATE_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_CONFIG_WEBSERVICE_CACHE | If true, enable this cache type in /app/app/etc/env.php | true/false | true
MAGENTO_ENABLE_TARGET_RULE_CACHE | If true, enable the target rule cache type in /app/app/etc/env.php. Enterprise edition only. | true/false | true
MAGENTO_ENABLE_COMPILED_CONFIG_CACHE | If true, enable the compiled_config cache type in /app/app/etc/env.php. Magento 2.2 onwards | true/false | true
MAGENTO_ENTERPRISE_EDITION | If true, this installation of magento is the enterprise edition which allows you to use the target rule cache. | true/false | false

The following variables have had their defaults changed from the php-nginx image so that Magento 2 runs better:

Variable | Description | Expected values | Default
--- | --- | --- | ----
PHP_MEMORY_LIMIT | The memory limit for PHP. | string | 768M
PHP_MAX_EXECUTION_TIME | How long in seconds can a PHP script run for? | integer | 600
PHP_OPCACHE_MAX_ACCELERATED_FILES | How many files PHP can cache into Opcache | integer | 130987
PHP_REALPATH_CACHE_SIZE | How many resolved file locations PHP can cache into the realpath cache. | string | 4096K
PHP_REALPATH_CACHE_TTL | How many seconds can PHP cache the resolved file locations in it's realpath cache | integer | 600
PHP_OPCACHE_INTERNED_STRINGS_BUFFER | The amount of megabytes of strings to store a cache of. | integer (megabytes) | 64
PHP_OPCACHE_MEMORY_CONSUMPTION | How much memory in megabytes can opcache use? | integer | 512
PHP_OPCACHE_ENABLE_CLI | Should opcache be enabled on the PHP CLI? | 0/1 | 1

## Pipeline Deployment Mode

If `IMAGE_VERSION` is set to `3` and you are using Magento 2.2 or above, you can use u the Magento 2.2+
[deployment pipeline](https://devdocs.magento.com/guides/v2.2/config-guide/deployment/pipeline/) for building the
docker image and upgrading sites during do_setup().

To use the pipeline feature, run `bin/magento app:config:dump` on an existing installation and commit the resulting
`app/etc/config.php`.

The minimum configuration in `app/etc/config.php` that you appear to need for setup:static-content:deploy to work is:
1. `modules`
2. `scopes`
3. `themes`
4. the `system -> default -> general -> locale -> code`


text:
---
name: Update a release asset
example: octokit.rest.repos.updateReleaseAsset({ owner, repo, asset_id })
route: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}
scope: repos
type: API method
---

# Update a release asset

Users with push access to the repository can edit a release asset.

```js
octokit.rest.repos.updateReleaseAsset({
  owner,
  repo,
  asset_id,
});
```

## Parameters

      name
      required
      description

owner	yes

The account owner of the repository. The name is not case sensitive.

repo	yes

The name of the repository without the `.git` extension. The name is not case sensitive.

asset_id	yes

The unique identifier of the asset.

name	no

The file name of the asset.

label	no

An alternate short description of the asset. Used in place of the filename.

state	no

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/repos#update-a-release-asset).


text:
It has an API inspired by [negroni](http://godoc.org/github.com/codegangsta/negroni) and the [flag](http://godoc.org/flag) package.

## What is it?
Configure aims to be the `github.com/codegangsta/negroni` of configuration. It is a `Checker` manager, in the same way `negroni` manages `net/http` middleware. A `Checker` is a way of retrieving configuration values from a source: these can be easily made by completing the [Checker interface](http://godoc.org/github.com/paked/configure#Checker). The idea is that you as a developer provide Configure with a selection of `Checker`s, either built in or not and it will iterate over them attempting to find values defined by the developer. If a `Checker` is successful in its retrieval, then Configure will stop the iteration for that value. If it is not then Configure will attempt the next `Checker` in chronological order.

# Getting Started
After you have installed Go (and have made sure to correctly setup your [GOPATH](http://golang.org/doc/code.html#GOPATH)) create a new `.go` file, maybe `hello.go`.
```go
package main

import (
  "fmt"

  "github.com/paked/configure"
)

var (
  conf = configure.New()
  name = conf.String("name", "Harrison", "The name you want to greet")
)

func init() {
  conf.Use(configure.NewEnvironment())
  conf.Use(configure.NewFlag())
}

func main() {
  conf.Parse()
  fmt.Printf("Hello, %v", *name)
}
```
If you run this code with
```
go run hello.go
```
`Hello, Harrison` will be printed to your terminal, not that interesting right... read on!

### Stage One : Declaration
```go
var (
  conf = configure.New()
  name = conf.String("name", "Harrison", "The name you want to greet")
)
```
The declaration stage is important because it defines exactly what you CAN configure! First, `conf` is created which is your key to adding Checkers and retrieving variables. After that you begin properly declaring your variables, in this example only a string is declared but in practice you can use any number of `String`s, `Int`s or `Bool`s. The variables returned by these methods are pointers to their respective types.

### Stage Two : Configuration
```go
func init() {
  conf.Use(configure.NewEnvironment())
  conf.Use(configure.NewFlag())
}
```
The configuration stage is where you configure `configure` by adding Checkers to the stack. Checkers are objects which will attempt to retrieve your variables from their respective data sources. When a `Checker` fails the next one in the stack is called, the stack is in the same order that the `Checker`'s were added in. You can configure `configure` anytime before you call the `conf.Parse()` function, but the `init()` function provides a reliable place to do so.

*note:* When using the `Environment Checker`, all keys will be translated to uppercase and have dashes replaced with underscores (ie. `hello-world` to `HELLO_WORLD`).

### Stage Three : Usage
```go
func main() {
  conf.Parse()
  fmt.Printf("Hello, %v", *name)
}
```
The final stage is where you can actually use the variables you have declared. After using `conf.Parse()` your variables should then be populated and accesible by dereferencing it (`name`).

## Execution
If you were to run this code in its current state it would print `Hello, Harrison` because `Harrison` is the default value provided in the declaration stage. But if you provide `--name=Johny` when you execute the command it will print `Hello, Johny`. At this point `configure` is behaving like the default `flag` package through the `Flag` Checker.  You will see a `Hello, Jarvis`, as `configure` has fallen back upon the `Environment` Checker. Note that, if you provide both means of input the environment variable will be used, as it has higher priority as it was added before the `Flag` Checker in the configuration stage. This works with any number of Checkers from any source, as long as the fulfil [the `Checker` interface](http://godoc.org/github.com/paked/configure#Checker).

## Further Reading
[More package documentation can be found on godoc](http://godoc.org/pkg/github.com/paked/configure).

A more complicated example can be found in the [example folder](http://github.com/paked/configure/blob/master/example/), it uses all three variable types (`Int`, `Bool` and `String`) and all three of the default `Checker`'s (`JSON`, `Environment` and `Flag`).

# Contributing
If you notice something that you feel is broken or missing in configure feel free to open up an issue so that we can discuss it more. While small changes could be immediately put into a PR, I believe it saves everyones time to discuss major changes before implementing them. Contributions are welcome and appreciated.

# Checkers
| Name | Location | Initialiser |Description|
|---|---|---|---|
|Environment| ***[builtin]*** http://github.com/paked/configure |`NewEnvironment()` | Environment checks the os environment variables for values |
|JSON|***[builtin]*** http://github.com/paked/configure |`NewJSON(io.Reader)`| Retrieves values from an `io.Reader` containing JSON |
|Flag|***[builtin]*** http://github.com/paked/configure |`NewFlag()`| Retrieve flagged values from `os.Args` in a `--x=y` format|
|HCL|***[builtin]*** http://github.com/paked/configure |`NewHCL(io.Reader)`| Retrieve values from an `io.Reader` containing HCL|

If you write your own Checker I would *LOVE* to see it, create a PR with a new entry in the table!

# Note
As you may have noticed, I am not *particularly* great at English. If you notice a way to de-garble a few of my sentences be sure to let me know... Not only I, but future readers will be grateful too :)

###### *designed and implemented by [Harrison Shoebridge](http://github.com/paked)*

repository: paked/configure

gha_language: Go

repo_name: paked/configure


text:
# PaypalClone

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.5.

#### Epicodus Javascript Week 3 Project, 8.17.2018

#### By Protatodev (Thad Donaghue)

## Description

This website is designed to help users locate medical proffesionals in the greater Portland-metro area. The user is able to search for a doctor by inputting either an illness or a doctor's name. The resulting doctor's are then displayed back to the user for them to research.

## USER STORIES

| Behavior  |
|-----------|
| As a user, I need to be able to navigate the website using a navigation bar menu |
| As a user, I need to have information clearly displayed on the website |
| As a user, I need to be able to sign up for an account |
| As a user, I need to be able to log into my account |

## SPECS

| Behavior  |
|-----------|
| Design navigation menu (header) using a dedicated component |
| Design body and split features and areas of the body into separate components |
| Design footer element using a dedicated component |
| Design and implement features using components |
| Implement and deploy website to firebase |
| Add routing for any additional pages |
| Add authentication to allow user logins and account creation |

## Setup on OSX / Windows

* Download and install the latest version of `node.js` (see link section below)
* Download and install the angular/cli tool (version 1.6.5) using `npm install -g<EMAIL_ADDRESS>* Clone the repository
* In a command line, navigate to the folder and run `npm install`
* From the command line, run `ng serve --open`

## Testing Program Functionality (Command Line)

* No testing has been implemented

## Contribution Requirements

1. Clone the repo
1. Make a new branch
1. Commit and push your changes
1. Create a PR

## Technologies Used

* JavaScript (ES6)
* TypeScript
* Angular 2+
* Node.js
* npm
* Bootstrap 4.1.3

## Links

* https://github.com/protatodev/paypal-clone
* https://nodejs.org/en/

## License

This software is licensed under the MIT license.

Copyright (c) 2018 **Protatodev**

repository: snappycodernet/paypal-clone

repo_name: snappycodernet/paypal-clone


text:
---
title: '#DearID: On Learning to Program'
path: "/blog/dearid-on-learning-to-program"
date: '2016-11-03'
featured: "../featured/On-Learning-to-Program.png"
categories: ["Coding", "Dear ID Show"]
tags: ["coding", "learning experience design", "learning to code", "programming", "web development"]
---

This episode, I talk about my coding journey and how coding helps us to solve more problems as learning experience designers. You  may be evaluating whether or not learning to code is a worthwhile endeavor. I show how coding has helped me to expand my solution options, as well as why coding may not be for everyone.

<iframe src="https://simplecast.com/e/47495?style=medium-light" width="100%" height="94px" frameborder="0" scrolling="no" seamless=""></iframe>

I really want to hear what you guys think of this episode. I've heard from several IDs who are learning to code or wanting advice about whether they should learn to code. What would you say to them?

repository: anthkris/portfolio-site

repo_name: anthkris/portfolio-site


text:
min
===

a tiny framework that makes websites pretty

Written in LESS, compiled to CSS. Access the current beta (here) [http://minfwk.com/beta.html]

###Tiny
964 bytes minified and gzipped.

###Compatible
Works with IE5 and onward. Yes, min is even responsive in IE5.

Of course, modern browsers give you pretty transitions.

###License
MIT licensed.

repository: mpobrien/min

repo_name: mpobrien/min


text:
### 详细描述

<!--start-code-->

```vue
<template>
  <div>
    <Message
      type="info"
      title="Informational"
      description="Additional description and informations about copywriting."
    />

    <Message
      type="success"
      title="Success"
      description="Detailed description and advices about successful copywriting."
    />

    <Message
      type="warning"
      title="Warning"
      description="This is a warning notice about copywriting."
    />

    <Message
      type="error"
      title="Error"
      description="This is an error message about copywriting."
    />
  </div>
</template>
```

<!--end-code-->

repository: vsuite/vsuite

branch_name: refs/heads/dev

gha_language: JavaScript

repo_name: vsuite/vsuite


text:
# Architecture Design

## 1. Overview
#### 1.1 Background
Data quality is an important part of big data processing, and it is an essential support condition for data services, data analysis, data mining and other activities.

#### 1.2 System Summary
Qualitis is a data quality management service based on big data platform, providing a unified process to define and monitor the quality of data.

#### 1.3 Glossary
|Terminology |Description|
|--|--|
|project|   A project is a collection of rules. And the project is also one of the units for task scheduling.|
|rule|  A rule is a definition of a data source's data quality model. Rule is the base unit for task scheduling.|
|application|   Application is a verification task of data quality. You can verify data quality by running an application.|

## 2. Overall Design
#### 2.1 Architecture Design
![](../../../images/en_US/ch1/Architecture.png)

#### 2.2 Grayscale Design
Since each Qualitis Service is idempotent, we need to isolate the Qualitis service from accepting user requests to implement it.

#### 2.3 High availability/Performance Design
Since each Qualitis Service is idempotent, Qualitis HA can be reach by simultaneously starting multiple Qualitis services.As shown below：
![负载均衡](../../../images/zh_CN/ch1/负载均衡.png)
This strategy not only achieves HA, but also achieves performance improvements.

For performance design, the following option is also considered. But it has not been implemented yet.

1.Cache
Using distributed cache to cache the query results, you don't have to query the database every time, greatly reducing the pressure on the database and improving the speed of the query.

#### 2.4 Multi-threaded Synchronous Design
##### 1.Process Synchronization
Because there are multiple Qualitis instances, problems occurred when the status of the applications be refreshed at the same time. Therefore, the problem of process synchronization needs to be solved.

The Qualitis system uses ZooKeeper to coordinate multiple processes. Qualitis instances will compete for the establishment of temporary nodes in Zookeeper. Once a temporary node is established successfully, the instance will become the monitor instance. Only monitor instance can monitor the application and refresh the status of the applications.

##### 2.Thread Limit

When an appliacation is submitted, it is necessary to connect to the hive meta store to determine whether the database that stores the unverified data exists or not.

When there are more and more applications are submitted, it may cause a great load on the hive meta store, so we need to limit it.

Qualitis system uses thread pool to limit the connection to hive meta store. If there are no available thread in thread pool, the application will wait until the thread is obtained before connecting to the hive meta store.

## 3. Module Design
#### 3.1 Use Case
![](../../../images/en_US/ch1/UseCase.png)

## 4. Interface Design
#### 4.1 Internal interface
Internal interfaces are mainly divided into two types of interfaces:
**1.Administrator interface
2.User interface**

Administrator interface: /qualitis/api/v1/admin/\*
User interface: /qualitis/api/v1/projector/\*
Distinguish user rights through two different interface definitions.

#### 4.2 Outer Interface
Outer interface:/qualitis/outer/api/v1/\*
Such interface calls need to add the following parameters to the query:

|Parameter |Required | Type | Description|
| -- | -- |-- |-- |
|app_id  |yes |  string  |Authorized application APP_ID assigned by the system.|
|timestamp  | yes  | string | Timestamp in milliseconds, timeliness: 7 days.|
|nonce |  yes | string | Random number, length 5|
|signature |  yes  | string |  Encrypt the signature. Md5(md5(appId + nonce + timestamp) + appToken), where md5 in 32 lengths, lowercase|

Administrator will grant grant app_id and appToken external system.

## 5. System Engineering Structure Design
The engineering structure of the system can be divided into two layers, the Web layer and the Core layer.

The Web layer mainly includes Controllers and a Services, and mainly includes service layers that provide services externally. The Core layer mainly includes core logic codes and a storage layer.

repository: WeBankFinTech/Qualitis

path: /docs/en_US/ch1/Architecture Design.md

filename: Architecture Design.md

gha_language: Java

repo_name: WeBankFinTech/Qualitis


text:
# Getting started

In order to contribute to RTM you will first need to setup your environment.

## Setting up your environment

### Windows, Linux, and OS X for x86 and x64

1. Install *CMake 3.2* or higher (*3.14* for Visual Studio 2019, or *3.10* on OS X with *Xcode 10*), *Python 2.7 or 3*, and the proper compiler for your platform.
2. Execute `git submodule update --init` to get the files of external submodules (e.g. Catch2).
3. Generate the IDE solution with: `python make.py`
   The solution is generated under `./build`
   Note that if you do not have CMake in your `PATH`, you should define the `RTM_CMAKE_HOME` environment variable to something like `C:\Program Files\CMake`.
4. Build the IDE solution with: `python make.py -build`
5. Run the unit tests with: `python make.py -unit_test`
6. Build and run benchmarks with the `-bench` switch

On all three platforms, *AVX* support can be enabled by using the `-avx` switch and *AVX2* with `-avx2`. Intrinsic usage can be turned off with `-nosimd`.

### Windows ARM64

For *Windows on ARM64*, the steps are identical to *x86 and x64* but you will need *CMake 3.13 or higher* and you must provide the architecture on the command line: `python make.py -compiler vs2017 -cpu arm64`

### Android

For *Android*, the steps are identical to *Windows, Linux, and OS X* but you also need to install *NVIDIA CodeWorks 1R5* (or higher).

Note that it is not currently possible to run the unit tests with scripts, you will need to run them manually from Visual Studio:

*  Open the Visual Studio solution
*  Build and run on your device

Note that Android builds have never been tested on an emulator and that if you cannot code sign the APK, you will need to change the project ANT settings to use the debug configuration.

*We currently only support NVIDIA CodeWorks. Contributions welcome to also support the NDK natively with CMake*

Note that running the benchmark on Android can be done but it currently involves a number of manual steps.

### iOS

For *iOS*, the steps are identical to the other platforms but due to code signing, you will need to perform the builds from *Xcode* manually. Note that this is only an issue if you attempt to use the unit tests locally.

In order to run these manually:

*  Open the *Xcode* project for the appropriate tool
*  In the project settings, enable automatic code signing and select your development team
*  Build and run on your device

Note that *iOS* builds have never been tested on an emulator.

## Commit message format

This library uses the [angular.js message format](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits) and it is enforced with commit linting through every pull request.

repository: skubah/Plugins

repo_name: skubah/Plugins


text:
---
layout: post
title: Blogging Setup
published: true
disqus_identifier: Hello World
comments: true
category: setup
---

Hello BlogVisitor,

Below contains steps I followed for setting up a blog.

1. Installed GitHub, Jekyll.
2. Tested the website with http://localhost:4000
3. Uploaded to github

UPDATES:

4. Registered  with Disqus to get shortName. Comments section is present now.
5. Can embed code into website using gist.
6. I shall be providing a linkography in each article
  (similar to bibliography), containing list of links which has helped me with my experiments.
7. Listing of posts in home page.

<u>LinkoGraphy:-</u>

1. [Barry Clark's repo for setting up jekyll website](https://github.com/barryclark/jekyll-now)
2. [Scott Bom's markdown cheetsheet pdf](http://scottboms.com/downloads/documentation/markdown_cheatsheet.pdf)
3. [Listing of posts by Eric Jones](http://erjjones.github.io/blog/How-I-built-my-blog-in-one-day/)
4. [Listing of posts by Tom Preston Werner](http://tom.preston-werner.com/)

path: /_posts/2014-12-25-Blogging Setup.md

filename: 2014-12-25-Blogging Setup.md


text:
### nhlstats

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPI version](https://badge.fury.io/py/nhlstats.svg)](https://badge.fury.io/py/nhlstats)

A library and CLI tool for collecting stats from the NHL web API.

Currently, supported data types include event data such as shots / goals / hits / etc, shift information and general scheduling information.

All data is accessible identically through the Python API or command-line tool.

#### Install

Compatible with Python3.5+.

Use `pip`:

```bash
python3 -m pip install nhlstats
```

Or from source:

```bash
git clone https://github.com/tomplex/nhlstats.git ~/dev/nhlstats
python3 -m pip install ~/dev/nhlstats
# or
python3 ~/dev/nhlstats/setup.py install
```

This will add a new command to your system, `nhl`.

#### What this is (and isn't)

This is meant to be a tool to help obtain data about hockey games. I aim to make it easy to download data which people
who are more statistically inclined than I can use to make pretty pictures and graphs. I am also trying to, generally,
normalize and flatten the data so it easier to use in software which processes tabular data.

It's *not* meant to be a data model of all of the data available about the NHL. I'm not trying to create models for
 teams, rosters, players, events, etc. and all the hierarchies therein.  If that's what you want, then there is an excellent
 [library that already does that.](https://github.com/mhostetter/nhl)

#### The GameID

The key to NHL stats data is the "gameid", an ID which uniquely identifies every game.
It's a 10-digit numeric code which is formatted like so:

<PHONE_NUMBER>

This tool uses the gameid to obtain data for specific games. You can use the `list_games` python function or the `list-games` CLI
command to get game ID's which you can then use to drill down and get information for the games you care about.

#### Derived stats

Certain derived stats are added to each event. There are three flags - `is_shot`, `is_corsi`, `is_fenwick`, and a field
for `shot_distance` and `shot_angle`. The flag fields denote whether the event is a corsi, fenwick, or plain shot event,
and `shot_distance` and `shot_angle` describe the distance of the shot from the net in feet, and the angle of the shot
where 0 is head-on with the net.

If you want more derived stats added to the data feel free to let me know.

#### Usage - library

Let's say you want to write a script which you'll run once a day, which will find all games played on the given day and download all play-by-play data for each game into a CSV file, labelled with the game's ID.

```python
from nhlstats import list_games, list_plays
from nhlstats.formatters import csv

# List all games today and write all plays from each as a csv file named like the game_id
for game in list_games():  # No args will list all games today
    game_id = game['game_id']
    plays = list_plays(game_id)  # get plays, normalized

    with open('{}.csv'.format(game_id), 'w') as f:
        csv.dump(plays, f)

```

If you use Pandas, then you can create a dataframe directly from the data which comes back from list_plays or list_shifts:

```python
from nhlstats import list_plays, list_shifts
import pandas as pd

gameid = "2019020418"

plays = pd.DataFrame(list_plays(gameid))
shifts = pd.DataFrame(list_shifts(gameid))

plays.head()
shifts.head()

```

If you use [petl](https://petl.readthedocs.io/en/stable/), then you can use `petl.fromdicts()` to create a `TableContainer`:

```python
from nhlstats import list_plays
import petl as etl

gameid = "2019020418"

pipeline = etl.fromdicts(list_plays(gameid))

print(pipeline)
```

##### Formatters

The formatters package formats data into different types of output, for example CSV, JSON, or a
text-based table. Each formatter has a `dump` and `dumps` function which work similarly to Python's `json` module.
If you want to save your data as JSON, for example:

```python
from nhlstats import list_plays
from nhlstats.formatters import json

plays = list_plays('gameid')
with open('file.json', 'w') as f:
    json.dump(plays, f)

```

More detailed examples of the formatters are available below.

#### Usage - CLI

```
$ nhl --help
Usage: nhl [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  list-games   List all games from START_DATE to END_DATE.
  list-plays   List all play events which occurred in the given GAME_ID.
  list-shifts  List all shifts which occurred in the given GAME_ID.
  list-shots   List all shot events which occurred in the given GAME_ID.
```

Use the `--output-format` option to specify how to display the collected data. This option is available with all commands.
The default is `text`, which will pretty-print the data as a table. Other options include `csv`, `json`,
which will output a nested JSON like `{"data": [...]}`. The data from these commands will always be printed to stdout.
On Linux, MacOS or Windows you can use the `>` to redirect stdout to a new file
(will overwrite the contents if it exists), or `>>` to append to a file, like so:

```bash
nhl list-plays<PHONE_NUMBER> --output-format csv ><PHONE_NUMBER>.csv  # create a new file
nhl list-plays<PHONE_NUMBER> --output-format csv >> plays.csv  # append result to plays.csv
```

##### list-games

```bash
$ nhl list-games --help
Usage: nhl list-games [OPTIONS] [START_DATE] [END_DATE]

  List all games from START_DATE to END_DATE. Dates should be of the form
  YYYY-MM-DD. Both date arguments default to "today" by system time, so you
  can omit the final argument to get a range from the first date to today.

Options:
  --output-format [text|csv|json]
  --help                          Show this message and exit.
```

##### list-plays

```bash
$ nhl list-plays --help
Usage: nhl list-plays [OPTIONS] GAME_ID

  List all play events which occurred in the given GAME_ID.

Options:
  --output-format [text|csv|json]
  --help                          Show this message and exit.
```

##### list-shifts

```bash
nhl list-shifts --help
Usage: nhl list-shifts [OPTIONS] GAME_ID

  List all shot events which occurred in the given GAME_ID.

Options:
  --output-format [text|csv|json]
  --help                          Show this message and exit.

```

### Data schema

The raw event data from the NHL is highly nested, and doesn't always contain all keys. I flatten, normalize and cull the
data a bit to make it easier to display as tabular data and remove bits which didn't initially strike me as important.
I could always be convinced to add in more.

The initial events, as received from the NHL, look like this:

```json
{
  "players": [
    {
      "player": {
        "id": 8474189,
        "fullName": "Lars Eller",
        "link": "/api/v1/people/8474189"
      },
      "playerType": "Winner"
    },
    {
      "player": {
        "id": 8470144,
        "fullName": "Frans Nielsen",
        "link": "/api/v1/people/8470144"
      },
      "playerType": "Loser"
    }
  ],
  "result": {
    "event": "Faceoff",
    "eventCode": "DET52",
    "eventTypeId": "FACEOFF",
    "description": "Lars Eller faceoff won against Frans Nielsen"
  },
  "about": {
    "eventIdx": 3,
    "eventId": 52,
    "period": 1,
    "periodType": "REGULAR",
    "ordinalNum": "1st",
    "periodTime": "00:00",
    "periodTimeRemaining": "20:00",
    "dateTime": "2019-12-01T00:08:26Z",
    "goals": {
      "away": 0,
      "home": 0
    }
  },
  "coordinates": {
    "x": 0,
    "y": 0
  },
  "team": {
    "id": 15,
    "name": "Washington Capitals",
    "link": "/api/v1/teams/15",
    "triCode": "WSH"
  }
}
```

the same event, "normalized", looks like this:

```json
{
  "datetime": "2019-12-01T00:08:26Z",
  "period": 1,
  "period_time": "00:00",
  "period_time_remaining": "20:00",
  "period_type": "REGULAR",
  "x": 0.0,
  "y": 0.0,
  "event_type": "FACEOFF",
  "event_secondary_type": null,
  "event_description": "Lars Eller faceoff won against Frans Nielsen",
  "team_for": "WSH",
  "player_1": "Lars Eller",
  "player_1_type": "Winner",
  "player_1_id": 8474189,
  "player_2": "Frans Nielsen",
  "player_2_type": "Loser",
  "player_2_id": 8470144
}
```

### Formatters

The currently available formatters are `csv`, `json`, and `text`.

Using the `text` output format, we get a pretty-printed table with the data:

```
datetime                period  period_time    period_time_remaining    period_type      x    y  event_type       event_secondary_type     event_description                                                                 team_for    player_1             player_1_type      player_1_id  player_2             player_2_type      player_2_id  player_3          player_3_type      player_3_id  player_4          player_4_type      player_4_id
--------------------  --------  -------------  -----------------------  -------------  ---  ---  ---------------  -----------------------  --------------------------------------------------------------------------------  ----------  -------------------  ---------------  -------------  -------------------  ---------------  -------------  ----------------  ---------------  -------------  ----------------  ---------------  -------------
2019-11-30T23:00:31Z         1  00:00          20:00                    REGULAR                  GAME_SCHEDULED                            Game Scheduled
2019-12-01T00:08:21Z         1  00:00          20:00                    REGULAR                  PERIOD_READY                              Period Ready
2019-12-01T00:08:26Z         1  00:00          20:00                    REGULAR                  PERIOD_START                              Period Start
2019-12-01T00:08:26Z         1  00:00          20:00                    REGULAR          0    0  FACEOFF                                   Lars Eller faceoff won against Frans Nielsen                                      WSH         Lars Eller           Winner                 8474189  Frans Nielsen        Loser                  8470144
2019-12-01T00:09:03Z         1  00:20          19:40                    REGULAR         80    8  SHOT             Tip-In                   T.J. Oshie Tip-In saved by Jonathan Bernier                                       WSH         T.J. Oshie           Shooter                8471698  Jonathan Bernier     Goalie                 8473541
2019-12-01T00:09:09Z         1  00:26          19:34                    REGULAR         78  -34  HIT                                       T.J. Oshie hit Darren Helm                                                        WSH         T.J. Oshie           Hitter                 8471698  Darren Helm          Hittee                 8471794
2019-12-01T00:09:45Z         1  01:02          18:58                    REGULAR        -88   29  TAKEAWAY                                  Takeaway by Michal Kempny                                                         WSH         Michal Kempny        PlayerID               8479482
```

Using the `csv` formatter, we get csv-like output:

```csv
datetime,period,period_time,period_time_remaining,period_type,x,y,event_type,event_secondary_type,event_description,team_for,player_1,player_1_type,player_1_id,player_2,player_2_type,player_2_id,player_3,player_3_type,player_3_id,player_4,player_4_type,player_4_id
2019-12-02T01:42:03Z,1,00:00,20:00,REGULAR,,,GAME_SCHEDULED,,Game Scheduled,,,,,,,,,,,,,
2019-12-02T03:07:47Z,1,00:00,20:00,REGULAR,,,PERIOD_READY,,Period Ready,,,,,,,,,,,,,
2019-12-02T03:07:53Z,1,00:00,20:00,REGULAR,,,PERIOD_START,,Period Start,,,,,,,,,,,,,
2019-12-02T03:07:53Z,1,00:00,20:00,REGULAR,0.0,0.0,FACEOFF,,Leon Draisaitl faceoff won against Bo Horvat,EDM,Leon Draisaitl,Winner,8477934,Bo Horvat,Loser,8477500,,,,,,
2019-12-02T03:08:27Z,1,00:12,19:48,REGULAR,97.0,-19.0,HIT,,Bo Horvat hit Leon Draisaitl,VAN,Bo Horvat,Hitter,8477500,Leon Draisaitl,Hittee,8477934,,,,,,
2019-12-02T03:08:45Z,1,00:30,19:30,REGULAR,51.0,-36.0,TAKEAWAY,,Takeaway by Jordie Benn,VAN,Jordie Benn,PlayerID,8474818,,,,,,,,,
2019-12-02T03:09:16Z,1,01:01,18:59,REGULAR,-58.0,0.0,BLOCKED_SHOT,,Elias Pettersson shot blocked shot by Darnell Nurse,EDM,Darnell Nurse,Blocker,8477498,Elias Pettersson,Shooter,8480012,,,,,,
2019-12-02T03:11:13Z,1,02:58,17:02,REGULAR,76.0,-17.0,SHOT,Backhand,Joakim Nygard Backhand saved by Jacob Markstrom,EDM,Joakim Nygard,Shooter,8481638,Jacob Markstrom,Goalie,8474593,,,,,,
2019-12-02T03:11:24Z,1,03:09,16:51,REGULAR,7.0,-3.0,TAKEAWAY,,Takeaway by Tanner Pearson,VAN,Tanner Pearson,PlayerID,8476871,,,,,,,,,
```

the `json` formatter returns JSON identical to the normalized event above.

repository: AmeriFinn/nhlstats

repo_name: AmeriFinn/nhlstats


text:
# pm-creds

[![codeql](https://github.com/nuttmeister/pm-creds/actions/workflows/codeql.yaml/badge.svg?branch=master)](https://github.com/nuttmeister/pm-creds/actions/workflows/codeql.yaml)
[![release](https://github.com/nuttmeister/pm-creds/actions/workflows/release.yaml/badge.svg)](https://github.com/nuttmeister/pm-creds/actions/workflows/release.yaml)

pm-creds is a middle-ware between Postman and your credentials provider and securely sets your credentials as environmental variables on your requests or collections.

## Providers

Currently the following providers are fully supported.

|Provider|Method|Comment|
|-|-|-|
|AWS|Profiles (credentials and config files)|Supports permanent and temporary profiles stored in the credentials file.|
|AWS|Default evaluation chain|Supports fetching using default provider chain when using profile name $default.|

## Gettings started

We recommend you download one of the pre-built binaries.
You will find them for `macOS`, `linux` and `windows` under [releases](https://github.com/nuttmeister/pm-creds/releases).

### Building

You can build using go (version 1.16 or above) by running `cd pm-creds && go build`.

### Running

#### Usage help

```text
pm-creds --help
Usage of pm-creds:
  --config-dir string
        Location of the config files (default "/home/user/.pm-creds")
  --create-certs
        If certificates should be generated
  --create-config
        If the default config should be created
  --overwrite
        If new config/certificates should overwrite old
```

#### Generate config and certificates

To get started you will need to generate `default config` and `certificates`.
To do this run the commands below.

```shell
pm-creds --create-config --create-certs
```

If you config and / or certificates are broken for some reason you can add the flag `--overwrite`
and `--create-config` and/or `--create-certs` will allow you to overwrite the already existing files.

#### Adding an provider

Before you can use `pm-creds` you will need to add an provider! Currently only AWS is supported and it must be added to the `~/.pm-creds/providers.toml` file (or `\Users\username\.pm-creds\providers.toml` on windows) as follows.

```toml
[name]
type = "provider-type"
```

So for aws the following would suffice in most cases.

```toml
[aws]
type = "aws"
```

#### Running

To run the proxy just start it with `pm-creds` and wait for it to start listening.
It's possible to use a custom config directory, then specify the directory with the `--config-dir` option.

### Postman

You will need to configure Postman to use `pm-creds` properly by installing it's `CA Certificate` as well as the `Server Certificate`.

#### Configure Certificates

Go to `Settings -> Certificates`

##### CA Certificate

Add the `certs/ca-cert.pem` as Postmans `CA Certificate`. (default: `~/.pm-creds/certs/ca-cert.pem`).

##### Client Certificate

Then add a `Client Certificate` with the following settings.

```text
Host:     https://localhost:9999
CRT file: certs/server-cert.pem
KEY file: certs/server-key.pem
```

#### Adding profile to the environment

Either create a new environment in Postman or edit a current one and add the following variable.
This will control what aws profile you will use for any request made with this environment active.

```text
aws_profile: <the aws profile you want to use>
```

#### Adding AWS Auth to Request / Collection

Then choose the `AWS Signature` under `Authorization` on either the `Collection` or on the single `Request` with
the following settings.

```text
AccessKey    : {{aws_access_key_id}}
SecretKey    : {{aws_secret_access_key}}
AWS Region   : <set if you need it>
Service Name : <set if you need it>
Session Token: {{aws_session_token}}
```

#### Add Pre Request script to Request / Collection

Then create the following `pre-request script` on either the `Collection` or on the single `Request`.

To be sure to use the latest version of this script and for scripts for other providers please have a look in the `/postman` directory.

**Below example is for AWS**

```js
const profile = pm.environment.get("aws_profile")
if (!profile) {
    throw new Error("'aws_profile' variable not set")
}

pm.sendRequest({
    url: `https://localhost:9999/aws/${profile}`,
    method: "POST",
    }, function (_, response) {
        if (response.status == "OK") {
            const body = response.json()
            pm.variables.set("aws_access_key_id", body.accessKey)
            pm.variables.set("aws_secret_access_key", body.secretKey)
            if (body.sessionToken) {
                pm.variables.set("aws_session_token", body.sessionToken)
            }
            console.log(`using aws credentials from '${profile}'`)
            return
        } else {
            throw new Error(response.text() || "unknown error fetching aws credentials")
        }
    }
)
```

#### Run Postman Request

Run an `Request` that is configured with the Auth and Pre-request script on it or on the collection
as described above.

Once you hit send go to the console window and either authorize the request or not.

## Configuration

You can have a look at the `config.default.toml` file for the default configuration that will be created
when running with the `--create-config` option.

The default config directory is `~/.pm-creds`.

repository: shawon-barua/pm-creds

repo_name: shawon-barua/pm-creds


text:
 Booster-Calculator
===================

Booster-Calculator or Steam-Booster-Profit-Calculator (SBPF) calculates the most profitable booster depending on the games the user owns. It provides information on how much a booster-pack will cost in gems or the chosen currency. It also provides information how much a single card will cost for selling and buying (lowest price, average price, highest price).

>**Notice:** You can´t run this booster-calculator currently without the needed datasets. I will update this respository as soon as I can provide all the needed booster-data. I´m planning to provide as less data as possible so this booster-calculator will be as fast as possible.

What you need to run the booster-calculator:
-------------

1. Get your Steam-WebAPI Token [here][3] and insert it into **getBoosterData.php**

at ```$steamapi_key = 'insertyourapikeyhere';```

2. Set your login-credentials for your database **db_config.php**
(to be safe place this file outside of your webfolder and change the ```include_once 'db_config.php';``` in **db_connect.php** so it matches your chosen path)

3. Obviously you need a webserver with php-module and a databse (MySQL, MariaDB, ...)

> **Help us:** If you want to help, just provide us your dataset of gem-amounts per Booster-Pack. You can easily obtain these informations. It will only take you one minute.

> **Just follow these steps:**
>
> 1. Login to Steam with your User-Account
> 2. Go to [Boostercreator][1]
> 3. Open your browser-console
> Chrome: CTRL+SHIFT+J Firefox: CTRL+SHIFT+K
> 4. Insert the following code and press enter
> 5. Post your output on [paste.ee][2] or somewhere else
> 6. Comment your URL (use Issues-Section to comment - if possible use existing similiar "issue")
> ```javascript
> var gem_amounts = $J('#footer + script').text(); var sub1 = gem_amounts.substring(gem_amounts.indexOf('[{')); var sub2 = sub1.substring(0, sub1.indexOf('],')) + "]"; $J('body').append("<textarea style='height: 200px; width: 90%; position: absolute; z-index: 9000; background-color: black; color: green; top:0; overflow:auto;'>"+sub2+"</textarea>");
> ```

  [1]: http://steamcommunity.com/tradingcards/boostercreator/
  [2]: http://paste.ee/
  [3]: http://steamcommunity.com/dev/apikey


text:
---
layout: post
title:      "Controlled Forms in React"
date:       2020-11-17 02:42:24 +0000
permalink:  controlled_forms_in_react
---

Controlled forms are an important part of writing code when using React. So I read. Many times in the React docs. It wasn't until my instructor gave a rather silly example that all the pieces of a controlled form clicked for me.

Let's say you have a Login component where you can enter a username to gain access to another page on a website.
import React, { Component } from 'react'

```
export default class Login extends Component {

  render() {
    return (
      <>
        <h1>Enter Your Username</h1>
        <form>
          <label>
            Username:
            <input type='text' name='username' />
          </label>
          <input type='submit' value='submit' />
        </form>
      </>
    )
  }
}
```
The question posed is this, how can we use the input we see on the DOM and make user inputs work in a "React-y" way, more formally, give React it's beloved single source of truth. To do this we use the React provided jsx attribute "onChange" which keeps track of key strokes and knows to run whatever function it gets passed when it detects a change. So we add that to the input in the jsx.
   <input type='text' name='username' onChange={this.onChange} />

We then need the Login class to keep track of its internal state so we will add that to the top of its class with a default value of an empty string.
```
state = {
 username: '',
}
```
As well as the onChange function that will update state with the user's input.
 ```
 onChange = (e) => {
  this.setState({username: e.target.value})
}
```
Now if we
```
console.log(this.state.username)
```
inside the return we can see state changing every time a new key is entered into the input.

(Side note: need to add multiple fields to a form? Use this trick with destructuring to reuse your
```
onChange method for multiple inputs) ->
 onChange = (e) => {
    const {name, value} = e.target
    this.setState({[name]: value})
  }
	```
But this is still not a controlled form. It is uncontrolled, because what we rendered to the DOM is not necessarily what is in state. Confused? I was. So let's alter our onChange function a little bit:
```
 onChange = (e) => {
     let {name, value} = e.target
     value = value.split('').filter(char => char !=='e').join('')
     this.setState({[name]: value})
   }
	 ```
What this does is filter out a lowercase 'e' every time it is typed. If you implement this and are still console logging your state, they are no longer the same! In the input you can see "Merry Gentlemen" but in the console.log state it is registering as "Mrry Gntlmn". Ok...so this is rather contrived, but it made me see how a user's input and the updating state are different. And that's because the source of the user's input is the DOM itself, and not React.

To solve this, we add a value attribute to the input and set it equal to state.
```
<input type='text' name='username' onChange={this.onChange} value={this.state.username} />
```
Now if you type input into the username field, you will see as a user "Mrry Gntlmn" which matches what is being console.logged. Setting the value is a very important piece to turning this form from uncontrolled to controlled. Why does React and we as developers care so much about controlled forms? React is powerful enough to re-render elements as needed in the background, and you don't want your user to all of a sudden lose their input before its submitted. You can also use it for validations before a user even submits input. But as with many areas of developing, it's not always necessary, but it's good practice and a valuable skill to keep tucked into your back pocket.

Congrats! Now you can psych your friends out that their keys aren't working. And then explain that you're just using your react skills to render state as their input.

Happy coding!

The final file:
```
import React, { Component } from 'react'

export default class Login extends Component {

  state = {
    username: ''
  }

  onChange = (e) => {
    const {name, value} = e.target
    this.setState({[name]: value})
  }

  //silly onChange example
  // onChange = (e) => {
  //   let {name, value} = e.target
  //   value = value.split('').filter(char => char !=='e').join('')
  //   this.setState({[name]: value})
  // }

  render() {
    console.log(this.state.username)
    return (
      <>
        <h1>ADD YOURSELF TO THE HALL OF PET MEMES</h1>
        <form>
          <label>
            Username:
            <input type='text' name='username' onChange={this.onChange} value={this.state.username} />
          </label>
          <input type='submit' value='submit' />
        </form>
      </>
    )
  }
}
```

extension: markdown


text:
## Parse Server Changelog

### 2.1.4 (3/3/2016)

* New: serverInfo endpoint that returns server version and info about the server's features
* Improvement: Add support for badges on iOS
* Improvement: Improve failure handling in cloud code http requests
* Improvement: Add support for queries on pointers and relations
* Improvement: Add support for multiple $in clauses in a query
* Improvement: Add allowClientClassCreation config option
* Improvement: Allow atomically setting subdocument keys
* Improvement: Allow arbitrarily deeply nested roles
* Improvement: Set proper content-type in S3 File Adapter
* Improvement: S3 adapter auto-creates buckets
* Improvement: Better error messages for many errors
* Performance: Improved algorithm for validating client keys
* Experimental: Parse Hooks and Hooks API
* Experimental: Email verification and password reset emails
* Experimental: Improve compatability of logs feature with Parse.com
* Fix: Fix for attempting to delete missing classes via schemas API
* Fix: Allow creation of system classes via schemas API
* Fix: Allow missing where cause in $select
* Fix: Improve handling of invalid object ids
* Fix: Replace query overwriting existing query
* Fix: Propagate installationId in cloud code triggers
* Fix: Session expiresAt is now a Date instead of a string
* Fix: Fix count queries
* Fix: Disallow _Role objects without names or without ACL
* Fix: Better handling of invalid types submitted
* Fix: beforeSave will not be triggered for attempts to save with invalid authData
* Fix: Fix duplicate device token issues on Android
* Fix: Allow empty authData on signup
* Fix: Allow Master Key Headers (CORS)
* Fix: Fix bugs if JavaScript key was not provided in server configuration
* Fix: Parse Files on objects can now be stored without URLs
* Fix: allow both objectId or installationId when modifying installation
* Fix: Command line works better when not given options

### 2.1.3 (2/24/2016)

* Feature: Add initial support for in-app purchases
* Feature: Better error messages when attempting to run the server on a port that is already in use or without a server URL
* Feature: Allow customization of max file size
* Performance: Faster saves if not using beforeSave triggers
* Fix: Send session token in response to current user endpoint
* Fix: Remove triggers for _Session collection
* Fix: Improve compatability of cloud code beforeSave hook for newly created object
* Fix: ACL creation for master key only objects
* Fix: Allow uploading files without Content-Type
* Fix: Add features to http requrest to match Parse.com
* Fix: Bugs in development script when running from locations other than project root
* Fix: Can pass query constraints in URL
* Fix: Objects with legacy "_tombstone" key now don't cause issues.
* Fix: Allow nested keys in objects to begin with underscores
* Fix: Allow correct headers for CORS

### 2.1.2 (2/19/2016)

* Change: The S3 file adapter constructor requires a bucket name
* Fix: Parse Query should throw if improperly encoded
* Fix: Issue where roles were not used in some requests
* Fix: serverURL will no longer default to api.parse.com/1

### 2.1.1 (2/18/2016)

* Experimental: Schemas API support for DELETE operations
* Fix: Session token issue fetching Users
* Fix: Facebook auth validation
* Fix: Invalid error when deleting missing session

### 2.1.0 (2/17/2016)

* Feature: Support for additional OAuth providers
* Feature: Ability to implement custom OAuth providers
* Feature: Support for deleting Parse Files
* Feature: Allow querying roles
* Feature: Support for logs, extensible via Log Adapter
* Feature: New Push Adapter for sending push notifications through OneSignal
* Feature: Tighter default security for Users
* Feature: Pass parameters to cloud code in query string
* Feature: Disable anonymous users via configuration.
* Experimental: Schemas API support for PUT operations
* Fix: Prevent installation ID from being added to User
* Fix: Becoming a user works properly with sessions
* Fix: Including multiple object when some object are unavailable will get all the objects that are available
* Fix: Invalid URL for Parse Files
* Fix: Making a query without a limit now returns 100 results
* Fix: Expose installation id in cloud code
* Fix: Correct username for Anonymous users
* Fix: Session token issue after fetching user
* Fix: Issues during install process
* Fix: Issue with Unity SDK sending _noBody

### 2.0.8 (2/11/2016)

* Add: support for Android and iOS push notifications
* Experimental: cloud code validation hooks (can mark as non-experimental after we have docs)
* Experimental: support for schemas API (GET and POST only)
* Experimental: support for Parse Config (GET and POST only)
* Fix: Querying objects with equality constraint on array column
* Fix: User logout will remove session token
* Fix: Various files related bugs
* Fix: Force minimum node version 4.3 due to security issues in earlier version
* Performance Improvement: Improved caching


text:
# M3 Docker Builds

M3 docker images are built according to the following policy:

1. For all images, `${IMAGE}:master` will point to the latest build on `origin/master` for that image.

2. For all images, `${IMAGE}:latest` will point to the latest tagged release.

3. For all images, and for all releases, there will be an image tagged `${IMAGE}:${RELEASE}`.

4. For all images, if the `PUSH_SHA_TAG` environment variable is set to `true`, `${IMAGE}:${SHA}`
   will point to the latest build on `origin/master` for that image, where `$SHA` is the first 8
   characters of the SHA of the commit.

## Builds

This directory contains the  build scripts for building images according to the above policy, and is intended to be
called when `ci-scripts` is a submodule of another repo. The script requires an `images.json` to be passed as the first
arg to `build.sh`, however if unset will default to `docker/images.json`. The script requires a Buildkite docker
pipeline at `.buildkite/image-release-pipeline.yml` of the calling repo.

`images.json` has the config for each image, and the base
repository comes from the environment variable `M3_DOCKER_REPO`. For example, with the following config:

```bash
export M3_DOCKER_REPO=quay.io/m3
```

```json
{
  "images": {
    "m3dbnode": {
      "dockerfile": "docker/m3dbnode/Dockerfile",
      "aliases": [
        "m3db"
      ]
    }
  }
}
```

`quay.io/m3/m3dbnode` will be dual-published under `quay.io/m3/m3dbnode:latest` and `quay.io/m3/m3db:latest` for
the latest release.

gha_language: Shell