text:
# Platform.sh Rails Helper

platform_sh_rails is a helper gem to ease interacting with the environment of the Platform.sh PaaS on the Ruby on Rails Framework

See the platform_sh gem for vanilla ruby helper

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'platform_sh_rails'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install platform_sh_rails

## Usage

This gem setups the environment for Rails, it will autoconfigure:

* ActiveRecord
* RabbitMQ (using bunny)
* Redis
* ElasticSearch
* Solr
* Mongodb
* InfluxDB

The gem will autoconfigure rails to use the first service it finds. So if you just add this gem to your Gemfile and push everything should work automagically. The configuration works by exporting environment variables with the expected names and URL structure.

If you have multiple services of the same type.. or multiple relational databases (like a postgres + a mysql) in your .platform/services file .. well you should configure by hand.

Also note that for ActiveRecord this will default to mysql2, but if you  loaded the mysql Gem it should still work.

## Development

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

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

This gem depends on [platformsh-ruby-helper](https://github.com/platformsh/platformsh-ruby-helper).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/platformsh/platformsh-rails-helper.

## License

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

repository: platformsh/platformsh-rails-helper

gha_language: Ruby

repo_name: platformsh/platformsh-rails-helper


text:
# CertWatch #

This script will monitor and optionally renew certificates in a given directory tree.

Assume the following directory structure where each TLS secured service got it's own directory containing the certificate used for that service as well as a corresponding CSR which can be used for certificate renewal.

	/etc/certs/
	├── mail
	│   ├── .certconf
	│   │   ├── config
	│   │   └── renew.sh
	│   ├── dovecot
	│   │   ├── service.crt
	│   │   └── service.csr
	│   └── postfix
	│       ├── service.crt
	│       └── service.csr
	├── nginx
	│   ├── .certconf
	│   │   ├── config
	│   │   └── renew.sh
	│   ├── service.crt
	│   └── service.csr
	└── slapd
	    ├── .certconf
	    │   ├── config
	    │   └── renew.sh
	    ├── service.crt
	    └── service.csr

## .certconf directories ##

The `.certconf` directories contain two files which control the behavior of `CertWatch`. A `.certconf` directory applies to all certificates within it's root directory and it's subdirectories until it is overwritten by another `.certconf` directory.

That means that configurations in `/etc/certs/.certconf` would be overwritten by `/etc/certs/nginx/.certconf` but still apply to certificates in `/etc/certs/mail/postfix` if no `.certconf` directory exists within `/etc/certs/mail` or `/etc/certs/mail/postfix`.

### config ###

	EXPIRY_WARN=$((60*60*24*7))
	EXPIRY_RENEW=$((60*60*24*3))
	CERTFILE_REGEXP="^service\.crt$"

`CERTFILE_REGEXP` sets a perl regexp to match certificate files and is used to identify certificates to be monitored.

`EXPIRY_WARN` sets the rest time a certificate has to be valid left before a warning is printed.

`EXPIRY_RENEW` sets the rest time a certificate has to be valid left before renew.sh is executed in order to renew the certificate.

### renew.sh ###

This script will be executed by CertWatch if the certificate is valid for less time than set in `EXPIRY_RENEW.` The absolute path to the certificate will be passed to that script.

## Run the script ##

If you pass the `/etc/cert` listed above together with `--status` to `CertWatch`, you will get an overview of the certificates monitored by the script:

	root@host:~# CertWatch /etc/certs --status
	/etc/certs/mail/dovecot/service.crt
	        CONFIG: /etc/certs/mail/.certconf
	                EXPIRY_WARN=1209600 [ 2w 0s ]
	                EXPIRY_RENEW=604800 [ 1w 0s ]
	                CERTFILE_REGEXP=^service\.crt$
	        STATUS:
	                Valid until: Thu Jun 23 13:45:00 CEST 2016 [ 10w 18h 31m 52s ]
	                Warn       : Thu Jun  9 13:45:00 CEST 2016 [ 8w 18h 31m 52s ]
	                Renew      : Thu Jun 16 13:45:00 CEST 2016 [ 9w 18h 31m 52s ]

	/etc/certs/mail/postfix/service.crt
	        CONFIG: /etc/certs/mail/.certconf
	                EXPIRY_WARN=1209600 [ 2w 0s ]
	                EXPIRY_RENEW=604800 [ 1w 0s ]
	                CERTFILE_REGEXP=^service\.crt$
	        STATUS:
	                Valid until: Thu Jun 23 13:45:00 CEST 2016 [ 10w 18h 31m 52s ]
	                Warn       : Thu Jun  9 13:45:00 CEST 2016 [ 8w 18h 31m 52s ]
	                Renew      : Thu Jun 16 13:45:00 CEST 2016 [ 9w 18h 31m 52s ]

	/etc/certs/nginx/service.crt
	        CONFIG: /etc/certs/nginx/.certconf
	                EXPIRY_WARN=1209600 [ 2w 0s ]
	                EXPIRY_RENEW=604800 [ 1w 0s ]
	                CERTFILE_REGEXP=^service\.crt$
	        STATUS:
	                Valid until: Thu Jun 23 13:45:00 CEST 2016 [ 10w 18h 31m 52s ]
	                Warn       : Thu Jun  9 13:45:00 CEST 2016 [ 8w 18h 31m 52s ]
	                Renew      : Thu Jun 16 13:45:00 CEST 2016 [ 9w 18h 31m 52s ]

	/etc/certs/slapd/service.crt
	        CONFIG: /etc/certs/slapd/.certconf
	                EXPIRY_WARN=1209600 [ 2w 0s ]
	                EXPIRY_RENEW=604800 [ 1w 0s ]
	                CERTFILE_REGEXP=^service\.crt$
	        STATUS:
	                Valid until: Thu Jun 23 13:45:00 CEST 2016 [ 10w 18h 31m 52s ]
	                Warn       : Thu Jun  9 13:45:00 CEST 2016 [ 8w 18h 31m 52s ]
	                Renew      : Thu Jun 16 13:45:00 CEST 2016 [ 9w 18h 31m 52s ]

If the ``--status`` parameter is omitted, only monitored certifcates will be listed that are within the `EXPIRY_WARN` or `EXPIRY_RENEW` rest times.

This allows you to setup a cronjob

	0 14 * * * /usr/local/sbin/CertWatch /etc/certs

which informs you about near expiries of certificates and renews them if `EXPIRY_RENEW` rest time is reached.

The path for the certificates can also be provided from `/etc/CertWatch`

	CERT_PATH="/etc/cert"

## Examples ##

The `config.example` directory contains an example renew.sh script which uses acme-tiny (https://github.com/diafygi/acme-tiny) and a NGINX configuration to renew the certificates, but you are free to setup any procedure you need to renew your certificates.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
Mnemonic Encoder
================

**!!! WORK IN PROGRESS, THIS DOES NOT WORK SO DO NOT USE IT!!!**

Given a BIP-39 Mnemonic, convert into a PKCS#8 formatted file suitable for loading into an HSM.

**Usage**

```shell
mnemonic-encoder <mnemonic-file>    <derivation-path> <format>
mnemonic-encoder ./test/mnemonic-1   m/44'/0'/0'/0     pkcs8

> Mnemonic:  earth couch laugh second health submit annual shove eagle asset duck expire weather control truly decline uncover crash birth trip omit lumber emotion diagram
> <REDACTED_PRIVATE_KEY>
```

**TODO**

* Fix derivation path
* Pack files into the correct pkcs8 format
* Verify output pkcs8 file can be reloaded
* Test cases
* Pretty much everything else...

repository: witoff/mnemonic-encoder

repo_name: witoff/mnemonic-encoder


text:
---
hrs_structure:
  division: '2'
  volume: '10'
  title: '25'
  chapter: 443B
  section: 443B-8
type: hrs_section
tags:
  - Business
menu:
  hrs:
    identifier: HRS_0443B-0008
    parent: HRS0443B
    name: '443B-8 Manner in which records, funds, and other forms of'
weight: 32110
title: 'Manner in which records, funds, and other forms of'
full_title: '443B-8 Manner in which records, funds, and other forms of'
---
**§443B-8 Manner in which records, funds, and other forms of indebtedness are to be kept by collection agencies.** (a) Every collection agency shall keep and maintain a permanent record or have immediate access to copies of the permanent record of all funds and other forms of indebtedness collected by it, and of all disbursements. Every collection agency shall maintain and keep a record of all clients' funds or have immediate access to copies of the record. No person wilfully shall make any false entry in any collection agency record, or intentionally mutilate, destroy, conceal, or in any way dispose of any record.

(b) A collection agency shall not commingle the money of its clients with its own, but shall maintain a separate trust account for clients' funds in a federally insured financial institution. [L 1987, c 191, pt of §1; am L 1990, c 246, §9]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# You can modify Mario Kart Wii to play with Waluigi and Wario on foot

Published at: **2019-11-01T11:50:32+00:00**

Author: **John Struan**

Original: [Boing Boing](https://boingboing.net/2019/11/01/you-can-modify-mario-kart-wii.html)

Do you have Mario Kart Wii and an interest in modifying it?
Niment has created skins for playing Waluigi, Wario, and Luigi on foot. It looks so absurdly fun that Nintendo should consider making these skins a regular part of the game:

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
# dartres
dart2.x resource utils.

# install

Copy ".sh" files into your project.

And install "xpipeline" tool.

```
go get github.com/eaglesakura/xpipeline
```

# How to use.

## yaml2dart.sh

```
# sample.yaml
foo: "foo_value"
```

```bash
# run script
yaml2dart.sh sample.yaml
```

```dart
// generated
// lib/res/sample.dart
class R_sample {
  Map<String, dynamic> _values;
  R_sample(this._values);
  dynamic get foo => _values['foo'];
}
```

## dir2dart.sh

```bash
# run script
yaml2dart.sh example/sample_dir
```

```dart
// generated
// lib/res/sample_dir.dart
class R_base64_sample_dir {
  static const foo_file_name_txt =
      '...base64 encoded file...';
}
```

# LICENSE

MIT LICENSE.

```
The MIT License (MIT)

Copyright (c) 2019 @eaglesakura

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

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

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

repository: eaglesakura/dartres

repo_name: eaglesakura/dartres


text:
# iNaturalist Datashader Map

A zoomable map of iNaturalist observations made using [Datashader](https://datashader.org/) and [Leaflet](https://leafletjs.com/).

More: [interactive map](https://storage.googleapis.com/inaturalist-datashader-map/index.html), [blog post](http://tom-e-white.com/datavision/09-inaturalist-observations.html).

## How to build the visualization

iNaturalist makes available a full dataset of observations, which is what I used to generate the map.

Go to https://www.inaturalist.org/pages/developers and look for the "GBIF DarwinCore Archive" link.
Download and unzip the archive, then move the _observations.csv_ to the _data_ directory.

Create a conda environment with the following (note that conda has a machine optimized version of datashader):

```bash
conda env create -f environment.yml
```

The preprocess the _observations.csv_ file to remove unneeded columns, and to convert the lat/long fields to metres.

```bash
python preprocess.py
```

Generate the tiles as follows:

```bash
python generate_tiles.py
```

Then run a webserver to serve them:

```
python -m http.server 8008
```

And open http://localhost:8008/

repository: cuulee/inaturalist-datashader-map

repo_name: cuulee/inaturalist-datashader-map


text:
# How To: Use With django-pandas

Django REST Pandas includes built-in functionality to [serialize][serializers] querysets into Pandas DataFrames.  However, you can also let [Django Pandas] handle querying and generating the dataframe, and only use Django REST Pandas for the rendering.  To do this, leverage [PandasSimpleView] instead of [PandasView].

```python
# models.py
from django_pandas.managers import DataFrameManager

class TimeSeries(models.Model):
    # ...
    objects = DataFrameManager()

```

```python
# views.py
from rest_pandas import PandasSimpleView
from .models import TimeSeries

class TimeSeriesView(PandasSimpleView):
    def get_data(self, request, *args, **kwargs):
        return TimeSeries.objects.to_timeseries(
            index='date',
        )
```

[serializers]: ../serializers/index.md
[Django Pandas]: https://github.com/chrisdev/django-pandas/
[PandasSimpleView]: ../api/PandasSimpleView.md
[PandasView]: ../api/PandasView.md

repository: wq/django-rest-pandas

branch_name: refs/heads/main

gha_language: Python

gha_license_id: MIT

repo_name: wq/django-rest-pandas


text:
---
title: AWS S3 using AWS/S3 Ruby gem
date: '2010-03-22'
tags:
- amazon
- aws
- awss3
- bucket
- code
- gem
- ruby
- s3
- s3object
- upload
---

working on storing files to Amazon's S3 web service. Here's what I've come up with so far:

require 'aws/s3'
def aws_connect
  @aws_connect ||= AWS::S3::Base.establish_connection!(
    :access_key_id=>AWS_KEY,
    :secret_access_key=>AWS_SECRET
  )
end

def aws_upload(file,bucket=AWS_BUCKET)
  aws_connect
  AWS::S3::S3Object.store(file,open(file),bucket)
end

then a:

aws_upload('test.txt')

Will upload the the file to the Amazon bucket. Pretty simple.

repository: funkfinger/jaywiggins

extension: markdown

repo_name: funkfinger/jaywiggins


text:
# Dicc
Online dictionary for terminal environment.

#To Use
If you already have Go installed, you can easily make it easily executable by:

`go install dicc.go`

If you just want to grab executable file, download it from bin directory and copy it to your /usr/bin or your preconfigured directory.

repository: billyboar/dicc

repo_name: billyboar/dicc


text:
# Codescalers Python101 project

[![Join us on Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/codescalers/python101#)

## Setup

Install the following:

+ [Virtualbox](https://www.virtualbox.org/wiki/Downloads)
+ [Vagrant](https://www.vagrantup.com/downloads.html)

then run the following command from this repo

```
$ vagrant up
```

to get access to the machine

```
$ vagrant ssh
```


text:
# What it does?

Listens to new images added in a directory and automatically create a compressed version of the image in
an output directory.

## Inspiration

As a developer, my everyday work involves taking screenshots and uploading them to the internet.
Typically my steps to do this would be:

1. Take a screenshot.

2. Upload the screenshot to an image compression website.

3. Download the compressed image.

4. Upload the compressed image to where I need it to be uploaded.

The steps are extremely simple and fast, and I don't see any need for change. But while reading "The Pragmatic Programmer" Chapter 3 - The Basic Tools, I was inspired to put more efforts in improving my tools and making it "my own".

ImageSquash does steps 2 and 3, which basically is the most time-consuming and requires more actions, for me.

## Why Go?

I built ImageSquash with [Go](https://golang.org/) simply because I want to learn Go.

## Word of caution

I'm building ImageSquash while learning Go so it's unavoidable to see code which lacks best practices.
If you see some, i'll be more than thankful if you can create an issue regarding it and point out what
I should have done.

ImageSquash will improve overtime as I learn more about Go.

## Usage

1. Clone the repo.
2. Edit some variables accordingly. See Variables below.
3. In your command line, navigate to the cloned repo.
4. You can either:

   **Build then run the program**

   ```bash
   go build
   ```

   Or just run it directly.

   ```bash
   go run .
   ```

## Variables

To make the program work, you need to edit some variables directly in [imagesquash.go](https://github.com/donmhico/imagesquash/blob/main/imagesquash.go#L14-L26).

**quality** - Between 1-100. The higher the value, the larger the compressed filesize but the better the quality.

**watchDir** - Full path of the directory to watch for new images.

**outputDir** - Full path where the compressed files are generated.

## Screenshot

![screenshot](https://user-images.githubusercontent.com/5747475/123534592-d83a7f80-d750-11eb-838d-83a508a2b435.jpg)

## Project Status

**ALPHA** - Basically it is tailored for my specific needs and workflow, at least for now.

## Limitations

1. Only tested on specific environments.

   - Windows 10 (Since this is my current OS. Although I don't see any reason why it won't work on other OS)
   - Go 1.16

2. Only works for JPG images.

## Special Thanks

[WebDevStudios](https://webdevstudios.com/) - My awesome company! I started ImageSquash during one of our [#5FTF](https://webdevstudios.com/about/how-wds-gives-back/).

The Pragmatic Programmer - I can't recommend this book enough to any programmer / devs.

repository: donmhico/imagesquash

repo_name: donmhico/imagesquash


text:
# HTTPS all the things

In an express application, there are serveral things you need to do to sure you're serving your site over `https`. First, make sure the `Strict-Transport-Security` header (often abbreviated as [HSTS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security)) is set on the response. This instructs the browser to always send request over `https`.

Then make sure that you're any `http` request that make it to the server to the same url over `https`. The [express-enforce-ssl](https://www.npmjs.com/package/express-enforces-ssl) middleware provides an easy way to do this.

```javascript
const express = require('express');
const expressEnforceSSL = require('express-enforce-ssl');

const app = express();

app.enabled('trust proxy');
app.use(expressEnforceSSL());
```

repository: dangvanthanh/til

repo_name: dangvanthanh/til


text:
# grunt-typescript-export

Generates a single `index.d.ts` file for your NPM package implemented in TypeScript by concatenating per-file d.ts files, wrapping them all into an implicit module declaration and rewriting/moving some lines.

Produces something like this:

```typescript
/// <reference path="./d.ts/DefinitelyTyped/node/node.d.ts" />

declare module "livereload-soa" {

import events = require('events');
import api = require('./api');

// lib/api.d.ts
export interface Service {
    onmessage(message: Message): void;
    ondisconnect(): void;
}

// lib/carrier-node-stream.d.ts
export class NodeStreamCarrier extends events.EventEmitter {
    constructor(input, output);
    public send(message): void;
}

}
```

Rewrites applied:

1. All references are de-duplicated and moved to the top of the file (they don't work inside the module declaration).

2. All imports de-deduplicaed and moved to the top of the module declaration (they don't work at the top level).

3. Referenced paths that start with `../` are modified to start with `./` (because presumably you are generating `/index.d.ts` from `/lib/*.d.ts`), this part should be made smarter.

4. `declare` is dropped from all internal declaration (nested `declare`s are invalid).

5. All local imports (`import foo = require('./something')`) are removed, and the corresponding references are rewritten to use the bare name (`foo.Bar` is replaced with `Bar`).

## Getting Started

This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-typescript-export --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-typescript-export');
```

## The "typescript_export" task

### Overview

In your project's Gruntfile, add a section named `typescript_export` to the data object passed into `grunt.initConfig()`, and also make sure you set `pkg.name`.

```js
grunt.initConfig({
  pkg: grunt.file.readJSON('package.json'),

  typescript_export: {
    your_target: {
      src: ['lib/*.d.ts'],
      dest: 'index.d.ts'
    },
  },
})
```

### Options

None so far.

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test your code using [Grunt](http://gruntjs.com/).

## Release History

v0.1.0 — initial version.

repository: andreyvit/grunt-typescript-export

gha_language: JavaScript

repo_name: andreyvit/grunt-typescript-export


text:
---
title : "Hint-based Colorization Challenge in Multimedia&Lab course"
expert : "Hint-based Colorization Challenge in Multimedia&Lab course in Gachon Uni, Seongnam-si, Republic of Korea"

categories :
   - Deep Learning
tags :
   - Deep Learning
   - Hint-based Colorization
   - Gachon Uni.
last_modified_at : 2021-06-25T08:19:00-20:00

---

### Multimedia&Lab course hint-based colorization in spring semester 2021, Department of software,  Gachon Uni.

Our team ranked 1st place of challenge
<img width="1243" alt="Screen Shot 2021-05-28 at 12 07 50 AM" src="https://user-images.githubusercontent.com/57583574/119850812-d5c5e980-bf48-11eb-8afb-325c95a3c258.png">

CVIP Lab in Gachon Uni. provided leader board to check the real-time rank and evalutaion criterion for challenge.

This was initial trial of Deep learning challenge in Multimedia&Lab course

Prof. Yongju Jung and other research assistants educated and guided  student to use Pytorch environments. Therefore every 11 team submit their own results and got their ranks.

Our team ( espectially me ) used various models for training.
1. U-net
2. Attention U-net
3. Residual Attention U-net
4. Residual Attention U-net
5. Our model

The Architecture of our model :
![Screen Shot 2021-05-26 at 11 12 05 AM](https://user-images.githubusercontent.com/57583574/119592333-3a7f2800-be13-11eb-9d99-bd4fe0bee3e2.png)

I referenced 4 papers below
Referenced Paper
1. U-Net Convolutional Networks for Biomedical Image Segmentation : <https://arxiv.org/abs/1505.04597>.
2. Attention U-Net Learning Where to Look for the Pancreas : <https://arxiv.org/abs/1804.03999>
3. Real-Time User-Guided Image Colorization with Learned Deep Priors : <https://arxiv.org/abs/1705.02999>.
4. Deep Residual Learning for Image Recognition : <https://arxiv.org/abs/1512.03385>.

The main purpose of these project is winning the in course challenge so we overfited the model. Therefore we don't know our model is efficient to general data or not.

So if you interested in my model please visit my github repository.

More information is at my git repo :
```
https://github.com/CocoSungMin/Gachon_SW_Colorization_Contest
```


text:
---
parent: crystal.physics
grand_parent: API Reference
nav_exclude: true
---

# Body:attach_to

Links this entity to another one, relinquishing control of its position. Calling this immediately updates the position of this Body component to match the specified entity. Whenever the specified entity moves, via [set_position](body_set_position) or via the physics simulation, the attached entity will immediately move to the same position. Attempting to apply impulses or set velocity on attached entities has no effect.

The parent entity must have a [Body](body) component. If things are not working as intended, make sure the relevant entities have `dynamic` or `kinematic` body types.

{: .warning}
Creating a cycle of attached entities will cause an infinite loop.

## Usage

```lua
body:attach_to(other_entity)
```

### Arguments

| Name           | Type                              | Description              |
| :------------- | :-------------------------------- | :----------------------- |
| `other_entity` | [Entity](/crystal/api/ecs/entity) | The entity to attach to. |

## Examples

```lua
local ecs = crystal.ECS:new();
ecs:add_system(crystal.PhysicsSystem);

local hero = ecs:spawn(crystal.Entity);
hero:add_component(crystal.Body);

local backpack = ecs:spawn(crystal.Entity);
backpack:add_component(crystal.Body);
backpack:attach_to(hero);
```

repository: agersant/crystal

gha_language: Lua

repo_name: agersant/crystal


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---
## [Unreleased]
### Added
- New project based off of *Megaman Battle Network's* Battlechip system from the Gameboy Advance Era. Base scene has all visual nodes needed for each battlechip.

---
## [1.0.0] - 2021-3-18
### Added
- New changelog will keep track of all changes made to this project.

### Changed
- Godot Project name reflects Github Project Name.
- Project destination is split into to folders located under `Completed/` and `Skeleton/`.

### Deprecated
Nothing so far.

### Removed
Nothing so far.

### Fixed
- `card_ui.gd` follows Godot Style Guide
- `qte.gd` follows Godot Style Guide

[Unreleased]: https://github.com/GameDev-One/Godot-UI-Crafts/compare/1.1.1...HEAD
[1.0.0]: https://github.com/GameDev-One/Godot-UI-Crafts/releases/tag/1.0.0

repository: Boyquotes/Godot-UI-Crafts

repo_name: Boyquotes/Godot-UI-Crafts


text:
## _Fair_Battle_

#### _Legend says:_
> The battle must be won! Wait until there is an advantage, then strike!

#### _Goals:_
+ _Win the battle_

#### _Topics:_
+ **Strings**
+ **Variables**
+ **While Loops**
+ **While Loops with Conditionals**
+ **Accessing Properties**
+ **Return Statements**

#### _Solutions:_
+ **[JavaScript](fairBattle.js)**
+ **[Python](fair_battle.py)**

#### _Rewards:_
+ 256 xp
+ 191 gems

#### _Victory words:_
+ _WHY LEAVE A BATTLE TO CHANCE?_

___

### _HINTS_

The hero's and cheiftain's army will get reinforcements while you wait.

Write a `sum()` function to find the total health of an array of units.

Wait until your soldiers have more total `health` than the ogres' total `health`, then attack!

Don't dawdle too long, or your soldiers will lose faith in this battle.

![](img/fairBattle.png)

Use knowledge from previous levels about `sum` function. If you have problems with this level, then try to return and refresh your skills.

___

repository: ripssr/Code-Combat

repo_name: ripssr/Code-Combat


text:
Accounts
========

```javascript
/**
 * Create an account using the augur.web.register method.
 */

var username = "tinybike";
var password = "tinypassword";

augur.web.register(username, password, function (account) {
    console.log("Account:", account);
});

// output
Account: {
    handle: "tinybike",
    privateKey: <Buffer ...>,
    address: "0x09129dcde8e0f510ffb2a715709b69f5c4a42361",
    nonce: 0
}

/**
 * The user is automatically logged in after registering.  When logged in,
 * the user's data is kept in the the augur.web.account object.  Logging out
 * unsets the augur.web.account object.
 */

augur.web.logout();
console.log("Account:", augur.web.account);

// output
{}

/* Logging in both sets and returns the augur.web.account object: */

augur.web.login(username, password, function (account) {
    console.log(augur.web.account);
});

// output
{
    handle: "tinybike",
    privateKey: <Buffer ...>,
    address: "0x09129dcde8e0f510ffb2a715709b69f5c4a42361",
    nonce: 0
}
```

augur.js includes a trustless account management system.  The purpose of the accounts system is to allow people to use Augur without needing to run an Ethereum node themselves, as running a full Ethereum node can be resource-intensive.

To use the account system, the user specifies a username and password.  Everything else is done automatically for the user.  The only requirement for the password is that it be at least 6 characters long.

A private key (+ derived public key and address) is automatically generated for the user.  A secret key derived from the password using PBKDF2, along with a random 128-bit initialization vector, is used to encrypt the private key (using AES-256).  The username, encrypted private key, and initialization vector are stored in the browser's `localStorage`.

Transaction signing and serialization is entirely carried out in the browser using [ethereumjs-tx](https://github.com/ethereum/ethereumjs-tx) and the `eth_sendRawTransaction` RPC; the plaintext private key never touches our servers at any time.

Invoking contract methods is unchanged from normal use (from the client's perspective).  The Augur API functions can simply be called in the usual way (e.g., `augur.reputationFaucet`), and augur.js will default to client-side transactions if the user is logged in.

<aside class="notice">Since the user's account key is an ordinary Ethereum private key, the user's key (and therefore their funds and Reputation) can be used with any Ethereum node.  Therefore, although the accounts system is managed using an ordinary web server, since the user's funds are neither tied to nor controlled by our server, the accounts are still decentralized in the ways that (in our opinion) matter.</aside>

repository: elhomosiguiente/docs

repo_name: elhomosiguiente/docs


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

### Description

Barracuda Spam Firewall (BSF), possibly <IP_ADDRESS>, contains a hardcoded password for the admin account for logins from <IP_ADDRESS> (localhost), which allows local users to gain privileges.

### POC

#### Reference
- http://securityreason.com/securityalert/1363

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

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
---
title: "Aggregates API"
description: "Sensu Aggregates API reference documentation."
product: "Sensu Enterprise Dashboard"
version: "2.10"
menu:
  sensu-enterprise-dashboard-2.10:
    parent: api
---

- [The `/aggregates` API endpoint](#the-aggregates-api-endpoint)
  - [`/aggregates` (GET)](#aggregates-get)
- [The `/aggregates/:name` API endpoints](#the-aggregatesname-api-endpoints)
  - [`/aggregates/:name` (GET)](#aggregatesname-get)
  - [`/aggregates/:name` (DELETE)](#aggregatesname-delete)

## The `/aggregates` API endpoint {#the-aggregates-api-endpoint}

The `/aggregates` API endpoint provides HTTP GET access to [named aggregate
data][1].

### `/aggregates` (GET)

#### EXAMPLES {#aggregates-get-examples}

The following example demonstrates a `/aggregates` API query which results in a
JSON Array of JSON Hashes containing named [check aggregates][1].

{{}}
$ curl -s http://<IP_ADDRESS>:3000/aggregates | jq .
[
  {
    "_id": "us_east1/check_web_app",
    "dc": "us_east1",
    "name": "check_web_app"
  },
  {
    "_id": "us_west1/elasticsearch_health",
    "dc": "us_west1",
    "name": "elasticsearch_health"
  }
]
{{}}

#### API specification {#aggregates-get-specification}

/aggregates (GET) |
------------------|------
description       | Returns the list of named aggregates by `name` and datacenter (`dc`)
example url       | http://hostname:3000/aggregates
response type     | Array
response codes    |

**Success**: 200 (OK)

**Error**: 500 (Internal Server Error)

output            | {{}}[
  {
    "_id": "us_east1/check_web_app",
    "dc": "us_east1",
    "name": "check_web_app"
  },
  {
    "_id": "us_west1/elasticsearch_health",
    "dc": "us_west1",
    "name": "elasticsearch_health"
  }
]{{}}

## The `/aggregates/:name` API endpoints {#the-aggregatesname-api-endpoints}

The `/aggregates/:name` API endpoints provide HTTP GET and HTTP DELETE access
to [check aggregate data][1] for a named aggregate.

### `/aggregates/:name` (GET) {#aggregatesname-get}

#### EXAMPLES {#aggregatesname-get-examples}

The following example demonstrates a `/aggregates/:name` API query for the
check result data for the aggregate named `example_aggregate`.

{{}}
$ curl -s http://<IP_ADDRESS>:3000/aggregates/example_aggregate | jq .
{
  "clients": 15,
  "checks": 2,
  "results": {
    "ok": 18,
    "warning": 0,
    "critical": 1,
    "unknown": 0,
    "total": 19,
    "stale": 0
  }
}
{{}}

#### API specification {#aggregatesname-get-specification}

/aggregates/:name (GET) |
------------------------|------
description             | Returns the aggregate check result for a given aggregate.
example url             | http://hostname:3000/aggregates/elasticsearch
parameters              |

`dc`:

**required**: false

**type**: String

**description**: If the aggregate name is present in multiple datacenters, specifying the `dc` parameter returns only the aggregate found in that datacenter.

**example**: `http://hostname:3000/aggregates/elasticsearch?dc=us_west1`

response type           | Array
response codes          |

**Success**: 200 (OK)

**Found in multiple datacenters**: 300 (Multiple Choices)

**Missing**: 404 (Not Found)

**Error**: 500 (Internal Server Error)

output                  | {{}}{
  "clients": 15,
  "checks": 2,
  "results": {
    "ok": 18,
    "warning": 0,
    "critical": 1,
    "unknown": 0,
    "total": 19,
    "stale": 0
  }
}
{{}}

### `/aggregates/:name` (DELETE) {#aggregatesname-delete}

#### EXAMPLES {#aggregatesname-delete-examples}

The following example demonstrates a `/aggregates/:name` API request to delete
aggregate data for the aggregate named `example_aggregate`.

{{}}
$ curl -s -i -X DELETE http://<IP_ADDRESS>:3000/aggregates/example_aggregate
HTTP/1.1 202 Accepted
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
Connection: close
Server: thin
{{}}

#### API specification {#aggregatesname-delete-specification}

/aggregates/:name (DELETE) |
---------------------------|------
description                | Deletes all aggregate data for a named aggregate.
example url                | http://hostname:3000/aggregates/elasticsearch
parameters              |

`dc`:

**required**: false

**type**: String

**description**: If the aggregate name is present in multiple datacenters, specifying the `dc` parameter accesses only the aggregate found in that datacenter.

**example**: `http://hostname:3000/aggregates/elasticsearch?dc=us_west1`

response type              | [HTTP-header][3] only (no output)
response codes             |

**Success**: 202 (Accepted)

**Found in multiple datacenters**: 300 (Multiple Choices)

**Missing**: 404 (Not Found)

**Error**: 500 (Internal Server Error)

output                     | {{}}HTTP/1.1 202 Accepted
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
Connection: close
Server: thin
{{}}

[1]:  /sensu-core/latest/reference/aggregates
[3]:  https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

repository: sensu/sensu-docs

repo_name: sensu/sensu-docs


text:
# Pierre's Bakery

#### This console application will take an order for a fictional bakery from the user and display the cost of that order.

#### By Anna Clarke

## Technologies Used

* _C#_
* _.Net_
* _MSTest_

## Description

This console app will welcome the user to Pierre's Bakery and display the cost and deals for bread and pastries. It will accept an input of number of bread loaves and pastries from the user, calculate the cost of the user's order, and display that cost to the user.

## Installation Requirements

* Clone this repository to your desktop
* Open in text editor
* Make sure you have .Net version 5.0 installed
* In your terminal, run $ dotnet restore, to install obj and bin folders

## Testing

* To test, navigate into Bakery.Solution/Bakery.Tests/
* run $ dotnet test, to check passing tests

## Setup

* Navigate into Bakery.Solution/Bakery/
* run command $ dotnet build, to build the program
* run command $ dotnet run, to run the app in your console
* follow console instructions to use application

## Known Bugs

* _Orders of over 100 total baked goods are accepted instead of directed to bakery's email_

## License

_[MIT](https://opensource.org/licenses/MIT)_

Copywrite(c)2021 Anna Clarke

## Contact Information

Anna Clarke<EMAIL_ADDRESS>
# Specs

### Products

A parent class that holds Bread and Pastry as child classes? Abstract class? Uses the methods inside Bread and Pastry to add their costs and determine the cost of the entire order

### Bread

Constructor builds with a property of number of loaves. (Extend to include different kinds of bread: sourdough, honey wheat, potato buttermilk)

Bread constructor (input)
input is an integer, number of loaves (integer is a positive number, no larger than 100.
You don't want customers putting in a massive order without making sure the bakery can produce that amount.
Any orders over 100 should display an email for the bakery so the customer can contact the bakery and arrange an extra large order.
Depending on the size of the bakery, number of employees, number of orders etc. this upper limit will be higher or lower)
input saved as a TotalLoaves property

method GetBreadCost()
called on Bread object to access TotalLoaves
output is an integer, cost of bread order
To calculate the cost of the bread order, every 3rd loaf of bread is free
One bread loaf costs $5.00

#### Inputs/Outputs

1. input = 0
   expected output = 0

2. input = 10
   expected output = 35

3. input = 11
   expected output = 40

4. input = 12
   expected output = 40

### Pastry

Same as Bread, except the deal is different: Buy 1 pastry for $2.00, or 3 for $5.00
In other words, every 3rd pastry is half off

#### Inputs/Outputs

1. input = 0
   expected output = 0

2. input = 4
   expected output = 7

3. input = 5
   expected output = 9

4. input = 6
   expected output = 10

repository: Messquerade/PierresBakery

repo_name: Messquerade/PierresBakery


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [@rocket.chat/fuselage-hooks](./fuselage-hooks.md) > [getTargetBoundaries](./fuselage-hooks.gettargetboundaries.md)

## getTargetBoundaries variable

<b>Signature:</b>

```typescript
getTargetBoundaries: ({ referenceBox, target, margin, }: {
    referenceBox?: DOMRect;
    target?: DOMRect;
    margin?: number;
}) => Boundaries | null
```

repository: robogenixaiorg/RoboChatComponents

branch_name: refs/heads/develop

gha_language: CSS

repo_name: robogenixaiorg/RoboChatComponents


text:
# ffi-cross tutorial

## Overview

`ffi-cross` provides a powerful set of tools for interfacing with dynamic libraries using pure JavaScript in the Node.js environment. It can be used to build interface bindings for libraries without using any C++ code.

### The [`types`][types] module

Primitive c types for `ffi-crros`

### The [`ref`][ref] module

Central to the `ffi-cross` infrastructure is the [`ref`][ref] module, which extends node's built-in `Buffer` class with some useful native extensions that make them act more like "pointers". While we try our best to hide the gory details of dealing with pointers, in many cases libraries use complex memory structures that require access to allocation and manipulation of raw memory. See its documentation for more details about working with "pointers".

### The `Library` function

_signature:_

```js
ffi.Library(_libraryFile_, { _functionSymbol_: [ _returnType_, [ _arg1Type_, _arg2Type_, ... ], ... ]);
```

The primary API for `ffi-cross` is through the `Library` function. It is used to specify a dynamic library to link with, as well as a list of functions that should be available for that library. After instantiation, the returned object will have a method for each library function specified in the function, which can be used to easily call the library code.

```js
const ffi = require("ffi-cross");
const { ref, types } = ffi;

// typedef
const sqlite3 = types.void; // we don't know what the layout of "sqlite3" looks like
const sqlite3Ptr = ref.refType(sqlite3);
const sqlite3PtrPtr = ref.refType(sqlite3Ptr);
const stringPtr = ref.refType(types.CString);
const sqlite3CallbackContext = types.voidPtr;
const sqlite3Callback = ffi.Function(types.int, [
  sqlite3CallbackContext,
  types.int,
  stringPtr,
  stringPtr,
]);

// binding to a few "libsqlite3" functions...
const lib =
  process.platform == "win32"
    ? path.join(
        process.env.ProgramData ?? "",
        "chocolatey/lib/SQLite/tools/sqlite3.dll"
      )
    : "libsqlite3";
const libsqlite3 = ffi.Library(lib, {
  sqlite3_open: [types.int, [types.CString, sqlite3PtrPtr]],
  sqlite3_close: [types.int, [sqlite3PtrPtr]],
  sqlite3_exec: [
    types.int,
    [
      sqlite3Ptr,
      types.CString,
      sqlite3Callback,
      sqlite3CallbackContext,
      stringPtr,
    ],
  ],
  sqlite3_changes: [types.int, [sqlite3PtrPtr]],
});

// now use them:
var dbPtrPtr = ref.alloc(sqlite3PtrPtr);
libsqlite3.sqlite3_open("test.sqlite3", dbPtrPtr);
var dbHandle = ref.deref(dbPtrPtr);
```

To construct a usable `Library` object, a "libraryFile" String and at least one function must be defined in the specification.

### Common Usage

For the purposes of this explanation, we are going to use a fictitious interface specification for "libmylibrary." Here's the C interface we've seen in its .h header file:

```c
double    do_some_number_fudging(double a, int b);
myobj *   create_object();
double    do_stuff_with_object(myobj *obj);
void      use_string_with_object(myobj *obj, char *value);
void      delete_object(myobj *obj);
```

Our C code would be something like this:

```c
#include "mylibrary.h"
int main()
{
    myobj *fun_object;
    double res, fun;

    res = do_some_number_fudging(1.5, 5);
    fun_object = create_object();

    if (fun_object == NULL) {
      printf("Oh no! Couldn't create object!\n");
      exit(2);
    }

    use_string_with_object(fun_object, "Hello World!");
    fun = do_stuff_with_object(fun_object);
    delete_object(fun_object);
}
```

The JavaScript code to wrap this library would be:

```js
const ffi = require("ffi-cross");
const { ref, types } = ffi;
// typedefs
const myobj = types.void; // we don't know what the layout of "myobj" looks like
const myobjPtr = ref.refType(myobj);

const MyLibrary = ffi.Library("libmylibrary", {
  do_some_number_fudging: [types.double, [types.double, types.int]],
  create_object: [myobjPtr, []],
  do_stuff_with_object: [types.double, [myobjPtr]],
  use_string_with_object: [types.void, [myobjPtr, types.string]],
  delete_object: [types.void, [myobjPtr]],
});
```

We could then use it from JavaScript:

```js
var res = MyLibrary.do_some_number_fudging(1.5, 5);
var fun_object = MyLibrary.create_object();

if (ref.isNull(fun_object)) {
  console.log("Oh no! Couldn't create object!\n");
} else {
  MyLibrary.use_string_with_object(fun_object, "Hello World!");
  var fun = MyLibrary.do_stuff_with_object(fun_object);
  MyLibrary.delete_object(fun_object);
}
```

### Output Parameters

Sometimes C APIs will actually return things using parameters. Passing a pointer allows the called function to manipulate memory that has been passed to it.

Let's imagine our fictitious library has an additional function:

```c
void manipulate_number(int *out_number);
void get_md5_string(char *out_string);
```

Notice that the `out_number` parameter is an `int *`, not an `int`. This means that we're only going to pass a pointer to a value (or passing by reference), not the actual value itself. In C, we'd do the following to call this method:

```c
int outNumber = 0;
manipulate_number(&outNumber);
```

The `& (lvalue)` operator extracts a pointer for the `outNumber` variable. How do we do this in JavaScript? Let's define the wrapper:

```js
var intPtr = ref.refType(types.int);

var libmylibrary = ffi.Library('libmylibrary', { ...,
  'manipulate_number': [ types.void, [ intPtr ] ]
});
```

Note how we've actually defined this method as taking a `int *` parameter, not an `int` as we would if we were passing by value. To call the method, we must first allocate space to store the output data using the `ref.alloc()` function, then call the function with the returned `Buffer` instance.

```js
var outNumber = ref.alloc("int"); // allocate a 4-byte (32-bit) chunk for the output data
libmylibrary.manipulate_number(outNumber);
var actualNumber = ref.deref(outNumber);
```

Once we've called the function, our value is now stored in the memory we've allocated in `outNumber`. To extract it, we have to read the 32-bit signed integer value into a JavaScript Number value by calling the `.deref()` function.

Calling a function that wants to write into a preallocated char array works in a similar way:

```js
var libmylibrary = ffi.Library('libmylibrary', { ...,
  'get_md5_string': [ types.void, [ types.CString ] ]
});
```

To call the method, we must first allocate space to store the output data using new Buffer(), then call the function with the `Buffer` instance.

```js
var buffer = new Buffer(32); // allocate 32 bytes for the output data, an imaginary MD5 hex string.
libmylibrary.get_md5_string(buffer);
var actualString = ref.readCString(buffer, 0);
```

### Async Library Calls

`node-ffi` supports the ability to execute library calls in a different thread using the **libuv** library. To use the async support, you invoke the `.async()` function on any returned FFI'd function.

```js
var libmylibrary = ffi.Library("libmylibrary", {
  mycall: [types.int, [types.int]],
});

libmylibrary.mycall.async(1234, function (err, res) {});
```

Now a call to the function runs on the thread pool and invokes the supplied callback function when completed. Following the node convention, an `err` argument is passed to the callback first, followed by the `res` containing the result of the function call.

```js
libmylibrary.mycall.async(1234, function (err, res) {
  if (err) throw err;
  console.log("mycall returned " + res);
});
```

### Callbacks

The native library can call functions inside the javascript. The `ffi.Callback` function returns a pointer that can be passed to the native library.

_signature:_

```js
ffi.Callback(_returnType_, [ _arg1Type_, _arg2Type_, ... ], _function_);
```

Example:

```js
const ffi = require("ffi-cross");
const { ref, types } = ffi;

// Interface into the native lib
const libname = ffi.Library("./libname", {
  setCallback: [types.void, [types.voidPtr]],
});

// Callback from the native lib back into js
const callback = ffi.Callback(
  types.void[(types.int, types.CString)],
  function (id, name) {
    console.log("id: ", id);
    console.log("name: ", name);
  }
);

console.log("registering the callback");
libname.setCallback(callback);
console.log("done");

// Make an extra reference to the callback pointer to avoid GC
process.on("exit", function () {
  callback;
});
```

The native library can call this callback even in another thread. The javascript function for the callback is always fired in the node.js main thread event loop. The caller thread will wait until the call returns and the return value can then be used.

Note that you need to keep a reference to the callback pointer returned by `ffi.Callback` in some way to avoid garbage collection.

### Structs

To provide the ability to read and write C-style data structures, `js-ffi-cross` provides StructType. See its documentation for more information about defining Struct types. The returned StructType constructors are valid "types" for use in FFI'd functions, for example `gettimeofday()`:

```js
const ffi = require("ffi-cross");
const { ref, types, StructType } = ffi;

const TimeVal = StructType({
  tv_sec: types.long,
  tv_usec: types.long,
});
const TimeValPtr = ref.refType(TimeVal);

const lib = new ffi.Library(null, {
  gettimeofday: [types.int, [TimeValPtr, types.voidPtr]],
});
const tv = new TimeVal();
lib.gettimeofday(ref.ref(tv), null);
console.log("Seconds since epoch: " + tv.tv_sec);
```

[ref]: https://github.com/ffi-cross/js-ffi-cross/blob/master/docs/ref.md
[types]: https://github.com/ffi-cross/js-ffi-cross/blob/master/docs/types.md
[ref-struct]: https://github.com/ffi-cross/js-ffi-cross/blob/master/types/lib/ref-struct.ts

repository: TimothyJones/js-ffi-cross

repo_name: TimothyJones/js-ffi-cross


text:
# dynflare

[![CI](https://github.com/jpillora/dynflare/workflows/CI/badge.svg)](https://github.com/jpillora/dynflare/actions?workflow=CI)

[Dynamic DNS](https://en.wikipedia.org/wiki/Dynamic_DNS) using Cloudflare. Periodically fetch your public IP address and ensure update the given `domain`'s A record to match it. Useful if your ISP don't provide static IPs.

### Install

**Binaries**

[![Releases](https://img.shields.io/github/release/jpillora/dynflare.svg)](https://github.com/jpillora/dynflare/releases) [![Releases](https://img.shields.io/github/downloads/jpillora/dynflare/total.svg)](https://github.com/jpillora/dynflare/releases)

See [the latest release](https://github.com/jpillora/dynflare/releases/latest) or download and install it now with `curl https://i.jpillora.com/dynflare! | bash`

**Source**

``` sh
$ go get -v github.com/jpillora/dynflare
```

### Usage

```
$ dynflare --help

  Usage: dynflare [options]

  Options:
  --interval, -i  polling interval (default 5m0s)
  --token, -t     cloudflare token (env TOKEN)
  --domain, -d    domain (env DOMAIN)
  --dry-run       only print dns updates
  --help, -h      display help

```

Systemd

```
$ cat dynflare.service
[Unit]
Description=dynflare

[Service]
Environment=DOMAIN=foobar.company.com
Environment=TOKEN=MySuperSecretToken
ExecStart=/usr/local/bin/dynflare
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
$ systemctl enable dynflare
$ systemctl start dynflare
$ systemctl status dynflare
```

### FAQ

* How do I get a token?
    * Visit https://dash.cloudflare.com/profile/api-tokens
    * Create an API Token with minimal scope (**not** an API Key)

#### MIT License

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

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

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: jpillora/dynflare

repo_name: jpillora/dynflare


text:
First of all, thank you for wanting to contribute. It is people like you that render open-source software possible.
Since pyGPGO is MIT Licensed, you can pretty much use the code here however it suits your needs, but if you want
to contribute to the existing codebase, please consider the following guidelines.

# How can I contribute to the project?

Essentially either by:
  1. Bug reporting.
  2. Suggesting a feature
  3. Contributing to the codebase

# Found a bug? Tell us about it!

Hey, your bug may already be fixed! Try to update to the latest pyGPGO version
(ideally the one provided in this repository) and check if it persists.

Open an issue using the tag `[BUG]` and try to be as descriptive as possible. Also tell us about:
  - your installed pyGPGO version.
  - your Python environment setup.
  - which OS you're running.

Ideally, we would also like to have a minimal working example of the issue for reproducibility.
We'll fix your bug as soon as possible.

# Got a feature request?

We are always looking for interesting ideas to implement in the codebase. Open an issue with the tag
`[REQUEST]` and describe your idea in detail, ideally providing some references.

After appropriate discussion, if you're feeling adventurous, you can implement your own idea and open
a pull request on the repository. We will review it in due time and approve it shall it meet our
quality criteria.

repository: josejimenezluna/pyGPGO

repo_name: josejimenezluna/pyGPGO


text:
[![CircleCI](https://circleci.com/gh/Haj-Res/Spring-Boot-Pet-Clinic/tree/develop.svg?style=svg)](https://circleci.com/gh/Haj-Res/Spring-Boot-Pet-Clinic/tree/develop)
# Spring-Boot-Pet-Clinic

This repo is for learning Spring Boot with Spring Framework 5. It's a recreation of the official Spring Framework Pet
Clinic with some experimental choices done in order to learn more about the framework.

# License
The Spring Boot Pet Clinic is released under version 2.0 of the
[Apache License](http://www.apache.org/licenses/LICENSE-2.0).

repository: Haj-Res/Spring-Boot-Pet-Clinic

gha_language: Java

repo_name: Haj-Res/Spring-Boot-Pet-Clinic


text:
# spi-device

SPI serial bus access with **Node.js** on Linux boards like the Raspberry
Pi or BeagleBone. All methods have asynchronous and synchronous forms.

spi-device supports Node.js versions 4, 6, 8 and 10.

[![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs)

## Contents

 * [Installation](#installation)
 * [Usage](#usage)
 * [API Documentation](#api-documentation)

## Installation

```
npm install spi-device
```

## Usage

Determine the temperature using a TMP36 analog temperature sensor wired to
channel 5 on an MCP3008 SPI A/D converter.

<img src="https://raw.githubusercontent.com/fivdi/spi-device/master/example/pi-mcp3008-tmp36.png">

```js
const spi = require('spi-device');

// The MCP3008 is on bus 0 and it's device 0
const mcp3008 = spi.open(0, 0, (err) => {
  // An SPI message is an array of one or more read+write transfers
  const message = [{
    sendBuffer: Buffer.from([0x01, 0xd0, 0x00]), // Sent to read channel 5
    receiveBuffer: Buffer.alloc(3),              // Raw data read from channel 5
    byteLength: 3,
    speedHz: 20000 // Use a low bus speed to get a good reading from the TMP36
  }];

  if (err) throw err;

  mcp3008.transfer(message, (err, message) => {
    if (err) throw err;

    // Convert raw value from sensor to celcius and log to console
    const rawValue = ((message[0].receiveBuffer[1] & 0x03) << 8) +
      message[0].receiveBuffer[2];
    const voltage = rawValue * 3.3 / 1023;
    const celcius = (voltage - 0.5) * 100;

    console.log(celcius);
  });
});
```

spi-device enables low-level access to SPI devices. Often, high-level access
is required. When this is the case, high-level packages can be built using
spi-device. An example of such a package is
[mcp-spi-adc](https://github.com/fivdi/mcp-spi-adc) which provides a high-level
API for accessing an MCP3008 SPI A/D converter and will generally be more
useful than the low-level demonstration code shown above.

## API Documentation

All methods have asynchronous and synchronous forms.

The asynchronous form always take a completion callback as its last argument.
The arguments passed to the completion callback depend on the method, but the
first argument is always reserved for an exception. If the operation was
completed successfully, then the first argument will be null or undefined.

When using the synchronous form any exceptions are immediately thrown. You can
use try/catch to handle exceptions or allow them to bubble up.

### Functions

- [open(busNumber, deviceNumber[, options], cb)](#openbusnumber-devicenumber-options-cb)
- [openSync(busNumber, deviceNumber[, options])](#opensyncbusnumber-devicenumber-options)

### Class SpiDevice

- [device.transfer(message, cb)](#devicetransfermessage-cb)
- [device.transferSync(message)](#devicetransfersyncmessage)
- [device.getOptions(cb)](#devicegetoptionscb)
- [device.getOptionsSync()](#devicegetoptionssync)
- [device.setOptions(options, cb)](#devicesetoptionsoptions-cb)
- [device.setOptionsSync(options)](#devicesetoptionssyncoptions)
- [device.close(cb)](#deviceclosecb)
- [device.closeSync()](#deviceclosesync)

### Constants

- [MODE0](#mode0)
- [MODE1](#mode1)
- [MODE2](#mode2)
- [MODE3](#mode3)

### open(busNumber, deviceNumber[, options], cb)
- busNumber - the number of the SPI bus to open, 0 for `/dev/spidev0.n`, 1 for `/dev/spidev1.n`, ...
- deviceNumber - the number of the SPI device to open, 0 for `/dev/spidevn.0`, 1 for `/dev/spidevn.1`, ...
- options - an optional object specifying device
[configuration options](#configuration-options)
- cb - completion callback

Asynchronous open. Returns a new SpiDevice object. The completion callback gets
one argument (err). The SpiDevice object returned should not be used before the
completion callback is called.

### openSync(busNumber, deviceNumber[, options])
- busNumber - the number of the SPI bus to open, 0 for `/dev/spidev0.n`, 1 for `/dev/spidev1.n`, ...
- deviceNumber - the number of the SPI device to open, 0 for `/dev/spidevn.0`, 1 for `/dev/spidevn.1`, ...
- options - an optional object specifying device
[configuration options](#configuration-options)

Synchronous open. Returns a new SpiDevice object.

### device.transfer(message, cb)
- message - an array of one or more read+write transfers
- cb - completion callback

Asynchronous message transfer. An SPI
[message](#message) is an array of one or
more read+write transfers. The completion callback gets two arguments (err,
message). Returns this.

### device.transferSync(message)
- message - an array of one or more read+write transfers

Synchronous message transfer. An SPI
[message](#message) is an array of one or
more read+write transfers. Returns this.

### device.getOptions(cb)
- cb - completion callback

Asynchronously read device
[configuration options](#configuration-options).
The completion callback gets two arguments (err, options) where options is an
object describing the device configuration options. Returns this.

### device.getOptionsSync()

Synchronously read device
[configuration options](#configuration-options).
Returns an object describing the device configuration options.

### device.setOptions(options, cb)
- options - an object specifying device
[configuration options](#configuration-options)
- cb - completion callback

Asynchronously write device
[configuration options](#configuration-options).
The completion callback gets one argument (err). Returns this.

### device.setOptionsSync(options)
- options - an object specifying device
[configuration options](#configuration-options)

Synchronously write device
[configuration options](#configuration-options).
Returns this.

### device.close(cb)
- cb - completion callback

Asynchronous close. The completion callback gets one argument (err). Returns
null.

### device.closeSync()

Synchronous close. Returns null.

### MODE0

SPI mode number 0.

### MODE1

SPI mode number 1.

### MODE2

SPI mode number 2.

### MODE3

SPI mode number 3.

### Message

An SPI message is an array of one or more read+write transfers. A transfer
is an object with the properties listed below. Most of the properties are
optional. Note that although both sendBuffer and receiveBuffer are optional,
at least one one of them must be specified.

- byteLength - number, 32-bit, the number of bytes to transfer
- sendBuffer - optional Buffer, transmit data
- receiveBuffer - optional Buffer, receive data
- speedHz - optional number, 32-bit, override of the device's clock frequency
in Hertz
- microSecondDelay - optional number, 16-bit, delay after the last bit transfer
before optionally deselecting the device before the next transfer, default 0
- bitsPerWord - optional number, 8-bit, override of the device's wordsize
- chipSelectChange - optional boolean, true to deselect device before starting
the next transfer, default false

### Configuration Options

Device configuration options can be optionally specified when a device is
opened with the `open` or `openSync` methods. They can also be specified at a
later point with the `setOptions` or `setOptionsSync` methods. When calling
these methods, only the options that need to be set need to be specified in the
options object passed to those methods. All options are optional and the
appropriate defaults will be used for options that are not specified.

The options supported varies from system to system and will depend on the
device drivers used on those systems.

Configurations options can be read with the `getOptions` and `getOptionsSync`
methods.

- mode - number, 2-bit, MODE0, MODE1, MODE2, or MODE3, default MODE0
- chipSelectHigh - boolean, true for active high chip select, default false
- lsbFirst - boolean, true for least significant bit first transfer, default
false
- threeWire - boolean, true for shared MISO/MOSI signals, default false
- loopback - boolean, true for loopback mode, default false
- noChipSelect - boolean, true for 1 device per bus, no chip select, default
false
- ready - boolean, true if device pulls low to pause, default false
- bitsPerWord - number, 8-bit, device word size, default 8
- maxSpeedHz - number, 32-bit, device clock frequency in Hertz, default system
specific


text:
# Moving from MVC to React

> [![](logo.png)](http://www.slideshare.net/ericclemmons/from-mvc-to-react)
> – Eric Clemmons @ [Space City JS 2015](http://spacecityjs.com/)

This project has [step-by-step commits][commits] introducing the following
concepts in [React][react]:

- Running [React][react] on the server.
- Rendering a simple `<Component />`.
- Passing `props` into a `<Component />`.
- Rendering [React][react] on the client.
- Serializing data on the server & using it on the client.
- Using `context` to pass data to deeply-nested children.
- Simple testing using [Mocha][mocha]

## Dependencies

- [Node](https://nodejs.org/)
- [nvm](https://github.com/creationix/nvm)

## Installation

After cloning/download this project:

```shell
$ nvm install
$ nvm use
$ npm install
```

Now that the correct version of Node & NPM dependencies are installed:

```shell
$ npm start
```

Open the project in your editor, then go to the following URLs and see
how it all works:

- <http://localhost:3000>
- <http://localhost:3000/foo>
- etc.

## Resources

These are from the final slide.

- Learning
  + <http://facebook.github.io/react/>
  + <http://conf.reactjs.com/schedule.html>
  + <https://www.tildedave.com/2014/11/15/introduction-to-contexts-in-react-js.html>
  + <https://github.com/ericclemmons/mvc-to-react>

- Getting Started
  + <https://github.com/RickWong/react-isomorphic-starterkit>
  + <https://github.com/rackt/react-router/>

- Other Environments
  + <https://github.com/reactjs/react-rails>
  + <https://github.com/reactjs/React.NET>
  + <https://github.com/reactjs/react-python>
  + <https://github.com/reactjs/react-php-v8js>

- Flux Implementations
  + <http://goatslacker.github.io/alt/>
  + <https://github.com/acdlite/flummox/>
  + <https://facebook.github.io/flux/>
  + <http://fluxible.io/>
  + <http://martyjs.org/>
  + <https://github.com/spoike/refluxjs/>

- Community
  + <http://reactiflux.com/>

[commits]: https://github.com/ericclemmons/mvc-to-react/commits/master
[mocha]: http://mochajs.org/
[react]: http://facebook.github.io/react/

repository: ericclemmons/mvc-to-react

repo_name: ericclemmons/mvc-to-react


text:
# Where Should We Eat?

This project sets up a restaurant listing website.

## Table of contents

* [Program installation](#installation)
* [Database setup](#database-setup)
* [Creator](#creator)
* [Copyright and license](#copyright-and-license)

## Installation

For starters, you need [Python](https://www.python.org/downloads/). The program was written for Python 2.7, so that's what you should download and install. You may already have Python, especially if you're on a Mac or Linux machine. To check, open a Terminal window (on a Mac, use the Spotlight search and type in "Terminal"; on a PC go to Start > Run and type in "cmd") and type "python" at the prompt. You should get something that looks like this (run on my Mac):

```
Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
```

Note the version number (2.7.10 in this case). If it starts with "3.", you should download version 2.7. If you have questions about any of this, check Python's [excellent online documentation](https://www.python.org/doc/).

There are a number of Python module dependencies for this project. To install them all, run the following:

```
pip install -r requirements.txt
```

Finally, you'll need [git](http://git-scm.com/download) so that you can clone this project.

## Database setup

The project user Sqlite as a database. To set it up, just run:

```
python database_setup.py
```

The file lotsofmenusandusers.py contains test data. To load it into the database, run:

```
python lotsofmenusandusers.py
```

## Creator

This program was built by me, Chris Willey, as part of the Udacity Nanodegree program for [Full Stack Developer](https://www.udacity.com/course/full-stack-web-developer-nanodegree--nd004).

## Copyright and License

Code and documentation copyright 2015 Christopher Willey. Code released under the MIT license.

repository: chriswilley/where-should-we-eat

repo_name: chriswilley/where-should-we-eat


text:
---
category: minorAnalysis
---
* The `cpp/non-constant-format` query no longer considers an assignment on the right-hand side of another assignment to be a source of non-constant format strings. As a result, the query may now produce fewer results.

repository: porcupineyhairs/ql

gha_language: CodeQL

repo_name: porcupineyhairs/ql


text:
# Ouch Rx [![Build Status](https://travis-ci.org/AGrzes/ouch-rx.svg?branch=master)](https://travis-ci.org/AGrzes/ouch-rx) [![Coverage Status](https://coveralls.io/repos/github/AGrzes/ouch-rx/badge.svg?branch=master)](https://coveralls.io/github/AGrzes/ouch-rx?branch=master)
Library wrapping [PouchDB](https://pouchdb.com/) with [rxjs](https://rxjs-dev.firebaseapp.com/) observables.

## Usage
To use Ouch Rx one have to wrap database object with Ouch instance and then use its methods to create Observables and Observers.

```javascript
const {Ouch} = require('ouch-rx');
const ouch = new Ouch(db);
ouch.all().pipe(transform).subscribe(ouch.sink())
```
## Reference
### Constructor
Wraps single pouchdb database.
```javascript
new Ouch(db)
```
|Argument| Description|
|---|---|
| db | A PouchDB database |

### Methods
#### all
Returns observable of all documents.
```javascript
ouch.all(options)
```
|Argument| Description|
|---|---|
| options | An options object passed to db.all_docs. The following fields are not passed: `include_docs` |

#### changes
Returns observable of a change feed.
```javascript
ouch.changes(options)
```
|Argument| Description|
|---|---|
| options | An options object passed to db.changes.|

#### view
Returns observable of view results.
```javascript
ouch.view(name,options)
```
|Argument| Description|
|---|---|
| name | A view name |
| options | An options object passed to db.query. The following fields are not passed: `include_docs` |

To use this method the db object must support query method.

#### sink
Returns observer that writes incoming objects into db.

The operation will fail on any error so it is useful for inserting completely new documents and for updating documents previously fetched from db (so current `_rev` is known).
```javascript
ouch.sink()
```
#### merge
Returns observer that writes incoming objects into db.

The operation will call the merge function with incoming object to prepare document to store. The operation will call the merge function again with incoming object and current document state if conflict is encountered. It will then retry write with the result of merge function.
```javascript
ouch.merge(mergeFunction)
```
|Argument| Description|
|---|---|
| mergeFunction | A merge function `(object,current) => document to store`  |

### Merge Functions
The following ready to use merge functions are provided
* `skip` - if document exist in database then skip update
* `override` - override document in database with new document
* `assign` - merge the existing and new document the way that uses new properties over existing but leave existing properties if new values are not provided. The merge is shallow, it considers only top level properties.

repository: AGrzes/ouch-rx

repo_name: AGrzes/ouch-rx


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.9.2](https://github.com/ecomfe/react-hooks/compare/@huse/poll@0.9.1<EMAIL_ADDRESS>(2020-03-02)

### Bug Fixes

* upgrade user-attention to use passive events ([aae1dd1](https://github.com/ecomfe/react-hooks/commit/aae1dd19d0d6b0d03472eccf214def8102828eca))

## [0.9.1](https://github.com/ecomfe/react-hooks/compare/@huse/poll@0.9.0<EMAIL_ADDRESS>(2020-02-25)

**Note:** Version bump only for package @huse/poll

# 0.9.0 (2020-02-23)

### Features

* poll hooks ([d823629](https://github.com/ecomfe/react-hooks/commit/d82362963234b6c5243ca79fdf2c4e006318e04c))


text:
# Python GeoLambda

The Python GeoLambda image is meant to be used as a template for your own Python based geospatial project.  Follow the usage instructions to package, test, and deploy your own Lambda.

## Usage

These instructions show how to use the files in this directory to create your own Python based geospatial Lambda function and get it deployed.

**1. Update requirements**

First a Docker image will need to be created based on GeoLambda that includes the dependencies needed. The first thing is to is update the `requirements-pre.txt` and `requirement.txt` files with the dependencies needed. The `requirements-pre.txt` is a way to specify build dependencies to packages in `requirements.txt`. For instance, rasterio requires numpy is installed before rasterio. This is a well known pip problem that is fixed in [PEP 518](https://www.python.org/dev/peps/pep-0518/) but is not used by all packages so this work-around is needed.

**2. Create handler**

An example Lambda handler is located at [lambda/lambda_function.py](lambda/lambda_function.py). Ideally most of the logic in your Lambda should be in packages and the handler should only be responsible for taking in an event, calling relevant functions, and returning some output. Keep the handler code as small as possible. Move more complex code into packages or make them other functions in the [lambda/lambda_function.py](lambda/lambda_function.py) file.

**3. Build image**

Now, use the [Dockerfile](Dockerfile) can be used to create a new Docker image based on any version of GeoLambda with any version of Python by providing the versions as build arguments to `docker run`. This will install the specified version of Python along with any Python packages provided in [requirements.txt](requirements.txt).

```
$ VERSION=1.2.0
$ docker build . --build-arg VERSION=${VERSION} --build-arg PYVERSION=3.7.4 -t <myimage>:latest
```

If not provided, `VERSION` (the version of GeoLambda to use) will default to `latest` and `PYVERSION` (Python version) will default to `3.7.4`.

**4. Set up development environment and lambda layer zip file**

First you'll need to build a `geolambda` base layer, and then you'll have to build `geolambda-python` layer located in `python/` directory.

All that's needed to create a development package is to install the Python packages into the `python/lambda/` directory using the `package-python.sh` script. This copies the installed site-packages over the lambda directory, but excluding some libraries since they won't be needed. This includes packages that are already pre-installed in Lambda like boto3, as well as files and libraries that wouldn't be used operationally (e.g., testing files).

This will create geolambda base layer (`lambda-deploy.zip`) file and `/geolambda/lambda` directory needed for development.

```
# current dir: geolambda (up one level)

$ docker run --rm -v $PWD:/home/geolambda -it developmentseed/geolambda:${VERSION} package.sh
```

This will copy site-packages in /geolambda/python/lambda directory needed for development. Also, it will create a `lambda-layer-deploy.zip` file in the current directory.
Contents of the zip file are following AWS conventions: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path

```
# current dir: geolambda/python

$ docker run -v ${PWD}:/home/geolambda -t <myimage>:latest package-python.sh
```

**5. Testing deployment package**

You can use the [LambCI Docker images](https://github.com/lambci/docker-lambda) to test out your handler in the Lambda environment by mounting the base GeoLambda Lambda layer (`/geolambda/lambda`) and the lambda directory (`/geolambda/python/lambda`) created above.

```
# current dir: geolambda/python

$ docker run --rm -v ${PWD}/lambda:/var/task -v ${PWD}/../lambda:/opt lambci/lambda:python3.7 lambda_function.lambda_handler '{}'
```

The last argument is a JSON string that will be passed as the event payload to the handler function.

**6. Deploy as Lambda layer (if layer already exists a new version will be created)**

Deploy the Lambda layer by using AWS CLI.

```
$ aws lambda publish-layer-version \
	--layer-name geolambda-python \
	--description "Python bindings for GDAL" \
	--zip-file fileb://lambda-layer-deploy.zip
```

### Pre-built images

Builds of this default Python image are also available on Docker Hub as tags in the `developmentseed/geolambda` repository.

    $ docker pull developmentseed/geolambda:${VERSION}-python

To run the image interactively:

    $ docker run -v ${PWD}:/home/geolambda --rm -it developmentseed/geolambda:${VERSION}-python

This image includes the dependencies specified in the default [requirements.txt](requirements.txt) file.

## Development

To create a new official version of a Python GeoLambda Docker image for publication to Docker Hub follow these steps *after* following the [steps for publishing a new base GeoLambda](../README.md). These steps are performed automatically in [CircleCI](../.circleci/config.yml)

From this directory:

```
$ VERSION=$(cat ../VERSION)
$ docker build . --build-arg VERSION=${VERSION} -t developmentseed/geolambda:${VERSION}-python
```

Provide `--build-arg PYVERSION=X.Y.Z` to build other Python versions and change the tag to be `${VERSION}-python`

repository: USACE/cumulus-geolambda

repo_name: USACE/cumulus-geolambda


text:
## Install and run locally with Docker :house_with_garden:

These instructions will help you:

1. Clone the repo to your local machine
2. Create a new virtual environment to install Python dependencies
3. Initialise the sqlite3 database
4. Create a Django Superuser (for accessing the Django Admin at http://localhost:8000/admin/)
5. Ingest OpenFisca data from the specified OpenFisca API URL
6. Serve the Django Webserver locally at http://localhost:8000/

---

#### Clone this repo :alien:

```
$ git clone git@github.com:RamParameswaran/openfisca-djangoapi.git
$ cd openfisca-djangoapi
```

#### Install docker and docker-compose

Install docker and docker-compose on your machine (if you don't already have it installed):
- docker: https://docs.docker.com/get-docker/
- docker-compose: https://docs.docker.com/compose/install/

#### Build the Docker image

Check config parameters:
```
# Some config params are seting in the `docker-compose.yml` file
# The most relevant are the `app->environment` variables such as "OPENFISCA_API_URL" and "PORT"
# Change these as necessary.

```
Init project:

```
$ cd openfisca-djangoapi
$ docker-compose build
```

#### Setup the Django database using Docker

Setup database:

```
$ docker-compose run app setup_db
$ docker-compose run app fetch_data
```

#### Serve the Django application using Docker

Launch:

```
$ docker-compose up app
```

_Now your django app is available on http://localhost:8000_

### ADDITIONAL FUNCTIONALITY

#### Docker Container commands

You can run Django and bash command in the Docker container:

```
$ docker-compose run app <command>
```

Available commands:

| Command  | Description                                                                     |
| -------- | ------------------------------------------------------------------------------- |
| dev      | Start a normal Django development server                                        |
| bash     | Start a bash shell                                                              |
| manage   | Start manage.py                                                                 |
| setup_db | Setup the initial database. Any existing DB will be destroyed first.
| fetch_data | Ingests OpenFisca ruleset. Configure _$OPENFISCA_API_URL_ in docker-compose.yml |
| lint     | Run pylint                                                                      |
| python   | Run a python command                                                            |
| shell    | Start a Django Python shell                                                     |
| uwsgi    | Run uwsgi server                                                                |
| help     | Show this message                                                               |

#### Example: Create a Django superuser (to access the admin portal)

```
$ docker-compose run app manage createsuperuser
```


text:
# OpenTI (z80e core)

This is a binding of the [z80e](https://github.com/KnightOS/z80e), but compiled into JavaScript using emscripten. To make it easy to use, a OpenTI-like wrapper will be written around it. This will also be the holding place of the HTML-based TI emulator (and maybe even TI IDE, later!).

## Help, Bugs, Feedback

If you need help with KnightOS, want to keep up with progress, chat with
developers, or ask any other questions about KnightOS, you can hang out in the
IRC channel: #knightos on irc.libera.chat

To report bugs, please create [a GitHub issue](https://github.com/KnightOS/KnightOS/issues/new) or contact us on IRC.

If you'd like to contribute to the project, please see the [contribution guidelines](http://www.knightos.org/contributing).

repository: KnightOS/OpenTI

repo_name: KnightOS/OpenTI


text:
---
defaults:
  # _posts
  - scope:
      path: ""
      type: posts
    values:
      layout: single
      author_profile: true
      read_time: true
      comments: true
      share: true
      related: true
title: "New paper on eLife"
header:
  teaser: /assets/images/jamie_elife_assembled.png
---

![image-center](/assets/images/jamie_elife_assembled.png){: .align-center}

Our lab has just published a [new paper on eLife](https://elifesciences.org/articles/45068), investigating the allosteric effects of multiple ligands on the PKM2 enzyme – superb experimental and computational investigations + plus a new package AlloHubMat – a PhD-worth piece of work! Congratulations to Jamie!


text:
# last.fm-spelunker

### basic setup
`last.fm-spelunker` has a few requirements:
1. __Python__. Both Python 2.X and 3.X are supported, but Python 3.X is recommended.
2. __Some Python packages__—these may be easily installed via the `requirements.txt`.

### scraper
Generates an exhaustive SQL database of the user's scrobbles and any related info (e.g. data for scrobbled songs or artists) through [the last.fm API](https://www.last.fm/api). Note: the `artists` functionality is currently disabled but may easily be re-enabled in `scraper.py`.

Usage: `python scraper.py <last.fm username> ... <last.fm username>`
```
~$ python scraper.py sbansal21
Retrieved scrobble history....  444 of 444      for sbansal21.
```

If a user's scrobble history has already been scraped previously, `scraper.py` will automatically update that history with any new scrobbles. Additionally, `scraper.py` supports scraping multiple users' scrobble history at once:

Usage: `python scraper.py <last.fm username> ... <last.fm username>`
```
~$ python scraper.py sbansal21 iuyag
Updated scrobble history with 745 new scrobbles for sbansal21.
Retrieved scrobble history....  47 of 47        for iuyag.
```

### scrubber
Programmatically cleans up a user's scrobble history in the database by renaming "variant" album names. This essentially means if there are multiple variants of the same album name (e.g. `The Sun's Tirade` and `The Sun's Tirade (Explicit)`), those variants will all be standardized to the album's original name (in this example, `The Sun's Tirade`). Optionally applies a SQL script.

Usage: `python scrubber.py <last.fm username> [SQL script]`
```
~$ python scrubber.py sbansal21
Renamed variant album names for sbansal21.

~$ python scrubber.py iuyag scrubscript.sql
Renamed variant album names.
Applied scrubscript.sql to the database.
```

### spelunker
Generates a series of graphs based on scrobble data. Currently supports pie charts and streamgraphs.

#### scrobble-pie
This requires first generating the database via the scraper tool, as outlined [above](#scraper). `scrobble-pie` is currently deprecated as a result of recent schema changes but will be made functional again soon.

1. Enter the `scrobble-pie` directory and process some data:
```
~$ cd scrobble-pie
```
Usage: `node db.js <percentage limit> <artist limit>`
```
~$ node db.js 0.4 25
```
`percentage limit` puts an upper bound on how much of the chart can be taken up by the "Other" category and `artist limit` sets a max number of artists that can be displayed on the chart.

2. Within the main directory, set up an HTTP server—this is pretty simple with Python. The commands differ for Python 2.X and 3.X. The version can be easily checked:
```
~$ cd ..
~$ python --version
```

For Python 2.X:
```
~$ python -m SimpleHTTPServer 8000
```

For Python 3.X:
```
~$ python -m http.server 8000
```

From here, go to `localhost:8000/scrobble-pie/index.html` on any browser to view the streamgraph.

#### scrobble-streamgraph
1. Run the `spelunker` script, which packages up the scraper, scrubber, and actual streamgraph generation.

Usage: `python spelunker.py <username> <minimum scrobbles>`
```
~$ python spelunker.py sbansal21 75
```
`minimum scrobbles` just means the minimum number of scrobbles for an artist in any month to avoid cluttering the graph with random one-time scrobbles—`25` can be a good number to start off with but larger minimums can reduce both noise and lag on the graph.

2. Set up an HTTP server—this is pretty simple with Python. The commands differ for Python 2.X and 3.X. The version can be easily checked:
```
~$ python --version
```

For Python 2.X:
```
~$ python -m SimpleHTTPServer 8000
```

For Python 3.X:
```
~$ python -m http.server 8000
```

From here, go to `localhost:8000/scrobble-streamgraph/index.html` on any browser to view the streamgraph.

![screenshot1](https://github.com/sumeet-bansal/last.fm-spelunker/blob/master/examples/screenshot1.png)
![screenshot2](https://github.com/sumeet-bansal/last.fm-spelunker/blob/master/examples/screenshot2.png)
![screenshot3](https://github.com/sumeet-bansal/last.fm-spelunker/blob/master/examples/screenshot3.png)
![screenshot4](https://github.com/sumeet-bansal/last.fm-spelunker/blob/master/examples/screenshot4.png)

![embed1](https://github.com/sumeet-bansal/last.fm-spelunker/blob/master/examples/embed1.gif)
![embed2](https://github.com/sumeet-bansal/last.fm-spelunker/blob/master/examples/embed2.gif)
![embed3](https://github.com/sumeet-bansal/last.fm-spelunker/blob/master/examples/embed3.gif)

## TODO
### Planned Graphs
+ [pie chart in pure D3.js](http://bl.ocks.org/dbuezas/9306799) and [bubble charts](https://bl.ocks.org/mbostock/4063269)
+ [hierarchical edge bundling graphs](https://mbostock.github.io/d3/talk/20111116/bundle.html) for related artists
+ [bullet charts](https://bl.ocks.org/mbostock/4061961) for percentile visualizations
+ [classic last.fm-style hierarchical bar charts](https://mbostock.github.io/d3/talk/20111116/bar-hierarchy.html)
+ historical pattern detection based on probability distribution outliers

### Planned Updates
+ better opts and a full command-line spelunker client
+ move to a full Node.js or Flask/Django application with an actual routing system instead of just viewing files
+ evolve basic graph pages to full webpages with real CSS