text:
# Nordic BLE Protocol Buffers Service Example

![Sheep](images/protobuf.jpg)

This example requires use of the NRF52 development kit. If you have no idea what the repository is, [head on over to part 1 of the tutorial.][part1] Ready for the next step? [Part 2 is available here.][part2]

This repository is also a great starting point for developing a Bluetooth Low Energy project that needs OTA DFU.

Note: use this repository in conjunction with the [Javascript test app.](https://github.com/jaredwolff/ble-protobuf-js)

## Setup for OSX (tested)

1. Initialize the full repository (there are submodules!): `git submodule update --init`
1. Install `protoc` using Homebrew: `brew install protobuf`
1. Run `make sdk`. This will download your SDK files.
1. Run `make tools_osx`. This will download your ARMGCC toolchain (for Mac). For other environments see below.
1. Run `make gen_key` once (and only once)! This will set up your key for DFU.
1. Run `make` and this will build your bootloader and main app.
1. Run `make flash_all` to flash the whole app to your NRF52 Development Kit.
1. Run `make debug` to connect to the device for debugging. Then, run `jlinkrttclient` to get your debug console. Both steps are required.

## Setup for other platforms

1. Download `gcc-arm-none-eabi-6-2017-q2-update` toolchain from [here](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads).
1. Set your `GCC_ARM_TOOLCHAIN` environment variable to the path where you extracted your toolchain (usually <path>/<to>/gcc-arm-none-eabi-6-2017-q2-update/bin)
1. Install [`nrfutil`](https://github.com/NordicSemiconductor/pc-nrfutil)
1. Install [`nrfjprog`](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF5-Command-Line-Tools/Download#infotabs)
1. In the makefile update your `MERGEHEX` and `NRFJPROG` variables to the full path where those binaries are.
1. Install `protoc`. [More info here.](https://developers.google.com/protocol-buffers/docs/downloads)

## Creating your own Protocol Buffer

### The `.proto` and `.options` files

Create a file called `command.proto`. You can make the contents of that file what's below:

```
syntax = "proto3";

message event {
  enum event_type {
    command = 0;
    response = 1;
  }
  event_type type = 1;
  string message = 2;
}
```

It may look foreign at first but once you take a deeper look, it’s not that much different than a standard C struct or hash table.

I'm using two types of data in this example: a `string` and `enum` as a type. There are actually a few more which you can read up at the [documentation](https://developers.google.com/protocol-buffers/docs/proto). When compiled, the equivalent c struct looks like:

```c
/* Struct definitions */
typedef struct _event {
    event_event_type type;
    char message[64];
/* @@protoc_insertion_point(struct:event) */
} event;
```

Where `event_event_type` is

```c
/* Enum definitions */
typedef enum _event_event_type {
    event_event_type_command = 0,
    event_event_type_response = 1
} event_event_type;
```

You can nest as many messages inside each other as your hearts content. Typically though, a message is as small as possible so data transmission is as efficient as possible. This is particularly important for resource constrained systems or LTE deployments where you're charged for *every* megabyte used. **Note:** when elements are not used or defined they are typically *not* included in the encoded Protocol Buffer payload.

Normally, when you create a generic message like this, there is no limit to the size of the string `message`. That option can be set in the `.options` file:

```
event.message	max_size:64
```

This way, the memory can be statically allocated in my microprocessor code at compile time. If the message size is greater than 64 bytes then it will get chopped off in the code (or you'll simply get an error during decode). It's up to you, the software engineer, to figure out the absolute maximum amount of bytes  (or characters) that you may need for this type of data.

You can look at more of the `nanopb` related features at [their documentation.](https://jpa.kapsi.fi/nanopb/docs/concepts.html)

### Compiling the `.proto` and `.options` files

Using this repository, it's as simple as running `make protobuf`. The files can be individually compiled as well:

If we want to generate a static Go file the command looks like:

```bash
protoc -I<directory with .proto> --go_out=<output directory> command.proto
```
If you've installed the nanopb plugin, you can do something similar to generate C code:

```bash
protoc -I<directory with .proto> -ocommand.pb command.proto
<path>/<to>/protogen/nanopb_generator.py -I<directory with .proto> command
```
The first file creates a generic "object" file. The second actually creates the static C library.

For javascript:

```bash
pbjs -t static-module -p<directory with .proto> command.proto > command.pb.js
```

## Creating your own Service

Note: A more in-depth description is located in [Part 2.][part2]

In this example, our Bluetooth Low Energy service is based off of `ble_bas` (Nordic's definition of the battery service). The battery measurement bits have been removed from this example along with renaming most of the elements to be consistent with using Protocol Buffers.

Here's a description of some of the important function calls:

Initialization of the service happens in `ble_protobuf_init`.
Events for this service are funneled into `ble_protobuf_on_ble_evt`. This is probably the most important function as it allows us to receive and decode data from a Bluetooth Low Energy Connection.

`ble_protobuf_init` is also split up into another function which adds the "command" characteristic to the service. Without this static function, we'd have a service to connect to but no exposed "end points" to read or write data.

`ble_protobuf_on_ble_evt` forwards write events to the `on_write` function. Here, data is decoded, modified and then made available for reading. In this case a simple read and write is used for this characteristic. There are other examples in the Nordic SDK that use notifications. Notifications are event based so the device doesn't have to be polled while waiting for data.

All initialization of the service happens in `services_init` in `main.c`. I encourage you to take a look to see how it's done. The initialization is dictated by an initialization struct `ble_protobuf_init_t`. This struct defines not only a callback but it also defines the security settings for the characteristic.

This service has been created so you can modify it and make it your own. Often Protocol Buffer data will want to be pushed into the "main context." You can use `p_protobuf->evt_handler()` to make data available in `main.c`. In this example `p_protobuf->evt_handler` a pointer to `ble_protobuf_evt_hanlder`.

## License

MIT Licensed

[part1]: https://www.jaredwolff.com/how-to-define-your-own-bluetooth-low-energy-configuration-service-using-protobuf/
[part2]: https://www.jaredwolff.com/how-to-protocol-buffer-bluetooth-low-energy-service-part-2/

repository: jaredwolff/ble-protobuf-example

repo_name: jaredwolff/ble-protobuf-example


text:
# ZIO Redis

| CI                                       | Discord                                   |
|------------------------------------------|-------------------------------------------|
| [![CircleCI][Badge-Circle]][Link-Circle] | [![Discord][Badge-Discord]][Link-Discord] |

ZIO-based Redis client.

> The client is still a work-in-progress. Watch this space!

[Badge-Circle]: https://circleci.com/gh/zio/zio-redis/tree/master.svg?style=svg
[Badge-Discord]: https://img.shields.io/discord/629491597070827530?logo=discord
[Link-Circle]: https://circleci.com/gh/zio/zio-redis/tree/master
[Link-Discord]: https://discord.gg/2ccFBr4

repository: kostjas/zio-redis

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: kostjas/zio-redis


text:
# Chipmunk Game Dynamics

## About

Chipmunk is a simple, lightweight and fast 2D rigid body physics library written in C. It's licensed under the unrestrictive, OSI approved MIT license. My aim is to give 2D developers access the same quality of physics you find in newer 3D games. I hope you enjoy using Chipmunk, and please consider donating to help make it worth our time to continue to support Chipmunk with great new features.

## Contracting

Howling Moon Software (my company) is available for contracting if you want to make the physics in your game really stand out. Given our unique experience with the library, we can help you use Chipmunk to it's fullest potential. Feel free to contact us through our webpage: http://howlingmoonsoftware.com/contracting.php

## Building

### Mac OS X

There is an included XCode project file for building the static library and demo application. Alteratively you could use the CMake files.

### iOS

The XCode project can build a static library with all the proper compiler settings. Additionally, if you run the iphonestatic.sh script in the macosx/ directory, it will build you a fat library compiled as release for the device and debug for the simulator. After building that, just copy the static lib and include/chipmunk/ directory to your project.

## Getting Started
First of all, you can find the C API documentation here: http://code.google.com/p/chipmunk-physics/wiki/Documentation

A good starting point is to take a look at the included Demo application. The demos all just set up a Chipmunk simulation space and the demo app draws the graphics directly out of that. This makes it easy to see how the Chipmunk API works without worrying about the graphics code. You are free to use the demo drawing routines in your own projects, though it is certainly not the recommended way of drawing Chipmunk objects as it pokes around at the undocumented parts of Chipmunk.

## Forum

http://www.slembcke.net/forums

## Contact
<EMAIL_ADDRESS>(also on Google Talk)

## History

### CHANGES SINCE 5.0.0

* Fixed a NaN issue where raycasts for horizontal or vertical lines would end up in an infinite loop.
* Fixed a number of memory leaks.
* Fixed a number of warnings for various compiler/OS combinations.
* Fixed a number of API issues:
  * Rejecting a collision from a begin() callback permanently rejects the collision until separation.
  * Erroneous collision type parameterns removed from cpSpaceDefaulteCollisionHandler().
* Moved FFI declarations of inlined functions into their own header.
* Rearranged the project structure to separate out the header files into a separate include/ directory.
* Added a static library target for the iPhone.
* Type changes when building on the iPhone to make it friendlier to other APIs.
* Added an AABB query to complement point and segment queries.
* Added CP_NO_GROUP and CP_ALL_LAYERS constants.

### CHANGES SINCE 4.x

* Brand new Joint/Constraint API: New constraints can be added easily and are much more flexible than the old joint system
* Efficient Segment Queries - Like raycasting, but with line segments.
* Brand new collision callback API: Collision begin/separate events, API for removal of objects within callbacks, more programable control over collision handling.

repository: davidmorford/GameBuildKit

repo_name: davidmorford/GameBuildKit


text:
This project aims to provide a better UI for Google's Drive function and allows to quickly index all your files. Cloudflare Workers allow you to write JavaScript which runs on all of Cloudflare's 150+ global data centers.

![GoIndex Drive](https://github.com/CHEF-KOCH/goindex-drive/blob/master/.github/old%20code/Logo/go-drive-logo.gif?raw=true?raw=true)

## Table of Contents
* [Table of Contents](#table-of-contents)
  * [Main Features](#main-features)
  * [Requirements](#requirements)
  * [Supported formats](#supported-formats)
  * [To-do](#to-do)
* [Setup Cloudfare Workers](#setup-cloudfare-workers)
  * [CloudFlare Workers Limits](#cloudflare-workers-limits)
* [Self-Hosting](#self-hosting)
* [Obtaining the client ID & client secret](#obtaining-the-client-id--client-secret)
  * [Manually deploy via rclone](#manually-deploy-via-rclone)
* [Build Instructions](#build-instructions)
  * [GoIndex Auto Code Builder](#goindex-auto-code-builder)
* [FAQ](#faq)
  * [How to use Share Drive (previously known as TeamDrive) instead of your normal Drive?](#how-to-use-share-drive-previously-known-as-teamdrive-instead-of-your-normal-drive)
  * [How to add password to your Google Index?](#how-to-add-password-to-your-google-index)
  * [Why can't I watch videos within the Browser?](#why-cant-i-watch-videos-within-the-browser)
  * [I see ads while watching videos with a Adobe Flash supported Browsers!](#i-see-ads-while-watching-videos-with-a-adobe-flash-supported-browsers)
  * [What does `0:/` means?](#what-does-0-means)
  * [What is Error 1027?](#what-is-error-1027)
  * [Screenshot](#screenshot)
* [Tutorial Guides for beginners](#tutorial-guides-for-beginners)
* [Credits](#credits)
* [License](#license)

### Main Features
* Choose between a Light or Dark (_default_) theme.
* Choose from multiple borders colours.
* Integrated Search function.
* Playable Audio/Video files for e.g. mp4 files without the need to download them to preview it.
* Works with GDrive/ShareDrive (prev. known as TeamDrive).
* Multi-level Search within your Share Drive.
* Basic Encryption support (_does not include rclone based encryption/decryption_)

### Requirements
* [Google Account](http://account.google.com/)
* [CloudFlare Account](https://workers.cloudflare.com/)
* [Google Indesx Source Code](https://github.com/CHEF-KOCH/goindex-drive)

### Supported formats

| Image, Audio, Video or Document   |      Format      |  Supported? |
|:----------:|:-------------:|:------:|
| Video | .asf | ✅ |
| Video | .avi | ✅ |
| Video | .flv | ✅ |
| Video | .mkv | ✅ |
| Video | .mov | ✅ |
| Video | .mp4 | ✅ |
| Video | .mpeg | ✅ |
| Video | .mpg | ✅ |
| Video | .rm | ✅ |
| Video | .rmvb | ✅ |
| Video | .ts | ✅ |
| Video | .webm | ✅ |
| Video | .wmv | ✅ |
| Audio | .flac | ✅ |
| Audio | .m4a | ✅ |
| Audio | .mp3 | ✅ |
| Audio | .ogg | ✅ |
| Audio | .wav | ✅ |
| Audio | AAC 2.0 based | ❌ |
| Document | .css | ✅ |
| Document | .go | ✅ |
| Document | .html | ✅ |
| Document | .java | ✅ |
| Document | .js | ✅ |
| Document | .json | ✅ |
| Document | .md | ✅ |
| Document | .pdf | ✅ |
| Document | .php | ✅ |
| Document | .sh | ✅ |
| Document | .txt | ✅ |
| Image | .bmp | ✅ |
| Image | .gif | ✅ |
| Image | .jpeg | ✅ |
| Image | .jpg | ✅ |
| Image | .png | ✅ |

### To-do
- [ ] A small button to grab all download links in a directory
- [ ] Automatically fetch subtitles
- [ ] Better error fallback page & debug log under files to see problems like rate limit, api limit coming from Google to know what's going on.
- [ ] Checksum support
- [ ] Display VirusTotal results for files below (135 MB _VTs limit for free accounts_)
- [ ] Display srt subtitles from /sub folders or same dir as video file
- [ ] Display uploader or his GMail to identify who uploaded which file
- [ ] Full epub support
- [ ] Full oAuth support
- [ ] H.265/HEVC playable files
- [ ] Image viewer should not require opening new page
- [ ] Improve search function e.g. real-time search & filter options
- [ ] Multi-language support.
- [ ] Sort function via three-dot (or hamburger) menu.
- [ ] URL encode the download link
- [ ] Folderslash issues.
- [ ] Replace Video Flash player with HTML5 one.
- [ ] [JDownloader support](https://board.jdownloader.org/showthread.php?t=83613) including [logins](https://board.jdownloader.org/showthread.php?t=84669)
- [ ] Remove ads from the [theme](https://github.com/Aicirou/goindex-theme-acrou), in the meantime you better use an ad-blocker (_I know you already use one_).
- [x] Add Final / Beta branch
- [x] Add refresh tokens support
- [x] Add support for Support Http Basic Auth
- [x] Add the ability to add multiple share drives
- [x] Correct "How to use instructions"
- [x] Encrypted file storage
- [x] Integrate a working search function
- [x] Integrate multi-level search within the team drive
- [x] Mobile friendly
- [x] PDF support
- [x] Password protected home dir or entire drive
- [x] Remove all Chinese code/comments
- [x] Remove useless icon in the right corner which points to the outdated source
- [x] Support multiple drives (personal & team) without changing server's code
- [x] [Fix Apostrophe (') in file names (throws an error)](https://github.com/kulokenci/goindex-drive/issues/17)

## Setup Cloudfare Workers
* Go to the [official CloudFlare Workers Website](https://workers.cloudflare.com/).
* Sign-up (it's free) using your eMail & password and enter a subdomain name `<-your-name->_.workers.dev` and then click `Set up`.

**Now verify your current Worker**

* Verify your eMail and go to `Workers`, press `Create a Worker`.
* Now copy the content of the [index.js](https://github.com/CHEF-KOCH/goindex-drive/blob/master/goindex/go2index/index.js) to the script section.

* Edit this object in the script with the details you generated above
```js
var authConfig = {
    "siteName": "GoIndex",  // Sitename
    "root_pass": "",        // root password, leave it blank if you don't want
    "version" : "1.0.6",    // Program Version
    "hash" : "master",      // master OR your HASH, do not leave blank (changes each time you make a commit)
    "theme" : "classic",    // material  classic
    "client_id": "****************************.apps.googleusercontent.com", // client_id from rclone config
    "client_secret": "*******************", // client_secret from rclone config
    "refresh_token": "******************************************", // authorized refresh token from rclone config
    "root": "0AG1OSyxjvYcLUk9PVA" // ROOT_FOLDER from rclone config
};
```

**What you need to know**
* If you have connected Share Drive (Team Drive) with rclone then make sure you specify the Share Drive's root folder. For example `"root": "0AG1OSyxjvYcLUk9PVA"`.
* If you want to use `My Drive` then simply write "root". For Example `"root": "root"`.
* Each time you make a commit/deploy to a file its HASH will change. To access the new file you have to specify the hash OR keep it default with `"hash" : "master"`.

### CloudFlare Workers Limits
* FREE - 100k request per day (that is what you typically choose)
* $5/month - 10M requests/month

## Self-Hosting

## Obtaining the client ID & client secret
* Log into the [Google API Console](https://console.developers.google.com/) with your Google account. It doesn’t matter which Google account you use but it need not be the same account as the Google Team Drive Drive you want to access.
* Select a project or create a `new project`.
* Under `ENABLE APIS AND SERVICES` search for `Drive`, and enable the `Google Drive API`.
* Click `Credentials` ([this one](https://console.developers.google.com/apis/credentials/oauthclient)) in the left-side panel **DO NOT** click on `Create credentials` because this will only open a setup wizard).
* It will prompt you to set the `OAuth` consent screen product name, if you haven’t set one already.
* Click `OAuth Consent Screen` > `User Type` > `External` > `Application Name`.
* Click `Credentials` in the left-side panel, then `Create credentials`, then `OAuth client ID`.
* Choose an application type `other`, and click `Create`, _the default name is fine_.

It will show you a `client ID` and `client secret`. Use these values in rclone config to add a new remote or edit an existing remote.

### Manually deploy via rclone
1. Install [rclone](https://github.com/rclone/rclone) software locally.
2. Follow the given instructions under [https://rclone.org/drive/](https://rclone.org/drive/) to bind a drive.
3. Execute the `commandrclone config file` to find the file `rclone.conf path`.
4. Open `rclone.conf`,find the configuration `root_folder_id` and `refresh_token`.
5. Download `index.js` in [https://github.com/CHEF-KOCH/goindex-drive/blob/master/goindex/go2index/index.js](https://github.com/CHEF-KOCH/goindex-drive/blob/master/goindex/go2index/index.js) and fill in `root` and `refresh_token`.
6. Deploy the code via [Cloudflare Workers](https://workers.cloudflare.com).

## Build Instructions

### GoIndex Auto Code Builder

You can use the following pages to generate your own `index.js` (the file you need for the CloudFlare Workers part).

Follow the instructions provided over [here](https://g-index.glitch.me) another mirror can be found over [here](https://gencode.ve.workers.dev) or [here](https://goindex.glitch.me/).

## FAQ

### How to use Share Drive (previously known as TeamDrive) instead of your normal Drive?
* Copy your shared drive ID `DriveURL/drive/folders/<unique-ID>` (example: `1ffgFstW0fotDfDNlU9fyNiEstrWy3b6s` the [random folder ID](https://pirate.london/g-suite-team-drive-sharing-yes-you-can-not-you-cant-yes-you-can-db0a4e3e6220) is your folder) and set it as your root dir.
* **DO NOT** copy the whole URL `DriveURL/drive/folders/` URL, you only need the specific and unique folder ID!

### How to add password to your Google Index?

* Login into your CloudFlare account.
* Open the dashboard and click on Workers.
* Tap on Quick Edit on right corner (just beside Rename)
* In the Script tab - find `user` and `pass` (they're in the roots field).
* That's it. Fill them up and lock your index!

### Why can't I watch videos within the Browser?

Because it currently uses Adobe Flash which is blocked by default (end-of-life product) in all Browsers. I'm working on a secure replacement.

### I see ads while watching videos with a Adobe Flash supported Browsers!

Ads are rarely visible within the video, they are coming from the Theme. I'm going to remove that, in the meantine use an ad-blocker.

### What does `0:/` means?

The 0:/ part indicates that external users do not have root rights (normal users) [it's only relevant if you add more than one team Drive and use a Password to protect the root dir.

### What is Error 1027?

This means your rate limit was reached (100k hits per day).

### Screenshot

**Dark Theme**
![Dark Theme](https://github.com/CHEF-KOCH/goindex-drive/blob/master/Screenshots/material-dark.png?raw=true)

## Tutorial Guides for beginners
* Check the [video demo](https://www.youtube.com/watch?v=8WMddzVX1Dw).
* Check the step-by-step guide over [here](https://telegra.ph/G-Index-DarkMode--MultiAuth--English--TD-Maker--Custom-Domainga-Tutorial-04-29).
* How do I just download files without previewing them? Simple, just remove `?a=view` or use the download button in the right corner.

## Credits
* Search Base: [w3Schools](https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_filter_list)
* Search Function: [MakItWeb](https://makitweb.com/jquery-search-text-in-the-element-with-contains-selector/)
* Source: [LeeluPradhan/G-Index](https://github.com/LeeluPradhan/G-Index), the Chinese code can be found over [here](https://github.com/yanzai/goindex)
* Source: [ParveenBhadooOfficial](https://github.com/ParveenBhadooOfficial/Bhadoo-Drive-Index/blob/master/README.md)
* Source: [alx-xlx / goindex](https://github.com/alx-xlx/goindex/)
* Source: [maple3142](https://github.com/maple3142/GDIndex)
* Video: [INDIA - Create Google Drive Index using CloudFlare Workers](https://www.youtube.com/watch?v=8WMddzVX1Dw)
* Worker Script (Multiple Google Accounts) : [index-multiple-accounts.js](https://github.com/alx-xlx/goindex/blob/master/goindex-acrou/go2index/index-multiple-accounts.js)

## License
This project is forked from [kulokenci/goindex-drive](https://github.com/kulokenci/goindex-drive) and re-licensed under the [MIT license](https://github.com/CHEF-KOCH/goindex-drive/blob/master/LICENSE).

All sub-license files are includes in the root folder.

license: MIT

repository: Pritam-Patra/goindex-drive

gha_license_id: NOASSERTION

repo_name: Pritam-Patra/goindex-drive


text:
[**Review #119 | Scotch Review #47 - Kilchoman 5yr Single Cask ex-bourbon**]( https://t8ke.review/review-119-kilchoman-5yr-ex-bourbon/)

**The Schtick:** Admittedly, the label got ripped off of this sample, so its time for a little adventure.

-----

**Distiller:** Kilchoman

**Bottler:** Kilchoman

**Selection:** N/A

**ABV:**    % ABV

**Age:** 5 Years

-----

**Nose:**  It smells like a Subway. Thats right. And this is a good thing. I mean the sandwich shop, if there was any confusion. Theres a great variety of doughy yeast sweetness, vegetal notes floating throughout and some earthy tones as well. Theres also a nice waft of vanilla and a good deal of woody cinnamon.

**Taste:** Its smokey and peaty. Theres slight vegetation but not to the rotting moss level. Theres some savory barbecue and a good deal of ash here as well. I like Kilchoman because their take on peat is very different than the other major players and I think this does them well.

**Finish:** Its long but relatively hot. Im not sure of the proof but I wouldnt put it much over 100pf. Theres more peat and vanilla, with the dough and BBQ notes taking a backseat.

**Overall:** Its not the best whiskey Ive ever had but its interesting and complex and really quite unique. Ive said it before, but I look forward to seeing what Kilchoman does as the years tick by.

Thanks for reading!

**Rank: 5**

-----

**10 Most Recent Kilchoman Expressions I Have Reviewed:**

- [Review #1012. Kilchoman 10yr Ex-Bourbon Single Cask Distillery Exclusive]( https://t8ke.review/review-1012-kilchoman-10yr-ex-bourbon-single-cask-distillery-exclusive/)

- [Review #1002. Kilchoman Machir Bay]( https://t8ke.review/review-1002-kilchoman-machir-bay-rays-wine-and-spirits-selection/)

- [Review #1010. Kilchoman 10yr Single Cask Oloroso Matured]( https://t8ke.review/review-1010-kilchoman-10yr-single-cask-oloroso/)

- [Review #1006. Kilchoman Loch Gorm]( https://t8ke.review/review-1006-kilchoman-loch-gorm/)

- [Review #1008. Kilchoman 100% Islay 8th Edition]( https://t8ke.review/review-1008-kilchoman-100-islay-8th-edition/)

- [Review #1060. Kilchoman 2009-2014 Sherry Cask]( https://t8ke.review/review-1060-kilchoman-2009-sherry-cask/)

- [Review #1132. Kilchoman 5yr Red Wine Douro Cask]( https://t8ke.review/review-1132-kilchoman-5yr-red-wine-douro-cask/)

- [Review #1004. Kilchoman Sanaig]( https://t8ke.review/review-1004-kilchoman-sanaig/)

- [Review #116. Kilchoman Sherry Cask]( https://t8ke.review/review-116-kilchoman-sherry-cask/)

- [Review #119. Kilchoman 5yr Single Cask ex-bourbon]( https://t8ke.review/review-119-kilchoman-5yr-ex-bourbon/)

-----

[WEBSITE](https://t8ke.review) | [SEARCHABLE ARCHIVE](https://t8ke.review/review-archive/) | [SUBREDDIT](https://reddit.com/r/t8kereviews)

-----

Decoded:

**1** | **Disgusting** | So bad I poured it out.

**2** | **Poor** | I wouldn't consume by choice.

**3** | **Bad** | Multiple flaws.

**4** | **Sub-par** | Not bad, but many things I'd rather have.

**5** | **Good** | Good, just fine.

**6** | **Very Good** | A cut above.

**7** | **Great** | Well above average

**8** | **Excellent** | Really quite exceptional.

**9** | **Incredible** | An all time favorite

**10** | **Perfect** | Perfect

----


text:
Output format is hh:mm:ss (including the ":")

----------------------------------------------------------

For example:

# 08:24:50

![](https://i.imgur.com/kpIQlcK.jpg)

---------------------------------------------------------

Demo:

https://twitter.com/eimon9j6/status/1436591814941843457

----------------------------------------------------------

Components:

* Arduino Uno R3
* Expansion
* Solderless Breadboard MB-102
* Mini Board
* Jumper Wire x 18
* Matrix Led 8x8
* USB Cable
* Battery 9V Cable  (or even better a powerbank 10000mAh  - turns out it consumes a lot of battery)
* Key Switch (Button)

-----------------------------------------------------------

Connections:

![](https://i.imgur.com/0s5TMFr.jpg)

![](https://i.imgur.com/3EurCtA.png)

![](https://i.imgur.com/PrMRWdn.png)

![](https://i.imgur.com/3nijPDL.jpg)

Connect button to D1 and 5V

-----------------------------------------------------------

P.S. As for that background in the pictures, I glue the boards and the arduino on an old laptop motherboard. :)

branch_name: refs/heads/main


text:
# California Governor to convene meet of PG&E shareholders, executives next week

Published at: **2019-11-02T02:00:46+00:00**

Author: ****

Original: [Reuters](https://www.reuters.com/article/us-pg-e-us-bankruptcy-idUSKBN1XB54E)

(Reuters) - California Governor Gavin Newsom said he will convene a meeting of Pacific Gas and Electric Co executives, shareholders, wildfire victims, and PG&E’s other creditors in Sacramento next week to speed up the resolution of the bankruptcy case that creates a new entity.
The new company can only happen “if we first get out of bankruptcy court,” Newsom said in a statement on Friday, without elaborating on his plans.
“If the parties fail to reach an agreement quickly to begin this process of transformation, the state will not hesitate to step in and restructure the utility,” he added.
The San Francisco-based power producer in January filed for Chapter 11 bankruptcy protection anticipating its liabilities from massive wildfires in 2017 and 2018 blamed on its equipment could top $30 billion.
Earlier in October, Newsom said PG&E should be held accountable for mismanaging widespread power shutoffs, and urged the company to provide credits or rebates to affected customers.
PG&E, which began shutting off power to 940,000 California customers over the past weekend to guard against the risk of an electrical mishap sparking a blaze, said late on Thursday it had restored electricity to virtually all customers.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
---
layout: post
title: "iOS: Nested JSON POST with RestKit"
date: 2012-04-25
comments: true
categories: Objective-C Programming
permalink: /blog/ios-nested-json-post-with-restkit
---

Say you want to send some JSON from your RestKit enabled iOS app. You want your JSON to look like this:

First, make the corresponding NSDictionary structure:

Then, create the JSON string from your NSDictionary

Finally, make the request and map the response to a model:

Hope this helps.

extension: markdown


text:
App requirements
----

Important:

- has to be a generic software (= any university can use)
- anyone can sign up (you don’t have to be a student)

1. Users:
    - Login/Sign up
        - Username
        - Password
    - Account
        - Username
        - Role
            - Student (can reserve small rooms)
            - Employee (student rights + can reserve larger rooms)
            - Admin (can add/edit buildings, rooms, food menu, bike renting)
        - Your reservations
            - Displayed like a calendar
            - Cancel reservation (optional)
            - Bike reserved (Yes/No)
            - Food reserved

2. Rooms:
    - Code
    - Name
    - Capacity
    - Building
    - Availability
    - Pictures
    - Facilities (TV's, Whiteboards)
    - Reserving
        - Fixed time slot (let’s say 1 hour)
    - Filtering on (Campus level filtering + building level filtering)
        - Capacity
        - Availability
        - Facilities
    - Displayed as a list

3. Building:
    - Code
    - Name
    - Location
    - Opening hours
    - Bike station (Yes/No)
    - Food stores
    - Pictures

4. Renting bikes:
    - Number of available bikes on campus
        - Added by the admin
    - Can only rent from buildings where a bike station is located
    - Can rent multiple blocks of the fixed timeslots (so 3 times 1 hour slot)
    - That bike station has to have atleast one bike available
    - Current amount of bikes should be shown
    - Rent for a fixed timeslot, can return earlier than the indicated end time
    - We don't have to deal with illegal stuff like returning later or not returning at all
    - Can return to any building with an attached bike station
    - Same opening hours as building it is attached to

5. Food:
    - Menu
        - List of food products
        - You can choose products from menu when ordering
        - Products have a price but we pay by cash
    - Can choose from any food store in the system to pick up
    - Can only choose from food stores in the same building as your reserved room if you want it to be delivered to your room
    - Food is unlimited and food is done at the given time
    - Products and food stores added by admin
    - Different opening hours from the building it is attached to

repository: WouterButhker/CampusLife

path: /docs/App requirements.md

filename: App requirements.md

repo_name: WouterButhker/CampusLife


text:
# Fission: PHP Environment

This is the PHP environment for Fission.

It's a Docker image containing a PHP 7.3 runtime. This image use php:7.3-cli base image with the built-in PHP server

This environment does not force you to use a specific class or create a main function.

A few common extensions are included :
- curl
- gd
- json
- mcrypt
- PDO (pdo_mysql, pdo_pgsql, pdo_sqlite)
- OPcache
- ftp
- iconv
- phar
- mysqli
- pgsql
- SimpleXML
- xmlrpc
- zip

Looking for ready-to-run examples? See the [PHP examples directory](../../examples/php).

## Customizing this image

To add other extensions or packages(composer.json) you need to edit the Dockerfile and rebuild this image (instructions below).

## Rebuilding and pushing the image

You'll need access to a Docker registry to push the image: you can
sign up for Docker hub at hub.docker.com, or use registries from
gcr.io, quay.io, etc.  Let's assume you're using a docker hub account
called USER.  Build and push the image to the the registry:

```
   docker build -t USER/php7-env . && docker push USER/php7-env
```

## Using the image in fission

You can add this customized image to fission with "fission env
create":

```
   fission env create --name php7 --image USER/php7-env
```

Or, if you already have an environment, you can update its image:

```
   fission env update --name php7 --image USER/php7-env
```

After this, fission functions that have the env parmeter set to the
same environment name as this command will use this environment.

repository: fission/environments

gha_language: C#

repo_name: fission/environments


text:
## Arities

    [m [k & ks] f & args]

## Docs

'Updates' a value in a nested associative structure, where `ks` is a
sequence of keys or expressions yielding keys and `f` is a function
that will take the old value and any supplied args and return the new
value. Returns a new nested structure. If any levels do not exist,
empty hash-maps will be created.

## Notes

As of Clojure 1.7, clj::clojure.core/update should be preferred to
`(update-in m [:foo] f)` which was previously an idiom.

repository: clojure-grimoire/datastore

branch_name: refs/heads/develop

gha_language: Clojure

repo_name: clojure-grimoire/datastore


text:
# Additional packages

---

## Babel Transform (Optimize builds)

The Babel plugin is useful after you have a working project and wish to
optimize it at build time. The Babel plugin will perform numerous optimizations
to your code depending on how it is written and structured. For instance,
anytime you have an element that does not change, the call will be hoisted and
reused instead of recreated every time. Any `html` tagged template calls will
be converted to `createTree` calls.

**After your code has been passed through this plugin, you will be able to fully
utilize the lite build!**

To use, install into your project as a dev dependency.

``` sh
npm install -D babel-plugin-transform-diffhtml
```

Specify the plugin in the Babel configuration, usually a `.babelrc` or
`babel.config.js` file:

```json
{
  "plugins": ["babel-plugin-transform-diffhtml"]
}
```

Take this code as an example input:

```javascript
const { innerHTML, html } = require('diffhtml');

function render() {
  innerHTML(document.body, html`
    <div>Hello world</div>
  `);
}
```

Without this Babel transformation process, this HTML would need to be parsed
every time `render()` is called. If you use the lite build and the parser,
this will become a cached call. `html` is the same thing as `createTree` in the
lite build. So there is no HTML parsing happening.

```javascript
const { innerHTML, html } = require('diffhtml/dist/cjs/lite');

function render() {
  innerHTML(document.body, html('div', {}, [html('#text', null, 'Hello world')]));
}
```

[Refer to the configuration documentation.](https://github.com/tbranyen/diffhtml/tree/master/packages/babel-plugin-transform-diffhtml#-diffhtml-babel-transform-plugin)

---

## Render to String

While Virtual DOM libraries are designed to work in the browser and keep UI
presentation state synchronized, they are also very beneficial in a Node
runtime environment.

This package will crawl your reconciled tree (after all middleware are applied)
and serialize to a string. Since middleware is supported, you can use this
module to hook into Nodes and change the output. This can be especially useful
when you need to do XML-like transformations.

The primary use case of this module is for server-side rendering of web
applications. You can easily render the specific state as flat markup and then
re-hydrate on the client side.

A super simple example of rendering a Virtual Tree:

```javascript
import { renderToString, html } from 'diffhtml-render-to-string';

renderToString(html`
  <div>Hello world</div>
`);

// <div>Hello world</div>
```

Since middleware is supported, you can simply include the diffhtml-components
package to get full component rendering support.

```javascript
import { renderToString, html } from 'diffhtml-render-to-string';
import 'diffhtml-components';

function Component() {
  return '<div>Hello world</div>';
}

renderToString(html`
  <${Component} />
`);

// '<div>Hello world</div>'
```

---

## Live Reload Server

This server is designed for the diffhtml-website. Whenever the markdown files
change, it compiles them to HTML and re-renders the relevant HTML live. Other
assets may trigger a full page reload.

repository: rzhornyk/diffhtml

gha_license_id: MIT

repo_name: rzhornyk/diffhtml


text:
# Colombian congress voting patterns: Storytelling

## To deploy:

This folder is running on Github Pages duplicated on the `gh-pages` branch. To deploy, run:

```
git push origin `git subtree split --prefix scrollytelling master`:gh-pages --force
```

From the root folder.

Then, don't forget to verify the CNAME is working on the branch by going to [congreso.castrovaron.com](https://congreso.castrovaron.com).

## Abstract

Politics has an intrinsic accountability problem: officials are elected to represent the interest of their constituents, but the latter can’t be aware with the particulars of the day to day actions of the former, particularly when it involves thousands of votes. This creates a knowledge imbalance that makes political accountability and transparency harder. Congreso Visible (CV) is an organization dedicated to make the day-to-day actions of Congress more visible and accountable. Together we’ve worked to identify, highlight and visualize insights by turning CV’s vast data silos containing years of voting data into a web-based storytelling experience using data visualization.

## About

This project (and subfolder) illustrates pro and antigovernment voting patterns across the Colombian congress using graph-scroll.js and d3 interactive charts as a storytelling device. The live website can be seen at [congreso.castrovaron.com](https://congreso.castrovaron.com).

repository: jjcastro/colombianSenateVotingPatterns

repo_name: jjcastro/colombianSenateVotingPatterns


text:
# cnsc

_cnsc: C No Scope Commits_

This is a small utility similar to [Retrospring/nsc](https://github.com/Retrospring/nsc), but
it's written in the C programming language and therefore at least 420% faster.  It also has no
runtime dependencies, and works only on Unix-like systems.

## Building

Just run `make`.

## Running

`cnsc` requires no command line arguments to work.  It asks everything it needs from the
console using an interactive menu.  However, to speed up the committing process a bit, you can
specify some command line arguments.

For example, to add all files automatically, start cnsc like this:

    $ cnsc -a

Want to specify a commit message on the fly? Use the `-m` flag:

    $ cnsc -m 'My awesome commit!'

Of course you can also combine the two flags.

    $ cnsc -am 'Hack hack hooray!'

`cnsc` will return the return code of `git commit`.

## License

Like nsc, cnsc is licensed under the terms of the MIT License.

repository: RobertAudi/cnsc

repo_name: RobertAudi/cnsc


text:
# EdgeX Foundry
[EdgeX Foundry](https://www.edgexfoundry.org/) is an open-source edge system SW based on micro-services.

MFX-1 SW is based on [Go implementation](https://github.com/edgexfoundry/edgex-go) of EdgeX.

EdgeX system si monitored and controled via EdgeX SW Management Agent service (SMA),
which exposes HTTP REST API for sending commands and fetching logs and metrics.

Additionally, Mainflux Edged agent runs on a same gateway and:
- Connects to MQTT broker in the cloud on one side
- Connects to EdgeX SMA via HTTP on the other side

It serves as a mqtt2http proxy to connect whole gateway to the Mianflux cloud and manipulate EdgeX SMA.

## Install
### Compilation
#### Cross-Compiler
ZMQ demand C++11-compliant cross-compiler, and Debian base `arm-linux-gnueabihf` will not work.
Linaro cross compiler can be used - more info [here](https://www.linaro.org/downloads/).
It can be fetched from [here](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads),
you need to look for `AArch32 target with hard float (arm-linux-gnueabihf)`

#### ZMQ
In order to cross-compile ZMQ:

Fetch he last release from [ZMQ GitHub releases](https://github.com/zeromq/libzmq/releases):
```
wget https://github.com/zeromq/libzmq/archive/v4.3.1.tar.gz
```

Follow the instructions [here](http://zeromq.org/build:arm):
```
./autogen.sh
./configure --host=arm-none-linux-gnueabihf CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++
make
```

Produced library will be located in `src/.libs/`

##### Gateway
You need the same ZMQ on the gateway as well, as CGO will link it dynamically.
Static linking would demand linking of stdlib and then it demands toolchain and so on.

So easier way is just to compile and install same version of ZMQ on gateway:

```
sudo apt install -y libtool pkg-config build-essential autoconf automake uuid-dev
./autogen
./configure
make
sudo make install
```

#### EdgeX Foundry
EdgeX Foundry must be cross-compiled for ARM (in order to speed-up the time of native compilation on resource-modest ARM gateway).

A [Makefile](edgex/Makefile) in [edgex](edgex) dir can be used, but we need to define ARM based build:
```
drasko@Marx:~/go/src/github.com/edgexfoundry/edgex-go$ git diff
diff --git a/Makefile b/Makefile
index 928c1650..05127a48 100644
--- a/Makefile
+++ b/Makefile
@@ -14,12 +14,12 @@ BUILD_DIR := build
 ###
 # For ARM cross-compilation add something like:
 #
-# CC = arm-linux-gnueabi-gcc
-# CGO_LDFLAGS = -L/<path_to_libzmq>/src/.libs
-# CGO_CFLAGS = -I/<path_to_libzmq>/include
-# GOOS = linux
-# GOARCH = arm
-# GOARM = 7
+CC = arm-linux-gnueabi-gcc
+CGO_LDFLAGS = -L/home/drasko/edgex/libzmq-4.3.1/src/.libs
+CGO_CFLAGS = -I/home/drasko/edgex/libzmq-4.3.1/include
+GOOS = linux
+GOARCH = arm
+GOARM = 7
 ###
 FLAGS = GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} GO111MODULE=on
 GO_FLAGS =  $(FLAGS) CGO_ENABLED=0
```

##### Configuration
Redis should be used. Example:
```
[Databases]
  [Databases.Primary]
  Host = 'localhost'
  Name = 'coredata'
  Password = ''
  Port = 6379
  Username = ''
  Timeout = 5000
  Type = 'redisdb'
```

This should be put for `core-data`, `core-metadata`, `export-client`, `support-scheduler` and `support-notifications` microservices.

`support-logging` does not yet have Redis enablement, so `file` setting can be used:

```
[Writable]
Persistence = 'file'
LogLevel = 'INFO'
```

## Docker
In order to build in Docker, `libzmq` needs to be cross-compiled in the builder container:
- If Debian builder is used (`golang:stretch`), then Linaro toolchain can be used
- If Alpine builder is used (`golang:alpine3.9`) then a [musl](https://www.musl-libc.org/) toolchain must be used,
and this one must be produced. Best is to use [musl-cross-make](https://github.com/richfelker/musl-cross-make).

Production container must be of a type `arm32v7/`:
- If Debian is used for builder, then production container must also be
Debian (because of `glibc`, and not `musl`), and reccomended container would be `arm32v7/stretch-slim`
- If Alpine is used for builder, then production container can be `arm32v7/alpine`

### Toolchain
In order to produce `arm-linux-musleabihf` toolchain needed for Alpine cross-compilation:
```
git clone https://github.com/richfelker/musl-cross-make
cd musl-cross-make
cp config.mak.dist config.mak
```

Edit `config.mak` and uncomment `arm-linux-musleabihf` target:
```
# TARGET = i486-linux-musl
# TARGET = x86_64-linux-musl
# TARGET = arm-linux-musleabi
TARGET = arm-linux-musleabihf
# TARGET = sh2eb-linux-muslfdpic
```

Then:
```
make -j 16
```

This will produce `musl-cross-make/output` directory which you should copy to `docker` dir of EdgeX:
```
cp musl-cross-make/output $GOPATH/src/github.com/edgexfoundry/edgex-go/docker/toolchain
```

This is where Dockerfile will look for it.

### qemu-arm-static
Production container must install `libzmq` (in the case of Debian this is `libzmq5`),
and since we are in ARM container executables like `apk` will not work.
For that reason we need to add `qemu-arm-static`, like explained [here](https://ownyourbits.com/2018/06/27/running-and-building-arm-docker-containers-in-x86/) or
[here](https://www.balena.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/)

> Alpine images take ~24MB while Strech-Slim images might take ~75MB

### Transfering Docker image
Docker images must be transfered to gateway.

repository: zjdyzww/gateways

repo_name: zjdyzww/gateways


text:
[![GitHub license](https://img.shields.io/github/license/sanariaz154/Valar-Dohaeris?style=plastic)](https://github.com/sanariaz154/Valar-Dohaeris/blob/master/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/sanariaz154/Valar-Dohaeris?style=plastic)](https://github.com/sanariaz154/Valar-Dohaeris/issues)  ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/sanariaz154/Valar-Dohaeris?style=plastic) ![GitHub access](https://img.shields.io/badge/access-Free%20For%20Open%20Source-blueviolet?style=plastic)

# ctakes-knowledge-engineering
KB generation of clinical data using cTAKES NLP and Neo4j . This is a getting-statred/demo repository of complete project. This project is in phase 1 of development and still in progress.

## Example

#### Example 1

> A 43-year-old woman was diagnosed with type 2 diabetes mellitus by her family physician 3 months before this presentation. Her initial blood glucose was 340 mg/dL.       Glyburide 2.5 mg once daily was prescribed. Since then, self-monitoring of blood glucose (SMBG) showed blood glucose levels of 250-270 mg/dL. She was referred to an endocrinologist for further evaluation. She had extreme pain in her left kidney.
On examination, she was normotensive and not acutely ill. Her body mass index (BMI) was 18.7 kg/m2 following a recent 10 lb weight loss. Her thyroid was symmetrically enlarged and ankle reflexes absent. Her blood glucose was 272 mg/dL, and her hemoglobin A1c (HbA1c) was 10.3%. A lipid profile showed a total cholesterol of 261 mg/dL, triglyceride level of 321 mg/dL, HDL level of 48 mg/dL, and an LDL of 150 mg/dL. Thyroid function was normal. Urinanalysis showed trace ketones.
She adhered to a regular exercise program and vitamin regimen, smoked 2 packs of cigarettes daily for the past 25 years, and limited her alcohol intake to 1 drink daily. Her mother's brother was diabetic.

**_CEM Annotations_**

**_Neo4j Graph Ontology_**

#### Example 2
Following text is the medication section of a Clinical Discharge Summary taken from mtsamples.com:
> **MEDICATIONS ON TRANSFER**:
>  - Aspirin 325 mg once a day.
>  - Metoprolol 50 mg once a day, but we have had to hold it because of relative bradycardia which he apparently has a history of.
>  - Nexium 40 mg once a day.
>  - Zocor 40 mg once a day, and there is a fasting lipid profile pending at the time of this dictation.  I see that his LDL was 136 on May 3, 2002.
>  - Plavix 600 mg p.o. x1 which I am giving him tonight.

**_Neo4j Graph Ontology_**

## Pre-Req
* Understanding of UIMA and cTAKES archetecture
* Configure cTAKES java pipeline in your system and download all resources required for ctakes. More details can be found on [cTAKES developer guide](https://cwiki.apache.org/confluence/display/CTAKES/cTAKES+3.2+Developer+Install+Guide).

## Notes
* Resources folder is deleted from this repository due to large dictionary files and inconsistent jars. The zip file of all resources will be shared through google drive link later.
* Change the Neo4j database path according to your system from _Neo4JPopulation.java_ (or _Neo4jPopulationDiseaseOriented.java_ , according to case)
* If processing CCDA documents, set _is_ccda=true_ in _cTAKESService.java_
* If processing multiple documents, set _is_CPE=true_ in _cTAKESService.java_ and send documents directory path through postman.
* To get data from multiple healthcare sites for processing, run crawlers  or simply download the documents already extracted given in [med-harvest](https://github.com/sanariaz154/med-harvest) repository and you will get more than enough data in documents form for testing.

## Framework

## Phase 2

In phase-2 of development, we will be applying different graph-ml algorithm (like decision trees) on available data in graph to get a good accuracy of diagnosis. This phase will also be focusing on Knowledge Validation, Inferencing and Explanation/ Justification process of knowledge Engineering to maintain our healthcare knowledge base. Currently we do not have CCDA’s available with information of symptom of patients (chief complaint, reason for visit etc.). For the time being, we are collecting data from online sources and will use that to symptom based disease diagnosis.


text:
![nextjs-auth0](https://cdn.auth0.com/website/sdks/banners/nextjs-auth0-banner.png)

The Auth0 Next.js SDK is a library for implementing user authentication in Next.js applications.

![Release](https://img.shields.io/npm/v/@auth0/nextjs-auth0)
[![Coverage](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=coverage&query=jest.coverageThreshold.global.lines&suffix=%25&url=https%3A%2F%2Fraw.githubusercontent.com%2Fauth0%2Fnextjs-auth0%2Fmain%2Fpackage.json)](https://github.com/auth0/nextjs-auth0/blob/main/package.json#L147)
![Downloads](https://img.shields.io/npm/dw/@auth0/nextjs-auth0)
[![License](https://img.shields.io/:license-mit-blue.svg?style=flat)](https://opensource.org/licenses/MIT)
![CircleCI](https://img.shields.io/circleci/build/github/auth0/nextjs-auth0)

📚 [Documentation](#documentation) - 🚀 [Getting Started](#getting-started)- 💻 [API Reference](#api-reference) - 💬 [Feedback](#feedback)

## Documentation

- [QuickStart](https://auth0.com/docs/quickstart/webapp/nextjs)- our guide for adding Auth0 to your Next.js app.
- [FAQs](https://github.com/auth0/nextjs-auth0/blob/main/FAQ.md) - Frequently asked questions about nextjs-auth0.
- [Examples](https://github.com/auth0/nextjs-auth0/blob/main/EXAMPLES.md) - lots of examples for your different use cases.
- [Security](https://github.com/auth0/nextjs-auth0/blob/main/SECURITY.md) - Some important security notices that you should check.
- [Architecture](https://github.com/auth0/nextjs-auth0/blob/main/ARCHITECTURE.md) - Architectural overview of the SDK.
- [Testing](https://github.com/auth0/nextjs-auth0/blob/main/TESTING.md) - Some help with testing your nextjs-auth0 application.
- [Deploying](https://github.com/auth0/nextjs-auth0/blob/main/example-app/README.md) - How we deploy our example app to Vercel.
- [Docs Site](https://auth0.com/docs) - explore our docs site and learn more about Auth0.

## Getting Started

### Installation

Using [npm](https://npmjs.org):

```sh
npm install @auth0/nextjs-auth0
```

This library requires Node.js 16 LTS and newer LTS versions.

### Auth0 Configuration

Create a **Regular Web Application** in the [Auth0 Dashboard](https://manage.auth0.com/#/applications).

> **If you're using an existing application**, verify that you have configured the following settings in your Regular Web Application:
>
> - Click on the "Settings" tab of your application's page.
> - Scroll down and click on the "Show Advanced Settings" link.
> - Under "Advanced Settings", click on the "OAuth" tab.
> - Ensure that "JsonWebToken Signature Algorithm" is set to `RS256` and that "OIDC Conformant" is enabled.

Next, configure the following URLs for your application under the "Application URIs" section of the "Settings" page:

- **Allowed Callback URLs**: `http://localhost:3000/api/auth/callback`
- **Allowed Logout URLs**: `http://localhost:3000/`

Take note of the **Client ID**, **Client Secret**, and **Domain** values under the "Basic Information" section. You'll need these values in the next step.

### Basic Setup

#### Configure the Application

You need to allow your Next.js application to communicate properly with Auth0. You can do so by creating a `.env.local` file under your root project directory that defines the necessary Auth0 configuration values as follows:

```bash
# A long, secret value used to encrypt the session cookie
AUTH0_SECRET='LONG_RANDOM_VALUE'
# The base url of your application
AUTH0_BASE_URL='http://localhost:3000'
# The url of your Auth0 tenant domain
AUTH0_ISSUER_BASE_URL='https://YOUR_AUTH0_DOMAIN.auth0.com'
# Your Auth0 application's Client ID
AUTH0_CLIENT_ID='YOUR_AUTH0_CLIENT_ID'
# Your Auth0 application's Client Secret
AUTH0_CLIENT_SECRET='YOUR_AUTH0_CLIENT_SECRET'
```

You can execute the following command to generate a suitable string for the `AUTH0_SECRET` value:

```bash
node -e "console.log(crypto.randomBytes(32).toString('hex'))"
```

You can see a full list of Auth0 configuration options in the ["Configuration properties"](https://auth0.github.io/nextjs-auth0/modules/config.html#configuration-properties) section of the "Module config" document.

> For more details about loading environment variables in Next.js, visit the ["Environment Variables"](https://nextjs.org/docs/basic-features/environment-variables) document.

Add `handleAuth()` to your app, which creates the following route handlers under the hood that perform different parts of the authentication flow:

- `/api/auth/login`: Your Next.js application redirects users to your identity provider for them to log in (you can optionally pass a `returnTo` parameter to return to a custom relative URL after login, for example `/api/auth/login?returnTo=/profile`).
- `/api/auth/callback`: Your identity provider redirects users to this route after they successfully log in.
- `/api/auth/logout`: Your Next.js application logs out the user.
- `/api/auth/me`: You can fetch user profile information in JSON format.

**Continue setup depending on your router:**

- [Page Router](#page-router)
- [App Router](#app-router)

#### Page Router

##### Add the Dynamic API Route

Create a [catch-all, dynamic API route handler](https://nextjs.org/docs/api-routes/dynamic-api-routes#optional-catch-all-api-routes) under the `/pages/api` directory:

- Create an `auth` directory under the `/pages/api/` directory.
- Create a `[auth0].js` file under the newly created `auth` directory.

The path to your dynamic API route file would be `/pages/api/auth/[auth0].js`. Populate that file as follows:

```js
import { handleAuth } from '@auth0/nextjs-auth0';

export default handleAuth();
```

##### Add the UserProvider to Custom App

Wrap your `pages/_app.js` component with the `UserProvider` component:

```jsx
// pages/_app.js
import React from 'react';
import { UserProvider } from '@auth0/nextjs-auth0/client';

export default function App({ Component, pageProps }) {
  return (
    <UserProvider>
      <Component {...pageProps} />
    </UserProvider>
  );
}
```

##### Consume Authentication

You can now determine if a user is authenticated by checking that the `user` object returned by the `useUser()` hook is defined. You can also log in or log out your users from the frontend layer of your Next.js application by redirecting them to the appropriate automatically-generated route:

```jsx
// pages/index.js
import { useUser } from '@auth0/nextjs-auth0/client';

export default function Index() {
  const { user, error, isLoading } = useUser();

  if (isLoading) return <div>Loading...</div>;
  if (error) return <div>{error.message}</div>;

  if (user) {
    return (
      <div>
        Welcome {user.name}! <a href="/api/auth/logout">Logout</a>
      </div>
    );
  }

  return <a href="/api/auth/login">Login</a>;
}
```

> Next linting rules might suggest using the `Link` component instead of an anchor tag. The `Link` component is meant to perform [client-side transitions between pages](https://nextjs.org/docs/api-reference/next/link). As the links point to an API route and not to a page, you should keep them as anchor tags.

#### App Router

> Check out [Using this SDK with React Server Components](#using-this-sdk-with-react-server-components) before proceeding.

##### Add the Dynamic API Route

Create a [catch-all, dynamic API route handler](https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes) under the `/app/api` directory (strictly speaking you do not need to put API routes under `/api` but we maintain the convention for simplicity):

- Create an `api` directory under the `/app/` directory.
- Create an `auth` directory under the newly created `/app/api/` directory.
- Create a `[auth0]` directory under the newly created `auth` directory.
- Create a `route.js` file under the newly created `[auth0]` directory.

The path to your dynamic API route file will be `/app/api/auth/[auth0]/route.js`. Populate that file as follows:

```js
import { handleAuth } from '@auth0/nextjs-auth0';

export const GET = handleAuth();
```

##### Add the `UserProvider` to your layout

Wrap your `app/layout.js` component with the `UserProvider` component:

```jsx
// app/layout.js
import React from 'react';
import { UserProvider } from '@auth0/nextjs-auth0/client';

export default function App({ children }) {
  return (
    <UserProvider>
      <body>{children}</body>
    </UserProvider>
  );
}
```

##### Consume Authentication

You can now determine if a user is authenticated by checking that the `user` object returned by the `useUser()` hook is defined. You can also log in or log out your users from the frontend layer of your Next.js application by redirecting them to the appropriate automatically-generated route:

```jsx
// pages/index.js
'use client';
import { useUser } from '@auth0/nextjs-auth0/client';

export default function Index() {
  const { user, error, isLoading } = useUser();

  if (isLoading) return <div>Loading...</div>;
  if (error) return <div>{error.message}</div>;

  if (user) {
    return (
      <div>
        Welcome {user.name}! <a href="/api/auth/logout">Logout</a>
      </div>
    );
  }

  return <a href="/api/auth/login">Login</a>;
}
```

> Next linting rules might suggest using the `Link` component instead of an anchor tag. The `Link` component is meant to perform [client-side transitions between pages](https://nextjs.org/docs/api-reference/next/link). As the links point to an API route and not to a page, you should keep them as anchor tags.

##### Using this SDK with React Server Components

Server Components in the App Directory (including Pages and Layouts) _cannot_ write to a cookie.

If you rely _solely_ on Server Components to read and update your session you should be aware of the following:

- If you have a rolling session (the default for this SDK), the expiry will not be updated when the user visits your site. So the session may expire sooner than you would expect (you can use `withMiddlewareAuthRequired` to mitigate this).
- If you refresh the access token, the new access token will not be persisted in the session. So subsequent attempts to get an access token will always result in refreshing the expired access token in the session.
- If you make any other updates to the session, they will not be persisted between requests.

> The cookie _can_ be written from [middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware), [route handlers](https://nextjs.org/docs/app/building-your-application/routing/router-handlers) and [server actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions).

For other comprehensive examples, see the [EXAMPLES.md](https://github.com/auth0/nextjs-auth0/blob/main/EXAMPLES.md) document.

## API Reference

### Server

#### For Node

`import * from @auth0/nextjs-auth0`

#### For Edge runtime

`import * from @auth0/nextjs-auth0/edge`

- [Configuration Options and Environment variables](https://auth0.github.io/nextjs-auth0/types/config.ConfigParameters.html)
- [initAuth0](https://auth0.github.io/nextjs-auth0/types/init.InitAuth0.html)
- [handleAuth](https://auth0.github.io/nextjs-auth0/types/handlers_auth.HandleAuth.html)
- [handleLogin](https://auth0.github.io/nextjs-auth0/types/handlers_login.HandleLogin.html)
- [handleCallback](https://auth0.github.io/nextjs-auth0/types/handlers_callback.HandleCallback.html)
- [handleLogout](https://auth0.github.io/nextjs-auth0/types/handlers_logout.HandleLogout.html)
- [handleProfile](https://auth0.github.io/nextjs-auth0/types/handlers_profile.HandleProfile.html)
- [withApiAuthRequired](https://auth0.github.io/nextjs-auth0/types/helpers_with_api_auth_required.WithApiAuthRequired.html)
- [withPageAuthRequired](https://auth0.github.io/nextjs-auth0/types/helpers_with_page_auth_required.WithPageAuthRequired.html)
- [getSession](https://auth0.github.io/nextjs-auth0/types/session_get_session.GetSession.html)
- [updateSession](https://auth0.github.io/nextjs-auth0/types/session_update_session.UpdateSession.html)
- [getAccessToken](https://auth0.github.io/nextjs-auth0/types/session_get_access_token.GetAccessToken.html)
- [withMiddlewareAuthRequired](https://auth0.github.io/nextjs-auth0/types/helpers_with_middleware_auth_required.WithMiddlewareAuthRequired.html) (Edge only)

### Client (for the Browser)

`import * from @auth0/nextjs-auth0/client`

- [UserProvider](https://auth0.github.io/nextjs-auth0/types/client_use_user.UserProvider.html)
- [useUser](https://auth0.github.io/nextjs-auth0/functions/client_use_user.useUser.html)
- [withPageAuthRequired](https://auth0.github.io/nextjs-auth0/types/client_with_page_auth_required.WithPageAuthRequired.html)

### Testing helpers

`import * from @auth0/nextjs-auth0/testing`

- [generateSessionCookie](https://auth0.github.io/nextjs-auth0/types/helpers_testing.GenerateSessionCookieConfig.html)

Visit the auto-generated [API Docs](https://auth0.github.io/nextjs-auth0/) for more details

### Cookies and Security

All cookies will be set to `HttpOnly, SameSite=Lax` and will be set to `Secure` if the application's `AUTH0_BASE_URL` is `https`.

The `HttpOnly` setting will make sure that client-side JavaScript is unable to access the cookie to reduce the attack surface of [XSS attacks](https://auth0.com/blog/developers-guide-to-common-vulnerabilities-and-how-to-prevent-them/#Cross-Site-Scripting--XSS-).

The `SameSite=Lax` setting will help mitigate CSRF attacks. Learn more about SameSite by reading the ["Upcoming Browser Behavior Changes: What Developers Need to Know"](https://auth0.com/blog/browser-behavior-changes-what-developers-need-to-know/) blog post.

### Caching and Security

Many hosting providers will offer to cache your content at the edge in order to serve data to your users as fast as possible. For example Vercel will [cache your content on the Vercel Edge Network](https://vercel.com/docs/concepts/edge-network/caching) for all static content and Serverless Functions if you provide the necessary caching headers on your response.

It's generally a bad idea to cache any response that requires authentication, even if the response's content appears safe to cache there may be other data in the response that isn't.

This SDK offers a rolling session by default, which means that any response that reads the session will have a `Set-Cookie` header to update the cookie's expiry. Vercel and potentially other hosting providers include the `Set-Cookie` header in the cached response, so even if you think the response's content can be cached publicly, the responses `Set-Cookie` header cannot.

Check your hosting provider's caching rules, but in general you should **never** cache responses that either require authentication or even touch the session to check authentication (eg when using `withApiAuthRequired`, `withPageAuthRequired` or even just `getSession` or `getAccessToken`).

### Error Handling and Security

Errors that come from Auth0 in the `redirect_uri` callback may contain reflected user input via the OpenID Connect `error` and `error_description` query parameter. Because of this, we do some [basic escaping](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html#rule-1-html-encode-before-inserting-untrusted-data-into-html-element-content) on the `message`, `error` and `error_description` properties of the `IdentityProviderError`.

But, if you write your own error handler, you should **not** render the error `message`, or `error` and `error_description` properties without using a templating engine that will properly escape them for other HTML contexts first.

### Base Path and Internationalized Routing

With Next.js you can deploy a Next.js application under a sub-path of a domain using [Base Path](https://nextjs.org/docs/api-reference/next.config.js/basepath) and serve internationalized (i18n) routes using [Internationalized Routing](https://nextjs.org/docs/advanced-features/i18n-routing).

If you use these features the urls of your application will change and so the urls to the nextjs-auth0 routes will change. To accommodate this there are various places in the SDK that you can customise the url.

For example, if `basePath: '/foo'` you should prepend this to the `loginUrl` and `profileUrl` specified in your `Auth0Provider`:

```jsx
// _app.jsx
function App({ Component, pageProps }) {
  return (
    <UserProvider loginUrl="/foo/api/auth/login" profileUrl="/foo/api/auth/me">
      <Component {...pageProps} />
    </UserProvider>
  );
}
```

Also, any links to login or logout should include the `basePath`:

```html
<a href="/foo/api/auth/login">Login</a><br />
<a href="/foo/api/auth/logout">Logout</a>
```

You should configure the [baseUrl](https://auth0.github.io/nextjs-auth0/interfaces/config.baseconfig.html#baseurl) (or the `AUTH0_BASE_URL` environment variable). For example:

```shell
# .env.local
AUTH0_BASE_URL=http://localhost:3000/foo
```

For any pages that are protected with the Server Side [withPageAuthRequired](https://auth0.github.io/nextjs-auth0/modules/helpers_with_page_auth_required.html#withpageauthrequired) you should update the `returnTo` parameter depending on the `basePath` and `locale` if necessary.

```js
// ./pages/my-ssr-page.jsx
export default MySsrPage = () => <></>;

const getFullReturnTo = (ctx) => {
  // TODO: implement getFullReturnTo based on the ctx.resolvedUrl, ctx.locale
  // and your next.config.js's basePath and i18n settings.
  return '/foo/en-US/my-ssr-page';
};

export const getServerSideProps = (ctx) => {
  const returnTo = getFullReturnTo(ctx.req);
  return withPageAuthRequired({ returnTo })(ctx);
};
```

### Comparison with the Auth0 React SDK

We also provide an Auth0 React SDK, [auth0-react](https://github.com/auth0/auth0-react), which may be suitable for your Next.js application.

The SPA security model used by `auth0-react` is different from the Web Application security model used by this SDK. In short, this SDK protects pages and API routes with a cookie session (see ["Cookies and Security"](#cookies-and-security)). A SPA library like `auth0-react` will store the user's ID token and access token directly in the browser and use them to access external APIs directly.

You should be aware of the security implications of both models. However, [auth0-react](https://github.com/auth0/auth0-react) may be more suitable for your needs if you meet any of the following scenarios:

- You are using [Static HTML Export](https://nextjs.org/docs/advanced-features/static-html-export) with Next.js.
- You do not need to access user data during server-side rendering.
- You want to get the access token and call external API's directly from the frontend layer rather than using Next.js API routes as a proxy to call external APIs.

### Testing

By default, the SDK creates and manages a singleton instance to run for the lifetime of the application. When testing your application, you may need to reset this instance, so its state does not leak between tests.

If you're using Jest, we recommend using `jest.resetModules()` after each test. Alternatively, you can look at [creating your own instance of the SDK](./EXAMPLES.md#create-your-own-instance-of-the-sdk), so it can be recreated between tests.

For end to end tests, have a look at how we use a [mock OIDC Provider](./scripts/oidc-provider.js).

# Deploying

For deploying, have a look at [how we deploy our example app to Vercel](./example-app/README.md).

## Contributing

We appreciate feedback and contribution to this repo! Before you get started, please read the following:

- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [Auth0's code of conduct guidelines](https://github.com/auth0/express-openid-connect/blob/master/CODE-OF-CONDUCT.md)
- [This repo's contribution guide](./CONTRIBUTING.md)

## Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.

## What is Auth0?

  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png" width="150">
    <source media="(prefers-color-scheme: light)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">

  </picture>

  Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?

  This project is licensed under the MIT license. See the  LICENSE file for more info.

gha_language: TypeScript


text:
# Gaming_scraper

The objective of this project is to obtain accurate information of videogames in different web pages. The ultimate purpose is to be able to compare prices and study their the temporal evolution.

## To Do List

1. Improve selenium_steam.py: The current approach may obtain wrong prices, path can be made a variable.
2. Organize better IG_scrapping.py, test for posible mistakes, try to make it a class.
3. Scrap different pages like G2a, Humble bundle, eneba, steam to the fullest, etc.
4. Improve performance by using async.
5. Compare performance of scrappy vs BeautifulSoup.
6. Find an accurate way to identify a videogame, taking into account that a game can be written slightly different from one page to another.

gha_language: Python


text:
# tape-synth

I got this idea for the cassette synthesizer from [Onde Magnétique](http://www.ondemagnetique.com/) who got the idea from the [Mellotron](http://www.mellotron.com/). The idea is that you can record a single drone onto a tape and then play that back at various speeds to modulate the pitch.

The neat thing about this synthesizer is that it has a very "analog" quality to the changing of notes - the pitch often *slides* between notes in a neat way. This pitch sliding is called [*portamento*](https://en.wikipedia.org/wiki/Portamento). It also is versatile because you can record *any* sound to the tape and use that as your synthesizer.

Here's what it sounds like with the "angry bees" synth sample applied to the tape. The video shows me playing another synth which is not producing any sound and only controlling the cassette player via MIDI:

## Making a cassette synthesizer

To make one of these things is actually *really* easy. I found a great video from Analog Industries showing exactly how to [hack a cassette player](https://www.youtube.com/watch?v=pF6Yegj7A9o) to add voltage control to the cassette player. I followed that and then wrote a simple MIDI controller in the browser to modulate the voltage to specific notes.

These instructions will take you through the hardware (Arduino / Cassette player) and the software for the MIDI controller.

### Supplies

- GE 3-5362A walkman ($15, eBay has tons of them)
- [Arduino](https://www.amazon.com/gp/product/B008GRTSV6/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B008GRTSV6&linkCode=as2&tag=scholl-20&linkId=7bcd2ae0b8147ff819937b73da545cfb) ($23)
- [MCP4725 DAC](https://www.amazon.com/gp/product/B00SK8MBXI?ie=UTF8&tag=scholl-20&camp=1789&linkCode=xm2&creativeASIN=B00SK8MBXI) ($11)
- [Audio jack breakout](https://www.amazon.com/gp/product/B07Y8KR21P?ie=UTF8&tag=scholl-20&camp=1789&linkCode=xm2&creativeASIN=B07Y8KR21P) ($8)
- [Jumper wires](https://www.amazon.com/gp/product/B07GD2BWPY?ie=UTF8&tag=scholl-20&camp=1789&linkCode=xm2&creativeASIN=B07GD2BWPY) ($5, if you don't have)
- [Solder iron + supplies](https://www.amazon.com/gp/product/B07Q2B4ZY9?ie=UTF8&tag=scholl-20&camp=1789&linkCode=xm2&creativeASIN=B07Q2B4ZY9) ($25, and it lasts a lifetime)

## Hacking the GE 3-5362A walkman

_Note:_ You don't necessarily have to use the GE 3-5362A. Any walkman with a variable playback will work. You'll just have to figure out how to hook up the voltage :)

First thing is to open up the walkman. There are four screws on the back. Just unscrew them and open it carefully. The power lines are connected on the back plate so just don't rip those out.

![Hacking the GE 3-5362A walkman.](https://schollz.com/img/s1/overview.jpg)

To get this walkman working for us we will solder two new components. First we will solder in the `Vin` which will allow us to control the speed of the cassette player with a voltage. Then we will add a `Line in` which will let us record directly onto tape (in case you don't have a tape deck).

If you don't know how to solder - don't sweat. Its easy. Check out [this video](https://youtu.be/HTy9Z9LpA2U?t=1011) which shows you how to use the existing solder pad and put something onto it.

### Adding the `Vin`

Locate the dial that says "Variable Speed Playback". This is where we will splice in two lines. I like to use red for active and brown/green for ground. Attach the active line to `VS+` and the ground to the pad right below the one labeled `B+`.

![Solder a cable to VS+ and one to the pad next to B+.](https://schollz.com/img/s1/vs.jpg)

A note - I like to use jumper cables that have a female end so I can easily plug stuff into here!

### Add in a `Line in`

Locate the red and black cables plugged into pads labeled "MIC-" and "MIC+". You can solder and remove these cables and attach your own from the audio breakout cable. Just solder red to "MIC+" and black to "MIC-".

![Solder a line-in via the MIC- and MIC+.](https://schollz.com/img/s1/linein.jpg)

### Record the tape

Put in a tape and record via the line in! Record anything you want, usually a single drone on C works well as a starting point. Record a long time - 30 minutes or so (this would be a good place for tape loops if you have them!).

![Recording a drone from my OP-1 to the tape.](https://schollz.com/img/s1/rec.jpg)

## Setup an Arduino as MIDI interface

The Arduino serves as a bridge between MIDI and the voltage. A MIDI keyboard is plugged into a computer and a Chrome browser gets the response. The browser executes a request to a server running which sends the serial information for the voltage change to the Arduino, which then modulates the voltage on the walkman.

![Connecting the MCP4725 DAC to the Arduino](https://schollz.com/img/s1/arduino.png)

The `OUT` from the MCP4725 should go to the RED wire you connected to the cassette player. Then attach the ground wire on the cassette player to the ground on the Arduino.

The code for the Arduino just communicates via a Serial port to send voltages. Just upload `voltage.ino` to an Arduino and you should be all set.

### Server to send serial commands

To communicate with the Arduino you can use a simple server that hooks the MIDI to the voltage Serial. You can get this code from https://github.com/schollz/tape-synth. Make sure you have Golang installed (install [here](https://golang.org/dl/)).

```bash
$ git clone https://github.com/schollz/tape-synth
$ cd tape-synth
$ go build
$ ./tape-synth -com ARDUINOCOM
```

Now you can open up Chrome to `localhost:8080` and you'll be able to connect a MIDI keyboard and send voltages to the Arduino. Make sure to edit the voltage map to tune each note of the cassette synthesizer, in `index.html`:

```javascript
var voltageMap = {
    "C": 0,
    "C#": 0.7,
    "D": 0.9,
    "D#": 1.2,
    "E": 1.4,
    "F": 1.62,
    "F#": 1.85,
    "G": 2.25,
    "G#": 2.6,
    "A": 3.0,
    "A#": 0,
    "B": 0,
}
```

Those are the voltages that I mapped out for my particular cassette player.

## That's it!

To get it going, start the serial server. Plug in a midi keyboard. Open chrome to the `localhost:8080`. Turn on the cassette player and **start jamming!**

If something is unclear (it probably is) don't hesitate to reach out to me. I'm [yakcar @ twitter](https://twitter.com/yakczar) and [infinitedigits @ instagram](https://instagram.com/infinitedigits).

repository: schollz/tape-synth

gha_language: Go

repo_name: schollz/tape-synth


text:
# neo-utils
Useful functions for the NEO blockchain written in Go.

This library can be fully compiled to native iOS and Android framework using `gomobile bind`

note: `gomobile` does not support slice parameter yet so some functions are optimized to take a comma separated string as a param instead of a array of string.
For methods specifically designed to be used on mobile see ```mobile.go```

### Installation
`go get github.com/o3labs/neo-utils/neoutils`

## Compile this library to native mobile frameworks.

### Install gomobile
```
go get golang.org/x/mobile/cmd/gomobile

gomobile init
```

### Install Dependencies
```
. dep.sh
```

### Compile to both iOS and Android frameworks
```
. build.sh
```

### Compile to iOS framework
XCode is required.
`gomobile bind -target=ios -o=output/ios/neoutils.framework github.com/o3labs/neo-utils/neoutils`

### Compile to Android framework
Android NDK is required. https://developer.android.com/ndk/guides/index.html
```
gomobile init -ndk ~/Library/Android/sdk/ndk-bundle/

ANDROID_HOME=/Users/$USER/Library/Android/sdk gomobile bind -target=android -o=output/android/neoutils.aar github.com/o3labs/neo-utils/neoutils
```

repository: mathwallet/neo-utils

repo_name: mathwallet/neo-utils


text:
---
title: Plans to establish airship service
tags:
  - Dec 1913
---

Plans to establish airship service on a Curtiss flying boat between Miami, Cape Florida, Soldiers Key and Palm Beach.

Newspapers: **Daily Miami Metropolis, The Miami Metropolis (daily), The Daily Metropolis or Miami Daily Metropolis**

Page: **1**, Section: **N/A**


text:
---
title: "Elon R Data Camp"
author: "Adam Aiken"
date: "2022-09-10T15:20:29Z"
tags: [Data Analysis, R Markdown]
link: "https://bookdown.org/adam_aiken/rboot/"
length_weight: "5.9%"
cover: "https://bookdown.org/adam_aiken/rboot/img/cover.png"
repo: "aaiken1"
pinned: false
---

These notes cover our three hours together as we learn about using R for data analysis with R Studio. [...] What is R and why are you here? We are to spend our time tonight learning about R, R Markdown, and the developer environment that puts these tools together, R Studio. How do these tools fit together? Scriptability, coding, working with our data \(\rightarrow\) R Reproducible, literate programming with all of our code, narrative, and formatted output in one place \(\rightarrow\) R Markdown A place to do this \(\rightarrow\) RStudio Our most important goal: Get R and RStudio running on ...

gha_language: R


text:
# opencv-react

> Hooks-first minimal OpenCV wrapper for React.

[![NPM](https://img.shields.io/npm/v/opencv-react.svg)](https://www.npmjs.com/package/opencv-react) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

It simplifies the import of this library and integrates it well with the React ecosystem.

**Bear in mind** that the loading of the library, being huge, is done asynchronously. Of course you can listen with this lib when the loading has finished in order to execute some setup code.

You have also access to a `loaded` state which is provided by the `OpenCvProvider` component

## Install

```bash
npm i opencv-react
```

or

```bash
yarn add opencv-react
```

## API

## `OpenCvProvider`

### Props

- **openCvPath**: string used to indicate where to load the OpenCv lib from (default to official cdn)
- **onLoad**: function that gets called whenever the library has finished loading (see the package [description](#description))

**Usage**:

```js
const MyApp = () => {
  return (
    <OpenCvProvider>
      <MyComponent />
    </OpenCvProvider>
  )
}
```

## `useOpenCv`

### Context object

```
{
  loaded: boolean, indicates if the opencv library is loaded (useful to show a spinner)
  cv: undefined or the OpenCV global instance (can also be found in window.cv)
}
```

```js
function MyComponent() {
  const { loaded, cv } = useOpenCv()

  useEffect(() => {
    if (cv) {
    }
  }, [cv])

  return <p>OpenCv React test</p>
}
```

## Quick Start

```javascript
function MyComponent() {
  const data = useOpenCv()
  console.log(data)
  return <p>OpenCv React test</p>
}

const App = () => {
  const onLoaded = (cv) => {
    console.log('opencv loaded, cv')
  }

  return (
    <OpenCvProvider onLoad={onLoaded} openCvPath='/opencv/opencv.js'>
      <MyComponent />
    </OpenCvProvider>
  )
}
```

_*Check also the example folder*_

## Todo

- tests
- prop types
- index.d.ts

## Projects that uses this lib

WIP

## License

MIT © [giacomocerquone](https://github.com/giacomocerquone)


text:
# pixiv-batch-upscale

This utility takes listed illustrations from a larger collection as created by [Nandaka/PixivUtil2](https://github.com/Nandaka/PixivUtil2) and upscales each of them using [nihui/waifu2x-ncnn-vulkan](https://github.com/nihui/waifu2x-ncnn-vulkan) until it is of at least a specified size.

## Usage

First specify the path to the upscaler binary in `config.py`.

Write a list of desired illustrations. The list should contain lines in the following format:

```
pid,index
```

Alternatively, if you have a folder of images with filenames in the same format as the downloader  uses, you can run `python readlist.py <dir>`. The list will be put into stdout.

To start upscaling, run `python batchupscale.py <imagesdir> <listfile> <outdir> <size>` to retrieve images from `<imagedir>`, leaving only those listed in `<listfile>`, putting them in `<outdir>`, and upscale them until they are each at least of size `<size>` (in MiB) or when the program has already tried 5 times.

The program is tested only under Windows 10.


text:
Flictionary

# Introduction

The repository represents the backend API for the Pictionary-inspired gaming app, Flictionary, hosted at (website). This is a collaboration between 4 Flatiron alums: 2 Software Engineering and 2 Data Science.

The frontend application repository is located at (link to repo)

[Flipping Photo]("images/flipping_finger.jpg")

Photo by Natã Figueiredo on Unsplash

# Business Understanding

# Data Sources:

# Data Understanding:

# Modeling:

# Results:

# Folder Structure:

# Contact Information:

# References:

  # Stevens-Flictionary-Ben

repository: BMoClay/Stevens-Flictionary-Ben

repo_name: BMoClay/Stevens-Flictionary-Ben


text:
## Item 1: Know Which Version of Python You're Using

### Code

```
[wyi@wkpc ~]$ python3 --version
Python 3.5.2
[wyi@wkpc ~]$ python3
Python 3.5.2 (default, Sep 14 2016, 11:28:32)
[GCC 6.2.1 20160901 (Red Hat 6.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.version_info)
sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0)
>>> print(sys.version)
3.5.2 (default, Sep 14 2016, 11:28:32)
[GCC 6.2.1 20160901 (Red Hat 6.2.1-1)]
>>>
```

### Things to Remember

- Python 2 & Python 3.
- Runtime
    - CPython
    - Jython
    - IronPython
    - PyPy
    - Others
- Be sure that the command-line for runing Python on your system is the version you expect it to be.
- Prefer Python 3

repository: weiliy/learning

repo_name: weiliy/learning


text:
This crate holds the implementation of the `left-right` concurrency
primitive, and its primary user `evmap`. See the documentation for each
crate for details.

Left-right is a concurrency primitive for high concurrency reads over a
single-writer data structure. The primitive keeps two copies of the
backing data structure, one that is accessed by readers, and one that is
access by the (single) writer. This enables all reads to proceed in
parallel with minimal coordination, and shifts the coordination overhead
to the writer. In the absence of writes, reads scale linearly with the
number of cores.

[![Build Status](https://dev.azure.com/jonhoo/jonhoo/_apis/build/status/evmap?branchName=master)](https://dev.azure.com/jonhoo/jonhoo/_build/latest?definitionId=8&branchName=master)
[![Codecov](https://codecov.io/github/jonhoo/rust-evmap/coverage.svg?branch=master)](https://codecov.io/gh/jonhoo/rust-evmap)

**left-right**

[![Crates.io](https://img.shields.io/crates/v/left-right.svg)](https://crates.io/crates/left-right)
[![Documentation](https://docs.rs/left-right/badge.svg)](https://docs.rs/left-right/)

**evmap**

[![Crates.io](https://img.shields.io/crates/v/evmap.svg)](https://crates.io/crates/evmap)
[![Documentation](https://docs.rs/evmap/badge.svg)](https://docs.rs/evmap/)

## Performance

**These benchmarks are outdated at this point, but communicate the right
point. Hopefully I'll have a chance to update them again some time
soon.**

I've run some benchmarks of evmap against a standard Rust `HashMap` protected
by a [reader-writer
lock](https://doc.rust-lang.org/std/sync/struct.RwLock.html), as well as
against [chashmap](https://crates.io/crates/chashmap) — a crate which provides
"concurrent hash maps, based on bucket-level multi-reader locks". The
benchmarks were run using the binary in [benchmark/](benchmark/src/main.rs) on
a 40-core machine with Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz CPUs.

The benchmark runs a number of reader and writer threads in tight loops, each
of which does a read or write to a random key in the map respectively. Results
for both uniform and skewed distributions are provided below. The benchmark
measures the average number of reads and writes per second as the number of
readers and writers increases.

Preliminary results show that `evmap` performs well under contention,
especially on the read side. This benchmark represents the worst-case usage of
`evmap` in which every write also does a `refresh`. If the map is refreshed
less often, performance increases (see bottom plot).

![Read throughput](evmap/benchmark/read-throughput.png)
![Write throughput](evmap/benchmark/write-throughput.png)
![Write throughput](evmap/benchmark/write-with-refresh.png)

repository: horahh/rust-evmap

repo_name: horahh/rust-evmap


text:
ofxColorPalette
===============

openFrameworks addon for algorithmic generated color palettes. The ofxColorPalette is templated, so ofColor corresponds to ofxColorPalette, ofShortColor to ofxShortColorPalette and ofFloatColor to ofxFloatColorPalette.

Use Triads and Complement to create tension. Use Monochrome and Analogue to radiate a sense of calm. Don't use Random! It hurts my eyes!

![](images/example-colorPalette.png)

repository: danbz/ofxColorPalette

repo_name: danbz/ofxColorPalette


text:
---
layout: post
title: Basics of High-Level S3 Commands
tags: [Amazon, S3, AWS]
categories: AWS
---

Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.

It's an Object storage built to store and retrieve any amount of data from anywhere.

Let's talk, ```Basics of High-Level (S3) Commands``` with the AWS CLI,

<img src="{{ site.url }}/public/images/amazon-s3.png"/>

## ```Configuring the AWS CLI```
aws configure command is the fastest way to set up your AWS CLI installation.

The information in the default profile is used any time you run an AWS CLI command that doesn't explicitly specify a profile to use.

```console

$ aws configure
AWS Access Key ID [None]: AKIALAHOORADNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUerFEMI/LAHURANG/bPyRSiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json

```

The AWS Access Key ID and AWS Secret Access Key are your AWS credentials.

#### Creating Multiple Profiles

simply by providing below option

```console
$ aws configure --profile produser
```

When you run a command, you can omit the ```--profile``` option and use the credentials and settings stored in the default profile.

```console
$ aws s3 ls
```
Or you can specify a ```--profile``` profilename

```console
$ aws s3 ls --profile produser
```
To update any of your settings, simply run aws configure again (with or without the ```--profile``` parameter, depending on which profile you want to update) and enter new values as appropriate.

##```Manage Amazon S3 Buckets and Objects```

AWS S3 commands support common bucket operations, such as creating, listing, and deleting buckets.

#### Create a Bucket -

Bucket names must be globally unique, Bucket names can contain lowercase letters, numbers, hyphens, and periods. Bucket names can start and end only with a letter or number.

Use the S3 mb command to create a bucket.

```console
$ aws s3 mb s3://bucket-name
```

#### List Your Buckets -
    $ aws s3 ls

Lists all objects and folders (referred to in S3 as 'prefixes') in a bucket.

```console
$ aws s3 ls s3://bucket-name
```

You can filter the output to a specific prefix by including it in the command.

```console
$ aws s3 ls s3://bucket-name/path/
```

#### Delete a Bucket -
Remove a bucket, use the S3 rb command,

```console
$ aws s3 rb s3://bucket-name --force
```

#### Remove object from S3 -

```console
$ aws s3 rm s3://bucket-name/doc/1.png --recursive
$ aws s3 rm s3://incentivenetworks-dev/purchase-receipts/ --recursive
```

#### Remove objects from S3 -
```console
$ aws s3 rm s3://bucket-name/doc --recursive
```

gha_language: CSS


text:
* First list item
    Type | Range|	Size
    -|-|-
      sbyte |	-128 to 127|	Signed 8-bit integer
 byte|	0 to 255|	Unsigned 8-bit integer
        char|	U+0000 to U+ffff|	Unicode 16-bit character
* Second list item
    Type | Range|	Size
    -|-|-
    sbyte |	-128 to 127|	Signed 8-bit integer
	byte|	0 to 255|	Unsigned 8-bit integer
    char|	U+0000 to U+ffff|	Unicode 16-bit character


text:
## _**Little Big Tips**_ ![Joystick](https://raw.githubusercontent.com/alissin/alissin.github.io/master/images/joystick.png) > General tips > simple damage shake

> ![Combat Wings](./../../_images/combat_wings/combat-wings.png)

Feel free to try this behaviour on the playable demonstration / prototype: [Combat Wings](https://simmer.io/@alissin/combat-wings).

_Note:_ The purpose of this demonstration is to evaluate this gameplay mechanic. The scenario and the props are free assets from the Asset Store.

#### Problem description
When the player airplane is hit, the big impact needs to shake it all!

#### Solution suggestion
Actually, in this case, the `Camera` is shaked when something hits the `Player`.

_Note:_ The scope of this _**Little Big Tip**_ is only the shakking. How to trigger the shaking after the `Player` is hit, it's up to you.

Create a C# script `Shake.cs` and attach this script to the `Camera` game object:

```csharp
public class Shake : MonoBehaviour
{
    ...
```

Define the fields:

```csharp
[SerializeField]
[Range(0.1f, 0.5f)]
float range = 0.2f;

[SerializeField]
bool isShaking = false;

Vector3 lastPos;
bool hasLastPosHeld = false;
```

We will use the `range` field to control the "bounce" of the shaking and the `lastPos` to keep the last position, before the shaking.

Let's make our `Camera` to shake a little bit:

```csharp
void Update()
{
    if (isShaking)
    {
        if (!hasLastPosHeld)
        {
            lastPos = transform.position;
            hasLastPosHeld = true;
        }

        float xPos = lastPos.x + Random.Range(-range, range);
        float yPos = lastPos.y + Random.Range(-range, range);
        float zPos = lastPos.z + Random.Range(-range, range);

        transform.position = new Vector3(xPos, yPos, zPos);
    }
    else
    {
        if (hasLastPosHeld)
        {
            transform.position = lastPos;
            hasLastPosHeld = false;
        }
    }
}
```

To simulate the shaking, hit play and change the `Is Shaking` via inspector to `true`. Cool, everything is shaking!

_Note:_ Put something in the scene, in front to the `Camera` to have a better look of the effect.

#### Scripts:
[Shake.cs](./Shake.cs)

Again, feel free to try the behaviour of this _**Little Big Tip**_ on [Combat Wings](https://simmer.io/@alissin/combat-wings).

More _**Little Big Tips**_? Nice, [let's go](https://github.com/alissin/little-big-tips)!

repository: alissin/little-big-tips

repo_name: alissin/little-big-tips


text:
# [My Paper](http://alexa.amazon.com/#skills/amzn1.ask.skill.6033df51-721b-4bd9-a813-a4db10aa01ad)
![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0

To use the My Paper skill, try saying...

* *Alexa, ask my paper for a decision from the journal*

* *Alexa, tell my paper to give me a status of the manuscript*

* *Alexa, open my paper*

Accepted or Rejected?
Get used to these two words if you live happily in the academic society. My Paper aims to motivate you through the answers you might have heard them during your career for thousand times from more than 15,000 academic journals.

After enabling this skill, say things like “ask my paper for a decision from the journal” or “tell my paper to give me a status of the manuscript” to hear the status of your paper.

Questions or comments? Love it or hate it? Contact the developer at<EMAIL_ADDRESS>
Be prepared for the high impact factor journal!

***

### Skill Details

* **Invocation Name:** my paper
* **Category:** null
* **ID:** amzn1.ask.skill.6033df51-721b-4bd9-a813-a4db10aa01ad
* **ASIN:** B01N7ML92J
* **Author:** wanomex
* **Release Date:** December 31, 2016 @ 01:49:09
* **In-App Purchasing:** No


text:
# Module 1: Introduction to Databases
# Demonstration: Exploring a Relational Database

### Objectives

In this demonstration, you will see:

- How to create a database diagram.

- How to use a database diagram to view tables, primary key constraints, and foreign key constraints.

### Preparation

Start the 10985C-MIA-DC and 10985C-MIA-SQL virtual machines, and then log on to 10985C-MIA-SQL as **ADVENTUREWORKS\Student** with the password **Pa$$w0rd**.

### Demonstration Steps

1. In the **D:\Demofiles\Mod01** folder, right-click **Setup.cmd**, and then click **Run as administrator**.

2. In the **User Account Control** dialog box, click **Yes**, and wait for setup to complete.

3. Open **Microsoft SQL Server Management Studio**, and then connect to the **MIA-SQL** instance of the database engine by using Windows Authentication.

4. In **Object Explorer**, expand **Databases**, expand **AdventureWorks2016**, right-click **Database Diagrams**, and then click **New Database Diagram**.

5. If the **Microsoft SQL Server Management Studio** dialog box appears asking if you wish to create support objects for database diagramming, click **Yes**.

6. In the **Add Table** dialog box, press and hold down the CTRL key, click **Customer (Sales)**, click **SalesOrderDetail (Sales)**, click **SalesOrderHeader (Sales)**, click **ShipMethod (Purchasing)**, click **Add**, and then click **Close**.

7. Review the tables and note the following points:

	1. The **SalesOrderHeader (Sales)** table contains the **SalesOrderID**, which is the primary key column.

	2. The **SalesOrderDetail (Sales)** table also contains a **SalesOrderID** column.

8. In the **SalesOrderDetail (Sales)** table, right-click the **SalesOrderID** column, and then click **Properties**.

9. In the **Properties** window, click the **Description** field, and then click the ellipsis button (…).

10. In the **Description Property** dialog box, note that the column is a primary key column, and that there is a foreign key that references the **SalesOrderID** column in the **SalesOrderHeader** table, and then click **Cancel**.

11. Click the line between the **Customer (Sales)** table and the **SalesOrderHeader (Sales)** table. This line represents a foreign key relationship.

12. In the **Properties** window, click **Description**, and then click the ellipsis button (…).

13. In the **Description Property** dialog box, note that the foreign key references the **CustomerID** column in the **Customer (Sales)** table, and then click **Cancel**.

14. Close the database diagram window, and do not save any changes. Close SQL Server Management Studio.

©2016 Microsoft Corporation. All rights reserved.

The text in this document is available under the [Creative Commons Attribution 3.0 License](https://creativecommons.org/licenses/by/3.0/legalcode "Creative Commons Attribution 3.0 License"), additional terms may apply.  All other content contained in this document (including, without limitation, trademarks, logos, images, etc.) are **not** included within the Creative Commons license grant.  This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes.

This document is provided "as-is." Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. Some examples are for illustration only and are fictitious. No real association is intended or inferred. Microsoft makes no warranties, express or implied, with respect to the information provided here.