text:
[![crates.io](https://img.shields.io/crates/v/bacon-cipher.svg)](https://crates.io/crates/bacon-cipher)
[![Build Status](https://travis-ci.org/astonbitecode/bacon-cipher.svg?branch=master)](https://travis-ci.org/astonbitecode/bacon-cipher)
[![codecov](https://codecov.io/gh/astonbitecode/bacon-cipher/branch/master/graph/badge.svg)](https://codecov.io/gh/astonbitecode/bacon-cipher)

# bacon-cipher

An implementation of the [Bacon's cipher](https://en.wikipedia.org/wiki/Bacon%27s_cipher).

The crate offers codecs that _encode / decode_ and  steganographers that _hide / reveal_ encoded messages.

**Available codecs:**

* CharCodec: A codec that encodes data of type `char`.

    The encoding is done by substituting with two given elements (`elem_a` and `elem_b`) of type `T`.

    The substitution is done using the __first__ version of the Bacon's cipher.

* CharCodecV2: A codec that encodes data of type `char`.

    The encoding is done by substituting with two given elements (`elem_a` and `elem_b`) of type `T`.

    The substitution is done using the __second__ version of the Bacon's cipher.

**Available steganographers:**

* LetterCaseSteganographer: Applies steganography based on the case of the characters.

    E.g. Lowercase for Bacon's element A, capital for Bacon's element B.

* MarkdownSteganographer: Applies steganography based on Markdown tags that surround elements.

    E.g. Sourround an element with `**` for Bacon's element A and the rest of the elements are considered as Bacon's element B.

* SimpleTagSteganographer: Applies steganography based on HTML or XML tags that surround elements. (needs the feature `extended-steganography`)

    E.g. Sourround an element with `<b>` and `</b>` for Bacon's element A and with `<i>` and `</i>` for Bacon's element B.

## Encoding - Decoding

### Encode a message to Bacon codes

```rust
use bacon_cipher::codecs::char_codec::CharCodec;
use bacon_cipher::BaconCodec;
use std::iter::FromIterator;

// Define a Bacon Codec that encodes using the characters 'A' and 'B'
let codec = CharCodec::new('A', 'B');

// This is the secret to encode
let secret: Vec<char> = "My secret".chars().collect();

// Get the encoded chars
let encoded_chars = codec.encode(&secret);
let encoded_string = String::from_iter(encoded_chars.iter());

assert_eq!("ABABBBABBABAAABAABAAAAABABAAAAAABAABAABA", encoded_string);
```

### Decode Bacon codes

```rust
use bacon_cipher::codecs::char_codec::CharCodec;
use bacon_cipher::BaconCodec;
use std::iter::FromIterator;

// Define a Bacon Codec that encodes using the characters 'A' and 'B'
let codec = CharCodec::new('A', 'B');

// These are the encoded characters
let encoded_chars: Vec<char> = "ABABBBABBABAAABAABAAAAABABAAAAAABAABAABA".chars().collect();

// Retrieve the decoded chars
let decoded = codec.decode(&encoded_chars);
let string = String::from_iter(decoded.iter());

assert_eq!("MYSECRET", string);
```

## Steganography

### Letter case

#### Disguise a hidden message into a public one

```rust
use bacon_cipher::codecs::char_codec::CharCodec;
use bacon_cipher::stega::letter_case::LetterCaseSteganographer;
use bacon_cipher::{BaconCodec, Steganographer};
use std::iter::FromIterator;

// Define a Bacon Codec that encodes using the characters 'A' and 'B'
let codec = CharCodec::new('a', 'b');

// Apply steganography based on the case of the characters
let s = LetterCaseSteganographer::new();

// This is the public message in which we want to hide the secret one.
let public_chars: Vec<char> = "This is a public message that contains a secret one".chars().collect();

// This is the message that we want to hide.
let secret_chars: Vec<char> = "My secret".chars().collect();

// This is the public message that contains the secret one
let disguised_public = s.disguise(&secret_chars, &public_chars, &codec);
let string = String::from_iter(disguised_public.unwrap().iter());

assert!(string == "tHiS IS a PUbLic mEssAge thaT cOntains A seCreT one");
```

#### Reveal a hidden message from a public one

```rust
use bacon_cipher::codecs::char_codec::CharCodec;
use bacon_cipher::stega::letter_case::LetterCaseSteganographer;
use bacon_cipher::{BaconCodec, Steganographer};
use std::iter::FromIterator;

// Define a Bacon Codec that encodes using the characters 'A' and 'B'
let codec = CharCodec::new('a', 'b');

// Apply steganography based on the case of the characters
let s = LetterCaseSteganographer::new();

// This is the public message that contains a hidden message
let public_chars: Vec<char> = "tHiS IS a PUbLic mEssAge thaT cOntains A seCreT one".chars().collect();

// This is the hidden message
let output = s.reveal(&public_chars, &codec);
let hidden_message = String::from_iter(output.unwrap().iter());
assert!(hidden_message.starts_with("MYSECRET"));

```

### Markdown

#### Disguise a hidden message into a public one

```rust
use bacon_cipher::codecs::char_codec::CharCodec;
use bacon_cipher::stega::markdown::{MarkdownSteganographer, Marker};
use bacon_cipher::{BaconCodec, Steganographer};
use std::iter::FromIterator;

// Define a Bacon Codec that encodes using the characters 'A' and 'B'
let codec = CharCodec::new('a', 'b');

// Apply steganography based on Markdown markers
let s = MarkdownSteganographer::new(
    Marker::empty(),
    Marker::new(
        Some("*"),
        Some("*"))).unwrap();

// This is the public message in which we want to hide the secret one.
let public = "This is a public message that contains a secret one";

// This is the message that we want to hide.
let secret_chars: Vec<char> = "My secret".chars().collect();

let output = s.disguise(
    &secret_chars,
    &Vec::from_iter(public.chars()),
    &codec);
let string = String::from_iter(output.unwrap().iter());
assert!(string == "T*h*i*s* *is* a *pu*b*l*ic m*e*ss*a*ge tha*t* c*o*ntains *a* se*c*re*t* one");
```

#### Reveal a hidden message from a public one

```rust
use bacon_cipher::codecs::char_codec::CharCodec;
use bacon_cipher::stega::markdown::{MarkdownSteganographer, Marker};
use bacon_cipher::{BaconCodec, Steganographer};
use std::iter::FromIterator;

// Define a Bacon Codec that encodes using the characters 'A' and 'B'
let codec = CharCodec::new('a', 'b');

// Apply steganography based on Markdown markers
let s = MarkdownSteganographer::new(
    Marker::empty(),
    Marker::new(
        Some("*"),
        Some("*"))).unwrap();

// This is the public message that contains a hidden message
let public = "T*h*i*s* *is* a *pu*b*l*ic m*e*ss*a*ge tha*t* c*o*ntains *a* se*c*re*t* one";

// This is the hidden message
let output = s.reveal(
    &Vec::from_iter(public.chars()),
    &codec);
assert!(output.is_ok());
let string = String::from_iter(output.unwrap().iter());
assert!(string.starts_with("MYSECRET"));
```

## Licence

At your option, under:

* Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
* MIT license (http://opensource.org/licenses/MIT)

repository: astonbitecode/bacon-cipher

repo_name: astonbitecode/bacon-cipher


text:
duplo
=====

image library de-duper.

# Purpose

To be able to import images from many sources and still contain them easily in the same directory, even if there are occasional name collisions.

Currently only searches duplicates where filenames collide.

Method:

- index all the photos in the current directory and its subdirectories by filename
    - for colliding filenames, find out if they are the duplicates:
        - if duplicate: remove all but one
        - not duplicate: rename file(s) to avoid collisions

Nothing is altered, only actions suggested.

# Example

./test is a directory with the following structure:

        test
        ├── import-1
        │   ├── img1.jpg
        │   └── img2.jpg
        ├── import-2
        │   ├── img1.jpg
        │   └── img3.jpg
        └── import-3
            └── img2.jpg

import-1/img1.jpg and import-2/img1.jpg are the same file.
import-1/img2.jpg and import-3/img2.jpg are different files, despite the file name.
import-2/img3.jpg and import-3/img2.jpg are the same file, despite the file name.

Sample run:

    $ node duplo test

    Scanning test...
       import-1/
       import-2/
       import-3/
    Scanning done.
    img2.jpg (2 matches)
       test/import-3/img2.jpg md5=b1f8546c0bb13e1bda64c7795d7c7d5b
       test/import-1/img2.jpg md5=f467567c76296dd0c204d9bccafc7bc0
    img1.jpg (2 matches)
       test/import-2/img1.jpg md5=8f26b488cc2092d3c365e6627d22c19e
       test/import-1/img1.jpg md5=8f26b488cc2092d3c365e6627d22c19e

    These files have copies and should be safe to delete:
    test/import-1/img1.jpg

    These files should be renamed:
    test/import-1/img2.jpg -> test/import-1/img2-99d1.jpg

To summarize: *Dupes are detected only if they share their filename.*

# Todo

- use perceptual hashing / hamming distance for detecting dupes:
    https://github.com/aaronm67/node-phash

# License

MIT

license: MIT

repository: mieky/duplo

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mieky/duplo


text:
# Version 10.4.0

In this version we simplified the API

- TyduxStore's type parameter for the state is optional now

  If you don't use a global AppState previously you have to write ```TyduxStore<any>```. Now you can obmit the type parameter and just write ```TyduxStore```
- Extended Facade constructor signature

  Instead of creating a mount point manually and pass it to facade's constructor, you can now just pass the TyduxStore.
  Before:
  ```
  constructor(tydux: TyduxStore) {
    super(tydux.createRootMountPoint('name'), 'name', new Commands(), new State());
  }
  ```
  After:
    ```
    constructor(tydux: TyduxStore) {
      super(tydux, 'name', new Commands(), new State());
    }
    ```
  Facade will create a mount point for you with the given name (second parameter).

# Version 10.3.0

- added `destroyed` observable to facade

# Version 10.2.0

- Facades can now mount to possibly undefined mount points as long as they provide the initial state

# Version 10.1.0

- added TyduxStore#select()

# Version 10.0.2

- removed AngularJS 1.x integration

# Version 10.0.1

- added declaration source maps closes #16

# Version 10.0.0

- removed `ObservableSelection` due to this [TSLint rule](https://github.com/w11k/rx-utils#w11k-rxjs-subscribe-takeuntil)

# Version 9.3.1

- introduced CommandsInvoker (used internally and useful for testing)

# Version 9.3.0

**breaking change**

- renamed fassade to facade :-/

# Version 9.2.1

- selector for selectNonNil is now optional

# Version 9.2.0

- facades can now provide their initial state during the super call

# Version 9.1.2

- fixed IE bug regarding `toString`

# Version 9.0.1

- new version
- now based on Redux

# Version 8.3.2

- added es2015 modules to enable tree-shaking

# Version 8.3.1

- improved middleware logging

# Version 8.3.0

- added Store#destroy() and Store#ngOnDestroy()

# Version 8.2.0

- added supported for middleware
- BUGFIX: only use ES Proxys in development mode

# Version 8.1.3

- Requires TypeScript 2.9 or greater

# Version 8.1.2

- fixed bug: Angular integration: existing ngOnDestroy method was replaced and not preserved

# Version 8.1.0

- added `ObservableSelection.pipe()`
- improved DevTools support (jump to action)

# Version 8.0.2

- generate source maps for distribution build
- various internal implementation changes

# Version 8.0.0

- Requires RxJS >= 6
- Can be used with TypeScript <= 2.7 and >= 2.8 projects:
	- add a file e.g. `tydux.d.ts` to your project src folder and make sure that it gets included in the compilation process
	- add the line (change the path to `node_modules` according to your project):
		- TypeScript <= 2.7 projects: `/// <reference<EMAIL_ADDRESS>/>`
		- TypeScript >= 2.8 projects: `/// <reference<EMAIL_ADDRESS>/>`

# Version 7.0.0

- Removed StateObserver in favour of ObservableSelection. This API change makes it much easier for stores to return a selection.

# Version 6.0.3

- fixed devtools support

# Version 6.0.2

- fixed memory leak in View

# Version 6.0.0

- added View feature

# Forked Development: Version 5.x

- Version 5 will stay on TypeScript 2.7.x
- Removed View feature

# Version 5.1.0

- renamed `Mutators` to `Mutator`

# Version 5.0.1

- removed `createView` function in favour of `new View(...)`

# Version 5.0.0

- new feature: View
- removed: selectMany()

# Version 4.0.0-alpha

- alpha release: development version, changes discarded

# Version 3.0.0

- removed `UnboundedObservable`
- added `Store#unbound()`
- added `Store#bounded(operator)`
- added `selectMany()`

# Version 2.1.0

- fixed bug: JavaScript Proxy was used in prod mode
- store IDs must now be unique

# Version 2.0.7

- when `Store#select()` returns a plain object, values will only be emitted when the content of the returned object changed (shallow comparision)

# Version 2.0.6

- removed `UnboundedObservable.share()`
- added `UnboundedObservable.pipe()`

# Version 2.0.5

- added `selectMany` and `share()` for `UnboundedObservable`

# Version 2.0.4

- fixed RxJS import

# Version 2.0.3

- added `boundToComponent()` method to `UnboundedObservable`

# Version 2.0.1

- simplified store implementation
- print mutator run duration in dev tools

# Version 2.0.0

- **Breaking Change:** store.dispatch renamed to store.mutate
- Fixed several bugs involving instance variables
- DevTools: Better action name support for async methods
- Mutators must not return a Promise

# Version 1.3.2

- Fixed Bug in Store: Methods return value was ignored due to wrapMethods()

# Version 1.2.0

- select(...) now returns an UnboundedObservable

# Version 1.1.0

- Forbid asynchronous code in mutators
- store.dispatch is now protected (was public)

repository: mouradabs/Tydux

repo_name: mouradabs/Tydux


text:
# AutoSpacer - AladiX

> This is a small application in electron that calculates de distribution in a cinema according to pandemic capacity restrictions.

It has an interface that allows users to reserve seats. It also calculates the maximum number of people that are able to enter the cinema.

![Image](images/image1.png)

## Features

* Online Authentication
* Profile retrieval
* Database features

## Requirements

* Electron
* npm

## Running
1. Clone repository and open in shell
2. Install App
```sh
$ npm install
```
2. Start App
```sh
$ npm start
```

## Meta

* **Luis M.**           - [GitHub](https://github.com/lemontyc)
* **Ivan O.**           - [GitHub](https://github.com/scanf30)
* **Alejandro L.**      - [GitHub](https://github.com/alejandrolzvz)

Distributed under the MIT License. See ``LICENSE`` for more information.

This project was developed for the **MTY Hackathon 2020** .

gha_language: JavaScript


text:
[github-index-url]: https://github.com/mgthomas99/picoassert/blob/master/index.js
[github-license-url]: https://github.com/mgthomas99/picoassert/blob/master/LICENSE
[github-repository-url]: https://github.com/mgthomas99/picoassert
[github-license-shield-url]: https://img.shields.io/github/license/mgthomas99/picoassert.svg?style=flat-square
[github-size-shield-url]: https://img.shields.io/github/size/mgthomas99/picoassert/index.js.svg?style=flat-square
[npm-package-url]: https://www.npmjs.com/package/picoassert
[npm-downloads-shield-url]: https://img.shields.io/npm/dt/picoassert.svg?style=flat-square
[npm-version-shield-url]: https://img.shields.io/npm/v/picoassert.svg?style=flat-square

# picoassert

[![npm][npm-version-shield-url]][npm-package-url]
[![npm][npm-downloads-shield-url]][npm-package-url]
[![Github file size][github-size-shield-url]][github-index-url]
[![GitHub][github-license-shield-url]][github-license-url]

> Perhaps the smallest Javascript assertion module

`picoassert` is a 113-byte Javascript assertion module based on
[nanoassert](https://github.com/emilbayes/nanoassert).

## Usage

```js
var assert = require("picoassert")

assert.eq(a, b);  // Asserts `a` and `b` are equal.
assert.neq(a, b); // Asserts `a` and `b` are not equal.
assert.is(a);     // Asserts `a` is truthy.
```

You can also provide your own error message to be used when constructing
`Error`s when assertions fail. If no message is specified, a default message is
used.

```js
assert.eq(a, b, "Assertion failed because A is not equal to B!");
```

## Why

The `nanoassert` repository `README` describes the author's complaint about the
excessive size of the [`assert`](https://www.npmjs.com/package/assert) module,
the standard assertion library. However, even the `nanoassert` library was
unnecessarily large, which led to the creation of `picoassert`.

This library is also an open [codegolf](https://en.wikipedia.org/wiki/Code_golf)
challenge. Please feel free to submit pull requests if you're able to make the
code even shorter!

## Install, Build & Test

To install the package, use the standard NPM install command:

```sh
npm install picoassert
```

The package is hand-written, minified Javascript; therefore, no build process is
required, and you can directly edit and execute the source!

An NPM script has been created for simplicity when running tests, which can be
run from the command line as shown below:

```sh
npm test
```

picoassert uses the [Tape](https://www.npmjs.com/package/tape) library for
testing.

### Content Delivery Network (CDN)

The picoassert library can be imported via [unpkg](https://unpkg.com/) as shown
below:

```html
<script type="application/javascript">var module={};</script>
<script src="https://unpkg.com/picoassert/index.js"></script>
<script type="application/javascript">
  var assert = module.exports;
  // Library is imported as `assert`!
</script>
```

Be aware that picoassert is a CommonJS module and therefore uses
`module.exports`; before importing the script, you will need to define `module`
or use a CommonJS-compatible module loader.

## License

Please see the `LICENSE` file for license information.


text:
# extensions-hosting

Exposes Startup extensions to be used with generic host.

Also, it exposes task scheduling utilities based on cron expressions.

[![build-and-publish Workflow Status](https://github.com/ffernandolima/extensions-hosting/actions/workflows/build-and-publish.yml/badge.svg?branch=master)](https://github.com/ffernandolima/extensions-hosting/actions/workflows/build-and-publish.yml?branch=master)

 | Package | NuGet |
 | ------- | ----- |
 | Extensions.Hosting | [![Nuget](https://img.shields.io/badge/nuget-v2.3.0-blue) ![Nuget](https://img.shields.io/nuget/dt/Extensions.Hosting)](https://www.nuget.org/packages/Extensions.Hosting/2.3.0) |
 | Extensions.Hosting.Scheduling | [![Nuget](https://img.shields.io/badge/nuget-v2.3.0-blue) ![Nuget](https://img.shields.io/nuget/dt/Extensions.Hosting.Scheduling)](https://www.nuget.org/packages/Extensions.Hosting.Scheduling/2.3.0) |

## Installation

It is available on Nuget.

```
Install-Package Extensions.Hosting -Version 2.3.0
Install-Package Extensions.Hosting.Scheduling -Version 2.3.0
```

P.S.: There's no dependency between the packages. Which one has its own features.

## Usage

The following code demonstrates basic usage of Startup extensions.

```C#
public class Program
{
   public static void Main(string[] args) => CreateHostBuilder(args).Build().Run();

   public static IHostBuilder CreateHostBuilder(string[] args) =>
       Host.CreateDefaultBuilder(args)
           .ConfigureServices((hostContext, services) =>
           {
               services.UseStartup<Startup>(); // Extension used here
           });
}

// Startup class should inherit IStartup interface
public class Startup : IStartup
{
   public Startup(IConfiguration configuration) => Configuration = configuration;

   public IConfiguration Configuration { get; }

   public void ConfigureServices(IServiceCollection services)
   {
       if (services == null)
       {
           throw new ArgumentNullException(nameof(services));
       }

       // Register your services here
   }
}
```

The following code demonstrates basic usage of task scheduling.

```C#
// Define a task which inherits from IScheduledTask interface
public class FooTask : IScheduledTask
{
   public string Schedule { get; private set; }

   public FooTask(IConfiguration configuration)
   {
       if (configuration == null)
       {
           throw new ArgumentNullException(nameof(configuration));
       }

       var schedule = configuration["Scheduling:Tasks:FooTask:Schedule"];

       if (string.IsNullOrWhiteSpace(schedule))
       {
           throw new ArgumentException(nameof(schedule));
       }

       Schedule = schedule; // Set the cron expression
   }

   public async Task ExecuteAsync(CancellationToken cancellationToken)
   {
       // Write your logic here
   }
}

public class Startup : IStartup
{
   public Startup(IConfiguration configuration) => Configuration = configuration;

   public IConfiguration Configuration { get; }

   public void ConfigureServices(IServiceCollection services)
   {
       if (services == null)
       {
           throw new ArgumentNullException(nameof(services));
       }

       var delay = configuration?.GetValue<TimeSpan>("Scheduling:Delay");

       services.AddSingleton<IScheduledTask, FooTask>();
       services.AddScheduler((sender, args) => args.SetObserved(), delay);
   }
}
```

appsettings.json:
```JSON
"Scheduling": {
    "Delay": "00:00:30",
    "Tasks": {
      "FooTask": {
        "Schedule": "* * * * *"
      }
    }
  }
```

## Support / Contributing
If you want to help with the project, feel free to open pull requests and submit issues.

## Donate

If you would like to show your support for this project, then please feel free to buy me a coffee.

repository: ffernandolima/extensions-hosting

repo_name: ffernandolima/extensions-hosting


text:
Mini tetris game run on Unix terminal or command prompt Windows

### Prerequire

To compile on Linux, you need ncurses

For Ubuntu, Debian: sudo apt-get install libncurses5 libncurses5-dev

For CentOS, Fedora: sudo yum install ncurses-devel ncurses

### How to play

Command-Keys:

- WASD: movements
- Space: Rotate block

repository: anhtranbk/tetris

repo_name: anhtranbk/tetris


text:
Changelog
=========

### 5.0.0 2022-07-18

Major npmjs release containing the last lib updates and marking the repo as unmaintained and looking for maintainers.

### 4.8.0 2022-06-22
- update android lib from 5.9.1 to 6.2.2
- update ios lib from 3.9.0 to 4.1.5

### 4.7.2 2021-10-02
- update android lib from 5.8.6 to 5.9.1
- update ios lib from 3.6.5 to 3.9.0

### 4.7.1 2021-03-01
- update android lib from 5.6.5 to 5.8.6
- update ios lib from 3.4.9 to 3.6.5

### 4.7.0 2019-09-29
attempt to fix [issue #108](https://github.com/samzilverberg/cordova-mixpanel-plugin/issues/108) with building via xcode 11 by removing watchkit related files and references

### 4.6.3 2019-09-29
- readme linting + add some troublshooting info (thanks [Miguel Nunes Correia](https://github.com/sircon))
- raise and fix [issue #110](https://github.com/samzilverberg/cordova-mixpanel-plugin/issues/110): mixpanel.identify Runtime error when id is not a string (thanks [Alexey Bondarenko](https://github.com/alexeybondarenko))
- update android lib from 5.6.2 to 5.6.5
- update ios lib from 3.4.6 to 3.4.9

### 4.6.2 2019-06-05
- update android lib from 5.6.0 to 5.6.2
- update ios lib from 3.4.4 to 3.4.6

### 4.6.1 2019-04-03
4.6.0 and 4.5.3 were broken versions because of accidental commit of ref to .DS_store file from plugin.xml.
released 4.6.1 and 4.5.4 with the fix (removing the ref)

### 4.6.0 2019-03-30
 - update android lib from 5.4.5 to 5.6.0
   - push notifs: FCM now replaces GCM
     see: https://github.com/mixpanel/mixpanel-android/releases/tag/v5.5.0
 - update ios lib from 3.4.1 to 3.4.4
 - BREAKING CHANGE: removed the android only `initPushHandling` fn

### 4.5.3 2019-03-30
 - update android lib from 5.4.4 to 5.4.5
 - update ios lib from 3.3.7 to 3.4.1

### 4.5.2 2018-12-27
 - update android lib from 5.4.1 to 5.4.4
 - update ios lib from 3.3.3 to 3.3.7

### 4.5.1 2018-12-27
 - mixpanel.people.initPushHandling : android only (thanks [Todd Vrba](https://github.com/SpellChucker))

### 4.5.0 2018-08-25
 - mixpanel.people.append
 - mixpanel.people.union
 - update android lib from 5.4.0 to 5.4.1
 - update ios lib from 3.3.2 to 3.3.3

### 4.4.1 2018-05-29
 - update android lib from 5.2.4 to 5.4.0
 - update ios lib from 3.2.3 to 3.3.2

### 4.4.0 2018-05-28 (DEPRECATED)
- unpublished from npm due to bug

### 4.3.2 2018-05-29
- ios: support identify with usePeople flag
  - ty [Ödön Örzsik](https://github.com/orzsikodon) for [suggestion](https://github.com/samzilverberg/cordova-mixpanel-plugin/issues/89) and hotfix

### 4.3.1 2018-05-28 (DEPRECATED)
- unpublished from npm due to bug

### 4.3.0 2018-04-24
- play-services version can be pinned via variable when adding the plugin (thanks [akhatri](https://github.com/akhatri)).
  - example: cordova plugin add cordova-plugin-mixpanel --variable PLAY_SERVICES_VERSION="11.8.0"
  - when not specifying variable default is '+' (as it was before)

### 4.2.0 2018-01-28
- update android lib from 5.2.1 to 5.2.4
- `mixpanel.alias` will use `mixpanel.distinctId` if originalId is invalid
- `mixpanel.alias` can be called with just alias and callback functions
  - this variant of alias will call and use `mixpanel.distinctId` as the originalId

### 4.1.0 2017-12-09
- update android lib from 5.1.4 to 5.2.1
- update ios lib from 3.2.0 to 3.2.3
- small correction to README and to repo url (thanks [Jørgen Svennevik Notland](https://github.com/jQrgen) and [Bruno Freitas](https://github.com/brunosfreitas))

### 4.0.0 2017-09-15

major version upgrade from 3.x->4.x:
reverted usage of cocoapods for ios lib installation, mixpanel source is included in repo.

- update ios lib from 3.1.9 to 3.2.0
- mixpanel.unregisterSuperProperty
- mixpanel.getSuperProperties
- mixpanel.registerSuperPropertiesOnce

### 3.1.0 2017-07-25
- update android lib from 5.0.2 to 5.1.4
- update ios lib from 3.1.4 to 3.1.9
- remove the deprecated showSurvey fn
- add faq entry for pod problems (thanks [Daniel López](https://github.com/dlopezp))

### 3.0.1 2017-05-31
- update ios lib from 3.1.3 to 3.1.4
  - 3.1.4 is supposed to solve the C99 dialect problems by replacing any dialect related code with more "vanilla" code
- drop support for cordova version less than 5.x

### 3.0.0 2017-04-30

major version upgrade from 2.x->3.x: now using cocoapods for ios lib installation.

- update android lib from 4.9.8 to 5.0.2
- update ios lib from 3.0.6 to 3.1.3
  - use cocoapods to install the ios lib
- remove survey functionality as its been removed in the mixpanel libs
- specify engine requirements in package.json instead in plugin.xml

### 2.3.5 2017-04-30
- C99 dialect build probs in UIImage+MPAverageColor.m:
  manual code fix for it until next mixpanel-iphone version is released
- support for angulartics by setting __loaded after init (thanks [mgregier](https://github.com/mgregier))
- update android lib from 4.9.6 to 4.9.8

### 2.3.4 2017-02-27
- update android lib from 4.9.2 to 4.9.6
- mixpanel.people.deleteUser (thanks [Julien Roubieu](https://github.com/julienroubieu))
- browser platform: small improvement to error handling on MixpanelProxy.js (thanks [Damien Fa](https://github.com/damienfa))

### 2.3.3 2016-11-21
- deprecated mixpanel.people.identify
  - mixpanel.identify will already set the id for use in tracking events and people api

### 2.3.2 2016-11-19
- mixpanel.people.trackCharge (thanks [Emmanuel Prochasson](https://github.com/eprochasson) for providing the base)
- mixpanel.people.unset

### 2.3.1 2016-11-19
- republish because of accidental npmjs mistake

### 2.3.0 2016-11-19
- update android lib from 4.9.1 to 4.9.2
  - NOTICE: 4.9.2 requires Google Play Services > 7.5.0
- update ios lib from 3.0.0 to 3.0.6
  - ios 10 should now be supported in case anyone had problems with it

### 2.2.1 2016-08-09
- android play services dependency as wildcard version to avoid conflict with other plugins (thanks [ZiFFeL1992](https://github.com/ZiFFeL1992))

### 2.2.0 2016-07-31
- update ios lib from 2.9.1 to 3.0.0 (thanks [Timan Rebel](https://github.com/timanrebel))
- update android lib from 4.7.0 to 4.9.1 and use maven repo (thanks [Timan Rebel](https://github.com/timanrebel))
- add TimeEvent methods (thanks [Jon Smart](https://github.com/JonSmart))
- add typescript declarations file (thanks [Jon Smart](https://github.com/JonSmart))

### 2.1.0 2015-12-20
- fix for distinctId by damienfa
- browser platform supported (thanks [Damien Fa](https://github.com/damienfa))
- update ios lib from 2.7.2 to 2.9.1
- fix for flush timer not starting after init

### 2.0.1 2015-11-07
- same as 2.0.0, just bumped it because of npm publish problem

### 2.0.0 2015-11-07
- release on NPM to support cordova 5.x.x
  - install plugin via ``` cordova add cordova-plugin-mixpanel ```
- update android lib from 4.5.3 to 4.7.0 (thanks [Simon Arneson](https://github.com/scanniza))
- more mixpanel functionality (thanks [Justin Young](https://github.com/soupman99))
  - mixpanel api:
    - showSurvey (only iOS currently)
  - mixpanel people api:
    - increment
    - setOnce

### 1.3.1 2015-10-17
- fix registerPushToken functionality (thanks [Steven Feaster](https://github.com/sfeast))
  - use correct fn on android
  - fix data conversion of pushId on ios
  - rename it to setPushId to avoid confusion with 'registration' process

### 1.3.0 2015-09-24

- more mixpanel functionality (thanks [Josh Dover](https://github.com/joshdover))
  - mixpanel api:
    - distinctId
    - registerSuperProperties
  - mixpanel people api:
    - registerPushToken
- perform arguments checks in js instead in native code

### 1.2.1 2015-05-29

- plugin.xml - dont use use 'android-minSdkVersion' preference

### 1.2.0 2015-05-26

- plugin.xml - use 'android-minSdkVersion' smarter cordova preference instead of 'uses-sdk' (thanks [Florian Holzhauer](https://github.com/fh))
- min required cordova-cli is now 3.5.0, to support the smart preference mentioned above

### 1.1.0 2015-05-11

- basic mixpanel people api
  - identify
  - set

### 1.0.0 2015-04-19

- basic mixpanel api
  - alias
  - flush
  - identify
  - init
  - reset
  - track

repository: samzilverberg/cordova-mixpanel-plugin

gha_license_id: MIT

repo_name: samzilverberg/cordova-mixpanel-plugin


text:
---
title: "Erica Mahinay"
date: "2019-09-22"
description: Exploring CSS Grid, spring-based animations, and content management with Contenful on this Gatsby site to showcase the works of Erica Mahinay
---

## Erica Mahinay

<time datetime="2019-09-22">September 22, 2019</time>

With so many content management options these days, it's hard to know which platform to select. Gatsby's [content mesh architecture](https://www.gatsbyjs.org/blog/2018-10-04-journey-to-the-content-mesh/) and plugin ecosystem makes it seamless and enjoyable to work with a host of systems. One of the most popular is [Contentful](https://www.contentful.com/). With a nice UI for uploading and editing content, a great [source plugin](https://www.gatsbyjs.org/packages/gatsby-source-contentful/) to Gatsby, and a generous free entry package, Contenful fast became one of my favorite tools for content management. Alongside unique grid-based responsive designs and spring-based animations, the result is a sleek, modern-day portfolio for the LA-based artist, [Erica Mahinay](https://ericamahinay.studio/).

### CSS Grid Landing Page

[Jen Simmons](https://labs.jensimmons.com/) has one of my favorite personal sites out there. The gridded landing page that responsively generates new layouts is a true gem and I wanted to incorporate a similar feature on Erica's site.

#### Large screens

A rotated grid paired with a vertical text header in the grid provides a striking container to house the landing page elements.

![Landing page grid for large screens](./post-assets/erica-large-grid.png)

Grid for the landing page on larger screens

The JSX behind the grid is a container for the following four grid-items:

1. Exhibitions currently on view
2. Past exhibitions
3. Name
4. Contact information

**src/pages/index.js**

```js
const IndexPage = () => {
  // ... fetch Contentful data

  return (
    <div className="grid">
      <h1 className="name">Erica Mahinay</h1>
      <div className="exhibition-list">
         //... list of past exhibitions
      </div>
      <div className="onview-list">
         //... list of exhibitions on view
      </div>
      <div className="contact">
         //... contact information
      </div>
    </div>
  )
}
```

And the corresponding CSS to achieve the rotated grid:

```css
.grid {
  width: 66vw;
  margin: auto;
  transform: rotate(-45deg);
  display: grid;
  grid-template-columns: 1fr 0.75fr 1fr 1fr 0.5fr 1fr;
  grid-template-rows: auto 1fr auto auto 0.5fr;
}
```

Each of the direct children to `.grid` become grid-items and are positioned by axes indices using `grid-column` and `grid-row`.

The name header is placed near the middle of the 6-column grid with its text displayed vertically:

```css
.name {
  grid-column: 3 / 4;
  grid-row: 3 / 5;
  writing-mode: vertical-lr;
  justify-self: center;
}
```

The past exhibition list is flush with the leading two columns of the grid and claims all rows in those columns.

```css
.exhibition-list {
  grid-column: 1 / 3;
  grid-row: 1 / 5;
  align-self: center;
}
```

The grid's top right corner is reserved for exhibitions currently on view:

```css
.onview-list {
  grid-column: 4 / 7;
  grid-row: 2;
  align-self: end;
}
```

Finally, contact information is tucked in the lower right of the grid:

```css
.contact {
  grid-column: 4 / 7;
  grid-row: 5;
  align-self: end;
}
```

#### Small screens

For screens below 700px, the grid unrotates and morphs dimensions from [6 X 5] to [3 X 2] to more naturally align with vertical mobile viewports.

![Responsive grid on landing page](./post-assets/erica-responsive-grid.gif)

Changing grid dimensions for smaller devices

Then, each grid-item receives a new placement in the updated grid. The name and contact information are pinned to the right column with the exhibitions to the left column.

```css
.name {
  grid-column: 2;
  grid-row: 1 / 3;
  writing-mode: vertical-lr;
  justify-self: end;
  text-transform: uppercase;
}

.contact {
  grid-column: 1 / 3;
  grid-row: 3;
  justify-self: end;
  text-align: right;
  margin-right: 1rem;
}

.onview-list {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
}

.exhibition-list {
  grid-column: 1;
  grid-row: 2;
}
```

### Spring-based animations

I've been diving into [react-spring](https://www.react-spring.io/) during recent projects for creating realistic animations based on physics and the motion of springs. A custom hook `useSpring` is provided by the package to quickly configure animated values, where the animation can be controlled by state in the component. This technique is employed to toggle visibility of the mobile nav when the menu button is clicked.

The `useSpring` hook and the `animated` tag wrapper are first imported from `react-spring`. We then setup a slice of state called `isMenuOpen`, which is toggled by the corresponding setter function `setIsMenuOpen`, and initially set to `false`. The `animation` props are then created using `useSpring`, which are distributed among an HTML element via the `style` prop.

```js
import React, { useState } from 'react;
import { useSpring, animated } from 'react-spring';

const MobileNav = () => {

  // Track status of menu open/close for spring animation
  const [isMenuOpen, setIsMenuOpen] = useState(false);

  // Setup the zoom-in animation
  const animation = useSpring({
    transform: isMenuOpen
      ? `translate3d(0,0,0) scale(1)`
      : `translate3d(-100%,0,0) scale(0.6)`,
  })

  return (
    <div>
      <nav style={animation}>
        // ...Nav items
      </nav>
      <button onClick={() => setIsMenuOpen(!isMenuOpen)}>
    </div>
  );

}
```

When `isMenuOpen` turns `true`, the nav element translates horizontally and scales up into the full viewport.

![Spring-based nav animation](./post-assets/erica-nav-spring-demo.gif)

Smoothly animating nav visibility

### Contentful CMS

#### Configuring Contentful for Gatsby

Gatsby sites can seamlessly work with Contenful through its [source plugin](https://www.gatsbyjs.org/packages/gatsby-source-contentful/). After installing it:

`npm i gatsby-source-contentful`,

it can be configured in the `gatsby-config.js` file.

```js
require('dotenv').config()

module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-contentful`,
      options: {
        spaceId: process.env.CONTENTFUL_SPACE_ID,
        accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
        downloadLocal: true,
      },
    }
  ]
}
```

`CONTENTFUL_SPACE_ID` and `CONTENTFUL_ACCESS_TOKEN` values are provided by Contentful after you initialize a new space on its platform. I also included the `downloadLocal` property so that images would be locally available and sourced into Gatsby images within the site's image detail modal.

#### Fetching Contentful Data

6 content models are built for the site:

1. Blog Post
2. CV
3. Exhibition
4. Image
5. Video
6. Press

Each of them structures how user-input is collected and validated. Contentful's UI is nice to engage with and allows for highly customized formatting. Each model is made available as a node in Gatsby's GraphQL interface.

#### Static Queries

Gatsby's `useStaticQuery` hook is used on GraphQL queries that do not require input variables, such as grabbing all of the press articles to display on the press page.

**src/pages/press**

```js
import React from 'react'
import { graphql, useStaticQuery } from 'gatsby'

const Press = () = {
  const data = useStaticQuery(graphql`
    {
      allContentfulPress(sort: { fields: order, order: DESC }) {
        nodes {
          id
          date
          title
          attachment {
            file {
              url
            }
          }
          link
        }
      }
    }
  `)

  const pressItems = data.allContentfulPress.nodes

  return (
    // ... render press items
  )
}
```

#### Dynamic queries

Exhibition pages are dynamically created in `gatsby-node.js` by sourcing all exhibition entires in Contentful. The page component is passed an `exhibitionTitle` value in the page's context. This string is then used to source all the images (stored in the Image model) associated with that exhibition.

**src/templates/exhibition-template.js**

```js
import React from "react"
import { graphql } from "gatsby"
import Img from "gatsby-image"

export const query = graphql`
  query($exhibitionTitle: String!) {
    allContentfulImage(
      filter: { exhibition: { eq: $exhibitionTitle } }
      sort: { fields: order, order: ASC }
    ) {
      nodes {
        dimensions
        id
        title
        year
        imageFile {
          fluid(maxWidth: 600) {
            ...GatsbyContentfulFluid_withWebp
          }
        }
        materials
      }
    }
  }
`

return (
  // ... exhibition information and images
)
```

Contentful makes available an `imageFile` property that syncs with Gatby's image component for sleek, blurred-up image rendering. When a `query` variable is exported from a Gatsby page, it makes available a `data` prop to that component containing the GraphQL query result. For instance, to render Gatsby Images beneath the query noted above, it would take the form:

```javascript
const images = props.data.allContentfulImage.nodes

const renderImages = images.map(image => (
  <Img key={image.id} fluid={image.imageFile.fluid} />
)

return (
  // ...exhibition information
  <div>{renderImages()}</div>
)
```

Overall, the integration of Contenful data with Gatsby's GraphQL interface is a winning combination for speed, security, and developer happiness 😄.

repository: neil-berg/portfolio

repo_name: neil-berg/portfolio


text:
# MarketClient

A simple proof of concept, that shows how we could combine IPFS and Ethereum in an Angular2 application.

What this application does:
* Using the ipfs-api library, it connects to a separately running IPFS daemon
* Using the web3.js library, it connects to a locally running ethereum client (e.g. the geth client)
* You can enter some data and add them to IPFS

## Set up your environment
1. Download and install the node package manager (npm)
2. Download and install an ethereum client (e.g. geth)
3. Download and install IPFS
4. Install the angular CLI by `npm install -g angular-cli`

## Useful resources

* [IPFS API reference](http://docs.ipfs.apiary.io/)
* [IPFS Command reference](https://ipfs.io/docs/commands/)

### Angular2 CLI
The Angular2 CLI was used to create some of the files of this project. You can of course create all the modules, components and the overall structure by hand. But the CLI offers a simple and quick possibility to do all of this automatic.

E.g. if you want to generate a new empty component, you can do it by running `ng g component my-new-component`.

To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

## Getting started
### 1. Running the IPFS daemon with the right port
To interact with the IPFS API, you need to have a local daemon running. It needs to be open on the right port. 5001 is the default, and is used in the examples below, but it can be set to whatever you need.
Furthermore it is necessary to have to add the domain of our application to the IPFS whitelist, so we don't run into a CORS (Cross Origin Resource Sharing) error.

```
# Run the daemon
$ ipfs daemon

# In another terminal do the following:
# Show the ipfs config API port to check it is correct
$ ipfs config Addresses.API
/ip4/<IP_ADDRESS>/tcp/5001
# Set it if it does not match the above output
$ ipfs config Addresses.API /ip4/<IP_ADDRESS>/tcp/5001

# Put our domain to the whitelist of the daemon to avoid CORS failures
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\"http://localhost:4200\"]"
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials "[\"true\"]"
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"POST\", \"GET\"]"

# Restart the daemon after changing the config
# Run the daemon
$ ipfs daemon
```

### 2. Start ethereum client
To talk to an ethereum node from inside a JavaScript application we use the web3.js library, which gives an convenient
interface for the RPC methods. See the JavaScript API for more.

You need to start your client with the --rpc flag, in order to connect to it from the javascript application. Because we are accessing the RPC from a browser, CORS will need to be enabled with the appropriate domain set. Otherwise, JavaScript calls are limit by the same-origin policy and requests will fail:
`geth --rpc --rpccorsdomain "http://localhost:4200"`

If you don't want to use the default port (8545), you can change the default HTTP-RPC port with:
`geth --rpc --rpccorsdomain "http://localhost:4200" --rpcport <portnumber>`

### 3. Run the angular app
First thing you need to do is downloading all the dependencies. You do it by navigating to the project directory and running `npm install` (Node package manager must be installed)

Then you can run a dev server by typing `ng serve`. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

The application automatically starts an IPFS deamon from the Browser and shows you some details for it. Now you can also connect the angular app to the running ethereum client on your computer by providing the HTTP-RPC host address (default: http:localhost:8545/ ).

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

To run the app on another host address than the default one (localhost:4200), run `ng serve --host <IP_ADDRESS> --port 4200`

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Deploying to Github Pages

Run `ng github-pages:deploy` to deploy to Github Pages.

repository: markusklems/desema

repo_name: markusklems/desema


text:
---
author: Alexis Lebis
---
# Component Rendering
There is three things to figure out for rendering a component :
* Where this component will be placed on the page and its objectif
* What are the DOM command that can be used within the template
* How to setup the reactivity of your component, so that it becomes dynamic

{% hint style="info" %}
In this section we do not focus on binding data yet. Check the [property section](property.md) for this kind of information.
{% endhint %}

## Binding
Binding consists of linking data in the `<script>` section of your component with the `<template>` section of the same component. In Vue.js the simpliest way to bind data is to use the `{{ Mustache }}` tag (two `{`, your data, then two `}`). While the component is rendered, the tag will be replaced with the content of the data used within the mustache.

```html
<template>
    {{ user.name }} <!--will print the attribute of the variable user -->
</template>
```

Mustache can handle complex JavaScript operation too
```html
<template>
    {{ user.getLevel() + user.increaseXP()) }}
</template>
```
{% hint style="warning" %}
Everything in the mustache tag will be interpreted! You cannot put html elements in there.
{% endhint %}

### Binding directives
Nonetheless, mustache tag has some limitation, especially within the HTML attributes since they cannot be used. For example, **you can't** write `<div id="{{myDynamicId}}">`: this will throw an error. To circumvent this issue, Vue.js introduces directives which are special-interpreted HTML attributes.

The most important one is the `v-bind` directive. This directive allows to bind a **standard** HTML attribute element to a **custom data**. For example, you can bind your data with the `id` of an element using the `v-bind`directive.

```html
<template>
    <div v-bind:id="myDynamicId"></div>
    <a v-bind:href="myDynaLink">linkmesenpai</a><!--or any other html attribute!-->
</template>
```

There also exists dynamic binding, which allows you to use varibale to determine which HTML property you want to bind your data with. Check the documentation if your are interested.

Two way data binding allows a child component to update its direct parent. It is mostly used for forms. Check [here](https://vuejs.org/v2/guide/forms.html) for more information.

## Template syntax
We will see in this section some handful syntaxex to define how your component should render according to its state (its data).

### Conditional rendering
In your component template, you will often face the necessity to check if a variable exists in order to display specific information. For instance, you want to display user's information only if he/she is logged in your application, otherwise you don't have access to this information.

To do that, Vue.js introduce the `v-if` directive. It is used to conditionally render a block: the block will be rendered only if the expression value is computed to `true`. You also have the `v-else-if` and `v-else` directive, obviously.

```html
<template>
    <p v-if="user">Hello {{ user.name }}</p> <!--if the user exists, then we have its name-->
    <p v-else> Hey! You! Log you, Yeah! You!</p>
</template>
```

{% hint style="danger" %}
A directive **has to be attached** to **only one** element. If you want to toggle more than one HTML element with you directive, you must use it on a `<template>` element, which serves as an invisible wrapper.
```html
<template v-if="ok">
  <h1>Title</h1>
  <p>Paragraph 1</p>
  <p>Paragraph 2</p>
</template>
```
{% endhint %}

{% hint style="info" %}
There is also the `v-show` directive used to conditionnaly render a block. The cost of the rendering operations is not the same. `v-if` always destroy its content if the condition is false, while `v-show` relies on CSS property to hide the content thus don't have to recreate the all content if the variable becomes true again. If you have costly drawing often toggling, maybe `v-show` can be better.
{% endhint %}

### Loop/list rendering
Another common needs is to dynamicaly render list of elements in a page. Vue.js introduces the `v-for` directive for addressing this need. It uses a special syntax `item in items` (if `items` is the array, `item` is an alias for the array element: it can be anything else). You can also retrieve the key/index of the element iterated with the special syntax `(item, index) in items`.

You can use `v-for` to render a list based on an array.
```html
<ul>
    <li v-for="myItem in items"> <!-- items: [{ message: Foo}, {message: Bar}]-->
        {{ myItem.message }}
    </li>
</ul>
```
Here, a first `<li>` element will be rendered with the Foo message, and the second with the Bar message.

It is also possible to iterate over an object's properties with the same directive.
```html
<ul id="v-for-object">
  <li v-for="(prop, key) in myobject"> <!-- myObject { name: "Soen", level: "3Dan", xp: 150,}-->
    {{key}} is: {{ prop }}
  </li>
</ul>
```
Here, the first `<li>` will display Name is: Soen, and so on.

{% hint style="info" %}
Same as other directive, if you want to render several elements in the `v-for` directive, you must use it on a `<template>`.
{% endhint %}

Another important things for the `v-for` directive is about maintaining the state of your list up to date. Whenever possible, it is higly recommended by Vue.js assign a unique `key` to the alias element created (here `item` and `prop`) when possible (the value **must** be numeric or string). To do so:
```html
<li v-for="item in items" v-bind:key="item.id"> <!--we know that .id is unique across all the element of your array, we can use it as a key -->
```

## Vue.js reactivity
When a Vue.js instance is created, it adds all the properties found in its `data` object to the reactivity system of the framework. When values of those properties change, the view will automatically “react”, updating itself to match the new values. This is a **powerful feature** that you should intensively use (it is somewhat a reimplementation of the observer pattern).

Each component has a `data` object. For every component but the main component `Vue.vue`, data **must be** a function, otherwise, the data will be shared accross the difference instances of the same component.

In the `<script>` element of your component, you should have:
```js
data(){ // the data, declared as function
    return{ // we return all the properties that should be react on.
      name: "Yo!",
      value: 15,
    }
  },
```

Then, during using app, if you change the value of `name`, this change will reflect on the template of the component.

## Instance Lifecycle Hooks
Lifecycle hooks are special functions which allow user to perform specifics operations at certain moment of the creation and the rendering of a component. For example, just before your component goes `mounted` to the page, you can modify the component's data.

```js
data(){
    return{
        value : -1;
    }
}

mounted: function(){
    console.log("Component mounted!");
    value = DEFAULT_MOUNT_VALUE;
}
```

Below a diagram of the lifecycle of a component and the associated hooks.

![Lifecycle of a component and associated hooks, from the [Vue.js documentation](https://vuejs.org/v2/guide/instance.html)](resources/lifecycle.png)

repository: AbdouTanta/uv-cdaw

branch_name: refs/heads/main

repo_name: AbdouTanta/uv-cdaw


text:
---
title: Hello World
layout: default
topic: Getting started
order: 3
---

## Hello World

  - [Introduction](#introduction)
  - [Download and unzip](#download)
  - [Create a user](#createuser)
  - [Start the platform](#startplatform)
  - [Set up a runtime](#setupruntime)
  - [Start the runtime](#startruntime)
  - [Investigate the output](#investigateoutput)

### Introduction

This is a complete example how to start the platform, set up a runtime, start it, and let it write text to a file.

  Warning
  NOTE: This tutorial does not deal with Kafka, please look here for a tutorial that does.

We assume that you have downloaded and extracted the Coral platform on your machine, and that Cassandra is running. In this tutorial, we assume that you use the latest version of the Coral platform. We will also assume that you use `curl` to send commands to Coral. As stated in the section [Prerequisites](GettingStarted-Prerequisites.html), however, you can use any HTTP client you want.

The following headers should be used to access the API:

header | value
---: | :---
Content-Type | application-json
Accept | application-json
Authorization | Basic YWRtaW46cGFzc3dvcmQ=

Where the Authorization header contains your encrypted user name and password. If you use `curl`, you can issue the command in a terminal as follows:

{% highlight bash %}
curl -H "Content-Type: application/json" \
	-H "Accept: application/json" \
	--user <username>:<password> \
	--request GET \
	http://<IP_ADDRESS>:8000/api/runtimes
{% endhighlight %}

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

### Download and unzip

[Download](GettingStarted-Download.html) the .tar.gz file and issue the following command:

{% highlight bash %}
tar -xzvf coral-runtime-0.1.1.tar.gz
{% endhighlight %}

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

### Create a user

First, a user needs to be created. To do this, enter the following command, where the values that should be filled in are described in the table below.

  Note
  NOTE: In this tutorial, we assume that you have a Cassandra instance running at <IP_ADDRESS>:9042. Change this to the IP address and port on which you have a Cassandra instance running.

{% highlight bash %}
java -cp "coral-runtime-0.0.131.jar" io.coral.api.Boot \
	user add -ccp "<IP_ADDRESS>" \
	-cp 9042 -k "coral" -n "neo" \
	-f "Thomas Anderson" -e<EMAIL_ADDRESS>\
	-m "555-1234" -d "Meta Cortex programming division"
{% endhighlight %}

The program asks you to enter a password for the user and asks you to confirm the password. We will use the password "thematrix". If successful, a user with the following properties is now inserted into the database:

short | long | property | value
---: | ---: | ---: | :---
n | uniquename | Unique name | neo
f | fullname | Full name | Thomas Anderson
e | email | E-mail |<EMAIL_ADDRESS>m | mobile | Mobile phone | 555-1234
d | department | Department | Meta Cortex programming division

You could also directly insert the user into the database, but the disadvantage of this approach is that you need to generate a UUID yourself and that you need to hash the password of the user yourself. This is not recommended, it is probably easier to use this program.

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

### Start the platform

There are three different ways to set parameters for the Coral platform:

1. On the command line. These options override any other settings.
2. By specifying the location of a configuration file on the command line.
3. In the application.conf file in the jar of Coral. These settings are used as defaults if not overriden.

In this tutorial, we will only use the first option.

To start the platform, enter the following command:

{% highlight bash %}
java -cp "coral-runtime-0.0.131.jar" \
    io.coral.api.Boot start \
	-ai "<IP_ADDRESS>" -p 8000 -ah "<IP_ADDRESS>" \
	-ap 2551 -am "coral" -ccp "<IP_ADDRESS>" \
	-cp 9042 -k "coral" -nc -ll INFO
{% endhighlight %}

These options are explained in the table below:

short | long name | explanation
---: | :--- | :--- | :---
ai | apiinterface | Incoming HTTP requests on this interface are accepted.
p | apiport | HTTP traffic on this port is accepted.
ah | akkahostname | This is the interface that Akka binds to.
ap | akkaport | This is the port that Akka binds to.
am | authenticationmode | Sets the authentication mode.
ccp | contactpoints | The Cassandra node(s) that Coral will connect with.
cp | cassandraport | The port on which a connection with Cassandra will be made.
k | keyspace | The name of the Cassandra keyspace that will be used.
nc | nocluster | Tells Coral that this node will not be connected to a cluster.
ll | loglevel | Sets the log level.

Coral will print debug messages to the console, stating that it is now "Bound to /<IP_ADDRESS>:8000".
This means that the Coral platform can now be approached using the HTTP interface on "http://<IP_ADDRESS>:8000".

To test whether this is actually working, issue the following command:

{% highlight bash %}
curl -H "Content-Type: application/json" \
	-H "Accept: application/json" \
	--request GET \
	--user neo:thematrix \
	http://<IP_ADDRESS>:8000/api/runtimes
{% endhighlight %}

The platform will respond with

{% highlight json %}
[]
{% endhighlight %}

This is a JSON array showing the runtimes currently running on the platform. As there are no runtimes on the platform yet, it returns an empty array.

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

### Set up a runtime

We will set up a runtime with a [generator actor]() and a [log actor]() that writes the generated data to file. The definition of the runtime is as follows:

{% highlight json %}
{
  "name": "runtime1",
  "owner": "neo",
    "actors": [{
      "name": "generator1",
      "type": "generator",
      "params": {
        "format": {
          "field1": "Hello, world!"
        }, "timer": {
          "rate": 10
        }
      }
    }, {
      "name": "log1",
      "type": "log",
      "params": {
        "file": "/tmp/runtime1.log"
      }
    }], "links": [
      { "from": "generator1", "to": "log1" }
    ]
}
{% endhighlight %}

This runtime generates the text "Hello, world!" 10 times per second and writes this text to the file "/tmp/runtime1.log" until it is stopped. You can change the location of the text file, but make sure you check the output in the correct file.

To create the runtime, send the following command:

{% highlight bash %}
curl -H "Content-Type: application/json"     \
	-H "Accept: application/json"        \
	--user neo:thematrix                 \
	--request POST                       \
	--data '{ "name": "runtime1", "owner": "neo", "actors": [{ "name": "generator1", "type": "generator", "params": { "format": { "field1": "Hello, world!" }, "timer": { "rate": 10 }}}, { "name": "log1", "type": "log", "params": { "file": "/tmp/runtime1.log" }}], "links": [ { "from": "generator1", "to": "log1" }]}' \
http://<IP_ADDRESS>:8000/api/runtimes
{% endhighlight %}

The platform responds by returning the following information:

{% highlight json %}
{
  "success": true,
  "created": "2015-12-25T12:06:45.731",
  "id": "20acd9ca-2532-433d-9be2-83608f7f2686",
  "definition": {
    "name": "runtime1",
    "owner": "fb7ee9d5-2ee1-4c63-9a95-2edb7f4f7c04",
    "actors": [{
      "name": "generator1",
      "type": "generator",
      "params": {
        "format": {
          "field1": "Hello, world!"
        }, "timer": {
          "rate": 10
        }
      }
    }, {
      "name": "log1",
      "type": "log",
        "params": {
          "file": "/tmp/runtime1.log"
        }
      }
    ], "links": [{
      "from": "generator1", "to": "log1"
    }]
  }
}
{% endhighlight %}

The UUID's and the created time in your response may vary from the ones shown here.
The runtime has now been created.

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

### Start the runtime

The runtime is now created but is not started yet. To start the runtime, issue a PATCH commmand as follows:

{% highlight bash %}
curl -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --user neo:thematrix \
    --request PATCH \
    --data '{ "status": "start" }' \
    http://<IP_ADDRESS>:8000/api/runtimes/runtime1
{% endhighlight %}

The platform responds with:

{% highlight json %}
{
    "action": "Start runtime",
    "name": "runtime1",
    "owner": "neo",
    "success": true,
    "time": "2015-12-29T16:21:58.752"
}
{% endhighlight %}

The start time in your response may vary from the one shown here. The runtime is now started and will generate a "Hello, World!" every second, and it will write these messages to "/tmp/runtime1.log".

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

### Investigate the output

To see the output of the platform, issue the following command:

{% highlight bash %}
tail -f /tmp/runtime1.log
{% endhighlight %}

If everything was set up right, this will show the following output, one new line per second:

{% highlight bash %}
{ "field1": "Hello, World!" }
{ "field1": "Hello, World!" }
{ "field1": "Hello, World!" }
{ "field1": "Hello, World!" }
{ "field1": "Hello, World!" }
{ "field1": "Hello, World!" }
...
{% endhighlight %}

There we have it! The output of our very first Coral pipeline.

repository: adedayoominiyi/coral

repo_name: adedayoominiyi/coral


text:
# IO.Swagger.Model.CreatePatientProblemResponse
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Problemid** | **int?** | If successful, the athena ID of the newly created problem | [optional]
**Success** | **bool?** | Whether the operation was successful or not. |
**Errormessage** | **string** | If the operation failed, this will contain any error messages. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: jacrys/athenasharp

gha_language: C#

repo_name: jacrys/athenasharp


text:
# LAB  19

## Project Name Lab 19 Logger

### Author: Student/Group Name: Ed

### Links and Resources
* [submission PR](https://github.com/EdDearment-401-advanced-javascript/lab19Logger/pull/1)
* [travis](https://travis-ci.com/EdDearment-401-advanced-javascript/lab19Logger)

### Setup

#### Running the app
* `npm start`
*You will also need the three other files
[server](https://github.com/EdDearment-401-advanced-javascript/lab19Server)
[File](https://github.com/EdDearment-401-advanced-javascript/lab19file)
[API](https://github.com/EdDearment-401-advanced-javascript/lab19API)
#### Tests
* How do you run tests?
npm run test

#### UML
![](https://drive.google.com/file/d/1Cd5tubn-61h489acmTG6qLEm3BSiZsdD/view?usp=sharing)


text:
# Haskell and SML Implementations of the languages from EOPL

```haskell
Welcome to the LETREC interpreter. Control-d to exit.
LETREC> letrec fact(n) = if zero?(n) then 1 else *(n, (fact -(n,1))) in (fact 5)
120
```

This project aims to implement the languages found in the textbook
[Essentials of Programming
Languages](https://mitpress.mit.edu/books/essentials-programming-languages),
in Haskell.

## Why?
The textbook implements the languages using Scheme, which is indeed a
very powerful functional programming language.  What about a Haskell
version?  This repository explores that, an intellectual exercise in
implementing various languages, which will later include ideas such as
such as mutable state, exceptions, then object orientation and a
module system, as EOPL does.

## Implementation
### Parser
The parser is implemented with monadic parser combinators.  This is
written from scratch in Haskell.  Expressions are represented as
inductive data types.  Since Haskell is pure, exceptions are
implemented with an `Exceptional` monad.

### Interpreter
The interpreter is very simple.  In its current form it is an
environment-passing interpreter, taking an expression, environment and
returning a `Result Val`, where `Result` is an alias for `Exceptional
Exception`, where `Exceptional` is a type constructor of kind `* ->
*`.  This allows us to still signal errors during evaluation.

## How to use
### Haskell LETREC REPL
Run `make` to build the Haskell REPL for the language `EXPLICIT-REFS`.
The Standard ML reference implementations can be run with SML/NJ, by
typing `use "ref.sml"` into the SML prompt.

### Standard ML Functions
The most interesting function is probably `repf`, which accepts a
filename, parses it into the AST, runs `eval` over it and then uses
the pretty printer to display the result.  `runfile` reads the
filename, executes it but doesn't convert the final value into a
pretty printed version, which can be useful for debugging purposes.
`parse_tree` accepts a filename and shows the parse tree for that
file.  Due to the way the grammar of the language is specified, you
will find that adding extra parens around expressions can dramatically
change its semantics.  `parse_tree` lets you see those invisible empty
string variable names that may pop up, for instance.

## Program example (prime numbers with lazy streams)
```text
[ Comments are shown with square brackets (which cannot be nested) ]

letrec
streamCar(s)  = car(s)
[ We don't have thunks so pass a dummy value ]
streamCdr(s)  = (cdr(s) 44)
take(n)       = proc(s)
                  if
                    zero?(n)
                  then
                    emptylist
                  else
                    cons((streamCar s),
                         ((take -(n,1)) (streamCdr s)))
[ Some examples of stream operations. ]
repeat(n)     = cons_stream(n, (repeat n))
addStreams(a) = proc(b) cons_stream(+(car(a),car(b)),
                                    ((addStreams (streamCdr a)) (streamCdr b)))
[ Modular arithmetic ]
mod(x) =
  proc(y)
    let q = /(x,y) in
      let a = *(y, q) in
        -(x, a)

[ Logical not ]
not(b) = if b then false else true

[ Is n not divisible by b? ]
ndividesq(d) = proc(n) (not zero?(((mod n) d)))
filterStream(f) = proc(s)
                    if
                      (f car(s))
                    then
                      cons_stream(car(s),
                                  ((filterStream f) (streamCdr s)))
                    else
                      ((filterStream f) (streamCdr s))

[ The Sieve of Eratosthenes ]
sieve(s) = cons_stream(car(s),
                       (sieve ((filterStream (ndividesq car(s)))
                                             (streamCdr s))))

[ Generate integers starting from a number ]
integersFrom(z) = cons_stream(z, (integersFrom +(z,1)))
in

[ Get the first twenty prime numbers ]
((take 20) (sieve (integersFrom 2)))
```

## Usage example
### Standard ML
```sml
- parse_tree "factorial.prog";
val it =
  Letrec
    (["fact"],["n"],
     [If
        (Zerop (Var "n"),Const 1,
         Mult (Var "n",Call (Var "fact",Sub (Var "n",Const 1))))],
     Call (Var "fact",Const 5)) : Expr
- runfile "factorial.prog";
val it = Num 120 : Val
- repf "streams.prog";
Result of evaluation: (2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71)
val it = () : unit
```

repository: siraben/eopl

repo_name: siraben/eopl


text:
---
layout: post
title: Nachopia
---

Nacholaatikko!

Ingredients
---------------

- Onion
- Garlic
- Tomatoes
- Olive oil
- Thai coconut curry powder
- Cilantro
- Balsamico
- Sambal
- Salt'n'Peppa
- Lemon peppa
- Chili flakes
- Mushroom
- Corn
- Green olives
- Cumin
- Hungarian paprika powder
- TexMex Cheese mix
- Blue Corn Nacho chips

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

## Tomato sauce

Saute two cloves of garlic and a medium onion on olive oil until nice. When its nice add chopped tomatoes.
Season with salt, pepper, pepperoncino and thai coconut curry powder. Cook it until its cooked.
Blend it. Season with balsamico, sambal, lemon pepper and cilantro.

## Cheese sauce

Saute the mushrooms and when its nice add canned corn and green olives. Season with cumin powder, Hungarian paprika powder,
and pepper. Add the bag of TexMex Cheese mix and mix it in until it becomes a goo.

## Nacho

Layer nacho --> cheese sauce --> ... --> nacho --> cheese sauce on top of each other in a glass bowl. Top it off with a thin
layer of tomato sauce. Oven/Microwave it until its nice. We just ate it out of the ball and keep lathering it with the Tomatoe sauce.
We suggest a Caipiroska with it. Enjoy!

repository: kadarakos/lakora

repo_name: kadarakos/lakora


text:
# thoth-duplicacy

## About

This container installs both [duplicacy](https://github.com/gilbertchen/duplicacy) and [duplicacy-util](https://github.com/jeffaco/duplicacy-util) on top of debian buster-slim.

## Motivation

I wanted to backup up my NAS and ARM cluster to B2 because:

* CrashPlan for home is dead
* I don't want to pay per-machine for backups, I'd rather just pay for the storage
* B2 is super cheap compared to the other options I looked at

## Usage

I've tried to make this image as easy to use as possible. It expects to find the directory you want to back up mounted to the container as `/data`, and that there is a `.duplicacy` directory with proper settings at the root level of the directory.

### Building the image

Change `CONTAINER_NAME` in the included `Rakefile` and run `rake build_container` to build an architecture-specific container yourself. If you want to use the experimental buildx support in Docker to generate a multi-architecture build, run `rake buildx` instead.

I've had issues with getting my multi-architecture builds to work on ARM though, so I publish separate images for Intel and ARM7 on docker hub as `unixorn/thoth-duplicacy:armv7l` and `unixorn/thoth-duplicacy:x86_64`.

### Using with docker-compose

If you just want to run it with `docker`, you can run it with `docker-compose`. There are a few environment variables that the included `backup-cronjob` script looks for so it knows how many threads to run and where to write the backups.

`BACKUP_LOCATION=/path/to/somewhere docker-compose run thoth-duplicacy backup-cronjob`

### Using inside Kubernetes

I have an ARM cluster running k3s on some ODROID HC2s and Raspberry Pis. I run moosefs on the cluster as a distributed file system, and wanted to back it up in as simple a way as possible.

By running the backup as a kubernetes cron job, I don't have to maintain a crontab on any of the cluster nodes, I created a `cronjob-backup-stuff.yml` in my cluster's configuration git repo, and kubernetes will ensure that the backups run on the least-loaded node.

#### Backing up directories

Here's a sample job that backs up one of my samba volumes. Note that I've created a `backups` namespace in my cluster to keep things tidy - if you want to pollute your default namespace instead, delete the namespace entry in the metadata section.

```
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: backup-exampledir
  namespace: backups
spec:
  schedule: "35 */2 * * *"
  jobTemplate:
    spec:
      # Ensure only one copy of the backup is running, even if it runs
      # so long that it is still running when the next cron slot comes up
      concurrencyPolicy: Forbid
      template:
        spec:
          containers:
          - name: backup-exampledir
            # I'm running this on the odroids in my cluster, so I'm specifying
            # the ARM7 build
            image: unixorn/thoth-duplicacy:arm7l
            # Use the x86_64 tag if you're on Intel
            # image: unixorn/thoth-duplicacy:x86_64
            args:
            - /bin/sh
            - -c
            - /usr/local/bin/backup-cronjob

            volumeMounts:
              - name: data-volume
                mountPath: /data/

            env:
                # I want to restrict the number of threads used for uploads
                # so that duplicacy doesn't consume all my upload bandwidth.
                # I don't care if backups are slow.
              - name: DUPLICACY_BACKUP_THEAD_COUNT
                value: "3"
                # backup-cronjob needs to know what defined storage to back up
                # files to.
              - name: B2_STORAGE_NAME
                value: "b2"

          restartPolicy: OnFailure

          # Keep it running on a chunkserver so that at least part of the
          # I/O is to local disk instead of across the network. Remove if
          # you don't care what node backups happen on.
          nodeSelector:
            odroid: "true"

          volumes:
            - name: data-volume
              hostPath:
                # This will be remapped to /data which is where duplicacy
                # expects to find the data it is backing up, and the .duplicacy
                # directory with its settings.
                path: /dfs/volumes/exampledir
                # this field is optional
                type: Directory

```

#### Pruning snapshots

We don't want to keep snapshots forever. Here's a Kubernetes cronjob to clean them up.

```
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: purge-stale-duplicacy-snapshots
  namespace: backups
spec:
  schedule: "48 */3 * * *"
  jobTemplate:
    spec:
      concurrencyPolicy: Forbid
      template:
        spec:
          containers:
          - name: purge-stale-duplicacy-snapshots
            # I'm running this on the odroids in my cluster, so I'm specifying
            # the ARM7 build
            image: unixorn/thoth-duplicacy:arm7l
            # Use the x86_64 tag if you're on Intel
            # image: unixorn/thoth-duplicacy:x86_64

            # Make sure we run inside /data so that duplicacy can find
            # the configuration directory.
            workingDir: /data

            # Remember that the -keep arguments must be listed from longest
            # time frame to shortest, otherwise the disordered ones will be
            # ignored, which could mean deleting snapshots you want to keep.
            #
            # I'm specifying to keep no snapshots more than 365 days old, keep
            # a single snapshot every 30 days for snapshots older than 90 days,
            # a single snapshot a week for snapshots older than 30 days, and
            # finally keep only a single snapshot per day for snapshots
            # older than 2 days.
            #
            # Also note that the duplicacy verb has to come before any of the
            # settings command line options.
            args:
            - duplicacy
            - prune
            - -storage
            - b2
            - -all
            - -keep 0:365
            - -keep 30:90
            - -keep 7:30
            - -keep 1:2
            - -exhaustive

            volumeMounts:
              - name: data-volume
                mountPath: /data/

            env:
              - name: DUPLICACY_BACKUP_THEAD_COUNT
                value: "3"
              - name: B2_STORAGE_NAME
                value: "b2"

          restartPolicy: OnFailure

          # Keep it running on one of the cluster chunkservers so that at
          # least part of the I/O is to local disk instead of across the
          # network. Remove if you don't care what node backups happen on.
          nodeSelector:
            odroid: "true"

          volumes:
            - name: data-volume
              hostPath:
                # This will be remapped to /data which is where duplicacy
                # expects to find the data it is backing up, and the .duplicacy
                # directory with its settings.
                path: /dfs/volumes/exampledir
                # this field is optional
                type: Directory
```

## License

This repository is copyright 2019, Joe Block<EMAIL_ADDRESS>and is Apache 2.0 licensed.

duplicacy and duplicacy-util have their own licenses, see the links above for details

repository: unixorn/thoth-duplicacy

gha_language: Shell

repo_name: unixorn/thoth-duplicacy


text:
# Gulp Script API

The following is a list of Gulp tasks as defined in `[ods-component]/gulpfile.js`

| Task | Description |
|----|----|
| copyFonts | Copy files from npm to local resources |
| buildTokens | Builds out CSS resources necessary for local development |
| distTokens | Builds Design Tokens to meet dist spec |
| processDemo | Build CSS from Sass for component demo |
| processSrc | Build all CSS resources needed for production deployment and browser testing |
| processImportsCanonical | Process Sass to create canonical resource |
| processImportsVariable | Process Sass to create variable resource |
| processDev | Build minimal CSS resources needed for local development |
| reprocessClean | Re-processes style_clean.scss file to replace `:host` with `&` for static output |
| sassWatch | Watcher for building CSS resources from Sass files |
| build | Main task to run all build tasks |
| dev | Main task to run all development tasks |

##

<footer>
Alaska Airlines Orion Design System<br>
Copyright 2019 Alaska Airlines, Inc. or its affiliates. All Rights Reserved.
</footer>


text:
## GCE Billing Tracker
### Now With GDRIVE Support!
 Please note: still early work in progress, updating in progress

 Current support:

* Zones: asia-east-1

* GPU's: V100, P100, K80

* Storage: SSD, Standard provisioned

### Features
1. Integration with gdrive for live tracking accross all account VM's
2. Show real-time cost of resources based on latest exchange rates and hardware costs
2. View all past or current VM billing sessions
3. Syncs automatically every 60 minutes. Pushes on shutdown final VM usage and pulls history from cloud.
4. See what you are actually using and not estimate based off a 24-48hour delay!
5. Calculates automatically from used system hardware what total cost of usage is per session.

This is a very useful bash script which automatically shows you your current billing cost of your Google Cloud VM Compute instances live and accurately.

If you care about your money and want a live view of your usage, try this out!

 *Please keep in mind costs such as Image storage, Snapshots or internet usage is not monitored and need to also be accounted for.

Feel free to let me know changes/additions to be made :)

### Install:
```
1. Run gcecosts.sh. This will walk you though setup of gdrive, authentication and everything else.
2. Important: setup will require you to add a shutdown Meta key for each VM. Please do this and follow instructions...
3. After completed setup, you will have access to VM tracking and features.

Run: gcecosts [options]
   [-v]: Verbose mode / print out detailed history and cost usage
   [-s]: sync latest VM billing history from cloud to local instance / push current VM usage
   [-r]: Reset environment
```


text:
# Price Simulator: A Simulation Platform for Algorithmic Pricing

![Python application](https://github.com/matthias-hettich/price_simulator/workflows/Python%20application/badge.svg)

## Project structure

The core functionality of the price simulator is in folder `price_simulator/src/algorithm`.
The components of the simulator are programmed as separated objects.
Thus, agents, demand, environment and policies have own files and classes.
This object-oriented approach allows a free combination of different agents, demand models, or policies.
New agents or more sophisticated demand models integrate straightforwardly.
`main.py` shows an examplary entry point to start the simulation.
The environment is able to handle an arbitrary amount of different agents.
This makes a huge variety of experiments easily possible.

## First usage

To start, you'll need `docker` installed. When done, run this line in price_simulator dir:

```bash
docker build -t price-simulator:1.0 .
```

It will build docker image, used for running other commands.
You can execute scripts using Docker. Docker must be build to reflect changes.

```bash
docker run price-simulator:1.0
```


text:
gdoc-markdown-converter
========

A Google Docs add-on to convert a properly formatted Google Drive Document to the markdown (.md) format. Then either download it or add it to your Google Drive. It also attached images which are
available inside the doc.

## Usage
  * How to install ?
    * Open any google document from your drive that can be converted into an MD file
    * Click on Tools -> Script Editor
    * Click on "Blank Project"
    * Delete all the contents in the file code.gs and paste all the contents from converttomarkdown.js file
    * Save the project and the file
    * There will be a drop down saying "Select Function"
    * Select the function "ConvertToMarkDown" from the drop down.
  * How to Use ?
    * After creating the project as said above, open the document where you have created the scripts.
    * Click on the Add-ons menu, you will see an add-on by the name of the project that you have created while installing.
    * Click on "Add To Drive" menu.
    * The file will be converted into an MD file with the name, same as that of the source document.
    * The converted file will be placed in a folder created with the name same as that of source document, under the folder "Google Docs to Markdown"
    * If the above said folders are not there, the script will automatically create it.
    * If any inline image are there, it will also be placed within the folder where the converted MD file is placed already.
    * Please note that the converted images cannot be viewed directly from google drive. You have to download to view it because of this issue [http://code.google.com/p/google-apps-script-issues/issues/detail?id=1239]
    * To convert multiple documents, it is better to create this as a google docs plugin and publish it within your own domain after getting approval from google.
    * To change the otuput folder, click on the "Change Output Folder" menu. It will show you the default output folder and a text box to change it.
    * Type in the new output folder name and press 'OK'. All the converted MD files in future will be placed under this new common folder. If the folder doesn't exist, it will create when the next time you convert any MD file.
    * Please note that if you change the output folder name in plugin, it will be reflected across all documents.
    * Cheers, Happy Converting.

## Interpreted formats
  * Text:
    * paragraphs are separated by two newlines
    * text styled as heading 1, 2, 3, etc is converted to Markdown heading: #, ##, ###, etc
    * text formatted with Courier New is backquoted: ``text``
    * links are converted to MD format: `[anchortext](url)`
  * Lists:
    * Numbered lists are converted correctly, including nested lists
    * bullet lists are converted to "`*`" Markdown format appropriately, including nested lists
  * Images:
    * images are correctly extracted and sent as attachments
  * Blocks:
    * Table of contents is replaced by `[[TOC]]`
    * blocks of text delimited by "--- class whateverclassnameyouwant" and "---" are converted to `<div class="whateverclassnameyouwant"></div>`
    * Source code:
      * **UPDATED**: blocks of text delimited by "--- source code" or "--- src" and "---" are converted to `<pre></pre>`
      * **NEW**: blocks of text delimited by "--- source pretty" or "--- srcp" and "---" are converted to `<pre class="prettyprint"></pre>`
    * Tables:
      * **NEW**: Simple `<table>` processing
  * "--- jsperf `<testID>`" is replaced by an iframe that shows an interactive chart of a JSPerf test. The `<testID>` is the last part of the URL of the Browserscope anchor in your JSPerf test. Something like `"agt1YS1wcm9maWxlcnINCxIEVGVzdBjlm_EQDA"` in the URL `http://www.browserscope.org/user/tests/table/agt1YS1wcm9maWxlcnINCxIEVGVzdBjlm_EQDA`

## CONTRIBUTORS

* Supreet Pal Singh - supreetpal.in
* Siva Subramaniam - [Github](//github.com/subramaniashiva)

## CREDITS

* Renato Mangini - [G+](//google.com/+renatomangini) - [Github](//github.com/mangini)
* Ed Bacher - [G+](//plus.google.com/106923847899206957842) - [Github](//github.com/evbacher)

As this project was forked from their original script available at:
https://github.com/mangini/gdocs2md

## LICENSE

Use this script at your will, on any document you want and for any purpose, commercial or not.
The MarkDown files generated by this script are not considered derivative work and
don't require any attribution to the owners of this script.

If you want to modify and redistribute the script (not the converted documents - those are yours),
just keep a reference to this repo or to the license info below:

```
Copyright 2013 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

repository: supreetpal/gdoc-markdown-converter

branch_name: refs/heads/develop

repo_name: supreetpal/gdoc-markdown-converter


text:
# sirvlog-parser

Parse Nginx, Apache, Proftpd or any other logs and send them to [sirvlog](https://github.com/sirv/sirvlog) server

Sample configurations are available in [conf.d.example](https://github.com/sirv/sirvlog-parser/tree/master/conf.d.example)

### Features

  * Will remember file position for each logfile when stopped/started
  * Handles log files rotated by logrotate (so it wont miss a single record)
  * Easy to configure new services as it can handle CSV files (quoted fields separated by whitespace for example) or just any log file. See [nginx access.log](https://github.com/sirv/sirvlog-parser/blob/master/conf.d.example/nginx.conf.js) as an example of CSV input (needs configured nginx log_format) and [proftpd xferlog](https://github.com/sirv/sirvlog-parser/blob/master/conf.d.example/xferlog.conf.js) as an example of free form log file
  * Filters (in Javascript) to parse (or modify) each log message

Example of parsed message (as in [sirvlog web frontend](https://github.com/sirv/sirvlog-web) ):

[<img src="https://dl.dropbox.com/u/102761139/sirvlog-web/sirvlog-parser.jpg" width="600px"/>](https://dl.dropbox.com/u/102761139/sirvlog-web/sirvlog-parser.jpg)

### Running as [supervisord](http://supervisord.org/) service

[supervisord](http://supervisord.org/) is a great tool to run your Node apps as it allows you to have full control over running services (as well as [monitoring their health status](https://github.com/sirv/sirvlog-monitors) )

So the typical config will be

``` sh
$ cat /etc/supervisor.d/sirvlog-parser.conf
```

``` sh
[program:sirvlog-parser]
command=/home/nvm/v0.10.2/bin/node /home/sirvlog-parser/src/app.js --config /home/sirvlog-parser/config.js
process_name=sirvlog-parser
numprocs=1
numprocs_start=0
autostart=true
autorestart=true
startsecs=1
startretries=3
exitcodes=0,2
stopsignal=TERM
stopwaitsecs=10
user=ubuntu
redirect_stderr=true
stdout_logfile=/home/sirvlog-parser/logs/sirvlog-parser.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=10
stdout_capture_maxbytes=0
stdout_events_enabled=false
stderr_logfile=AUTO
stderr_logfile_maxbytes=50MB
stderr_logfile_backups=10
stderr_capture_maxbytes=0
stderr_events_enabled=false
serverurl=AUTO
```

### See also

  * [sirvlog](https://github.com/sirv/sirvlog)
  * [sirvlog web frontend](https://github.com/sirv/sirvlog-web)
  * [service healh monitors for sirvlog](https://github.com/sirv/sirvlog-monitors)

## Authors

**Oleksiy Krivoshey**

  * [https://github.com/oleksiyk](https://github.com/oleksiyk)

# License (MIT)

Copyright (c) 2013 Sirv.

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: sirv/sirvlog-parser

repo_name: sirv/sirvlog-parser


text:
# react-native-jykit

A set of UI components for React Native

## Setup

```
$ npm install react-native-jykit@latest --save

$ react-native link
```


text:
# App Container Specification

_For version information, see [VERSION](VERSION)_

## Overview

"App Container" (appc) is a specification describing how applications can be packaged, distributed, and executed in a portable and self-contained way.
The specification defines an **image format**, an **image discovery mechanism**, a **deployable grouping**, and an **execution environment**.

The core goals of the specification include:

* Designing for fast downloads and starts of App Containers
* Ensuring images are cryptographically verifiable and highly cacheable
* Designing for composability and independent implementations
* Using common technologies for cryptography, archiving, compression and transport
* Using the DNS namespace to name and discover images

### Requirements

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this and other documents of the specification are to be interpreted as described in [RFC2119](http://tools.ietf.org/html/rfc2119).

## Sections

The specification consists of several key sections; the goal is that each can be implemented independently, but are composable with one another.

1. The **[App Container Image](spec/aci.md)** defines: how files are assembled together into a single image, verified on download and placed onto disk to be run.

2. **[App Container Image Discovery](spec/discovery.md)** defines: how to take a name like `example.com/reduce-worker` and translate that into a downloadable image.

3. The **[App Container Pod](spec/pods.md)** (or "Pod") defines: how one or more App Container Images are grouped into a deployable, executable unit.

4. The **[App Container Executor](spec/ace.md)** defines: how pods are executed and the environment they are run inside (including, for example, filesystem layout, resource constraints, and networking).

    * The [Metadata Service](spec/ace.md#app-container-metadata-service) defines how apps within pods can introspect and get a cryptographically verifiable identity from the execution environment.

## Example Use Case

Here's an example use case demonstrating how the different sections of the specification could be utilized together.

A user wants to launch an "App Container" running three processes.
The three processes the user wants to run are the apps named `example.com/reduce-worker-register`, `example.com/reduce-worker`, and `example.com/reduce-backup`.
First, an executor will make an HTTPS request to example.com and, on inspecting the `<meta>` tags in the returned page, determines that the images can be found at:

	https://storage-mirror.example.com/reduce-worker.aci
	https://storage-mirror.example.com/worker-backup.aci
	https://storage-mirror.example.com/reduce-worker-register.aci

The executor downloads these three images and puts them into its local on-disk cache.
Then the executor extracts three fresh copies of the images to create instances of the "on-disk app format" and reads the three image manifests to figure out what binaries will need to be executed.

Based on user input, the executor now sets up the necessary cgroups, network interfaces, etc. and runs the `pre-start` event handlers for each app.
Next, it forks the `reduce-worker`, `worker-backup`, and `register` processes in their shared namespaces, chrooted into their respective root filesystems.

At some point, the App Container gets some notification that it needs to stop (for example, upon host shutdown).
The executor sends `SIGTERM` to the processes.
After they have exited, the executor runs the `post-stop` event handlers for each app.

repository: blablacar/dgr

gha_language: Go

repo_name: blablacar/dgr


text:
# Swoop : Swift and Objective-C comparison reporter

[![Gem](https://img.shields.io/gem/v/swoop_report.svg)][rubygems]
[![Build Status](http://img.shields.io/travis/ikhsan/swoop/master.svg)][travis]
[![Coverage Status](http://img.shields.io/coveralls/ikhsan/swoop/master.svg)][coveralls]

[rubygems]: https://rubygems.org/gems/swoop_report
[travis]: https://travis-ci.org/ikhsan/swoop
[coveralls]: https://coveralls.io/github/ikhsan/swoop?branch=master

Track your swift code in your Xcode codebase through time. It can go back in time from your git repository and make a comparison report.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'swoop_report'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install swoop_report

## Usage

To print the comparison report inside your console, just run `swoop` command with two required options:

```bash
$ swoop --path <path> --dir <dir>
```

- `path` is your path to your `.xcodeproj` and
- `dir` is your directory inside your Xcode project

As default options, this will list the last 8 tags, collect information from each tag, collate it into a report, and then present it as a table inside your console.

### Example

Say you have your awesome project inside `YourAwesomeProject` folder called `AwesomeProject.xcodeproj`. You open the project, and you have organised your files in Xcode project navigator to look something like this :

```
+ AwesomeProject
+- Classes
+--- Model
+--- View
+--- Controller
+--- Network
+- Assets
+- Frameworks
+- Products
```

Say, you want to compare all of the classes then run :

```bash
$ swoop --path '~/YourAwesomeProject/AwesomeProject.xcodeproj' --dir 'Classes'
```

Or, if you want to compare only files inside `Controller`, run :

```bash
$ swoop --path '~/YourAwesomeProject/AwesomeProject.xcodeproj' --dir 'Classes/Controller'
```

### Options

#### Path (`--path`)

Specify the path to the `.xcodeproj` file. (This is required)

#### Directory (`--dir`)

Specify which directory where the files that you want to compare based on Xcode project navigator. (This is required)

#### Tags (`--tags`)

Specify a number of how many tags you want to include for comparison. For example, if you want to include the last 10 tags you would run:

```bash
$ swoop --path '~/YourAwesomeProject/AwesomeProject.xcodeproj' --dir 'Classes' --tags 10
```

#### Filter Tag (`--filter_tag`)

Specify a regular expression that will be applied to tag names. This only applies if tags is used. For example, if you only want to include tags that look like `v1.0.0`, then you would run:

```bash
$ swoop --path '~/YourAwesomeProject/AwesomeProject.xcodeproj' --dir 'Classes' --tags 10 --filter_tag 'v\d+.\d+.\d+'
```

#### Weeks (`--weeks`)

Specify a number of how many weeks you want to include for comparison. For example, if you want to include the last 30 weeks, run :

```bash
$ swoop --path '~/YourAwesomeProject/AwesomeProject.xcodeproj' --dir 'Classes' --weeks 30
```

Note: If both `--tags` and `--weeks` are specified, weeks will take priority.

#### Renderer (`--render`)

Specify how do you render the reports. Available renderers are `table`, `csv` and `chart`

##### Table

This renders a table in your console. Table is used if `--render` is not specified.

```bash
$ swoop --path '~/YourAwesomeProject/AwesomeProject.xcodeproj' --dir 'Classes'
# or
$ swoop --path '~/YourAwesomeProject/AwesomeProject.xcodeproj' --dir 'Classes' --render table
```

will output this table in your console

![table](/screenshots/table.png?raw=true)

##### CSV

This will export your report as a csv file in root.

```bash
$ swoop --path '~/YourAwesomeProject/AwesomeProject.xcodeproj' --dir 'Classes' --render csv
```

##### Chart

This will export your report as a chart in a webpage. It creates an `html` folder in root with the page `index.html` inside of it.

```bash
$ swoop --path '~/YourAwesomeProject/AwesomeProject.xcodeproj' --dir 'Classes' --render chart
```

will output a chart in `./html/index.html`

![chart](/screenshots/chart.png?raw=true)

## Contributing

Feel free to put any ideas, questions or bug reports by [creating issues](https://github.com/ikhsan/swoop/issues/new). If you think you have a great idea for any improvement we'd be really happy to receive any pull request (refer to **Development** section to setup in your local machine).

### Development

Clone this repository and get into the directory.

```bash
# Install dependencies
$ bin/setup
# Run the tests
$ rake spec
# (Optional) run interactive console for experimentation
$ bin/console
```

## License

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

repository: ikhsan/swoop

gha_language: Ruby

repo_name: ikhsan/swoop