text:
# gatsby-theme-try-ghost

[![Released under MIT license.](https://badgen.net/github/license/micromatch/micromatch)](https://github.com/styxlab/gatsby-theme-try-ghost/blob/master/LICENSE)
[![gatsby-theme-try-ghost npm package version.](https://badgen.net/npm/v/gatsby-theme-try-ghost)](https://www.npmjs.org/package/gatsby-theme-try-ghost)
[![PRs welcome!](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)]()

A Gatsby theme plugin for creating blogs from headless [Ghost CMS](https://ghost.org/changelog/jamstack/).

Turn your Ghost blog into a flaring fast static website. This Gatsby theme is a frontend replacement of the Ghost handlebars engine featuring the standard Ghost Casper skin and functionality. All content is sourced from a headless Ghost CMS.

## Variants 🔥

Favor [Next.js](https://nextjs.org/) over Gatsby? Head over to [next-cms-ghost](https://github.com/styxlab/next-cms-ghost)!

## Tutorials ✨ 🆕

> Check out the [Tutorials](https://www.jamify.org) for practical guides on using this project.

## Demo

Play with the [Demo](https://demo.jamify.org/) to get a first impression.

## Features

-   Ghost Casper look and feel
-   _Feature & inline_ images with [lazy-loading and blur-up effect](https://using-gatsby-image.gatsbyjs.org/) 🚀🚀 🆕
-   Infinite Scroll ✨
-   Featured posts pinned on top 🆕
-   Sticky navigation headers
-   Hover on author avatar
-   Styled 404 page
-   SEO optimized
-   Fully responsive
-   Advanced routing 🆕
-   Composable and extensible
-   Incremental build enabled 🚀 🆕

## Performance

![Lighthouse Score](https://static.gotsby.org/v1/assets/images/jamify-lighthouse.png)

## Plugins

Additional features can be integrated by installing Gatsby themes or plugins. The following plugins have been tested to work with [`gatsby-theme-try-ghost`](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/packages/gatsby-theme-try-ghost):

| Name                                                                                | Version                                                                                | Description                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [`gatsby-theme-ghost-dark-mode`](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/packages/gatsby-theme-ghost-dark-mode)  | [![version](https://badgen.net/npm/v/gatsby-theme-ghost-dark-mode)](https://www.npmjs.com/package/gatsby-theme-ghost-dark-mode)     | Dark mode toggle 🌗                                                            |
| [`gatsby-rehype-ghost-links`](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/packages/gatsby-rehype-ghost-links)        | [![version](https://badgen.net/npm/v/gatsby-rehype-ghost-links)](https://www.npmjs.com/package/gatsby-rehype-ghost-links)           | Rewrite CMS links from absolute to relative                                    |
| [`gatsby-rehype-inline-images`](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/packages/gatsby-rehype-inline-images) 🆕 | [![version](https://badgen.net/npm/v/gatsby-rehype-inline-images)](https://www.npmjs.com/package/gatsby-rehype-inline-images)       | Lazy-loading inline images with blur-up                                        |
| [`gatsby-rehype-prismjs`](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/packages/gatsby-rehype-prismjs)                | [![version](https://badgen.net/npm/v/gatsby-rehype-prismjs)](https://www.npmjs.com/package/gatsby-rehype-prismjs)                   | Syntax highlighting with [PrismJS](http://prismjs.com/)                        |
| [`gatsby-theme-ghost-contact`](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/packages/gatsby-theme-ghost-contact)      | [![version](https://badgen.net/npm/v/gatsby-theme-ghost-contact)](https://www.npmjs.com/package/gatsby-theme-ghost-contact)         | Contact page                                                                   |
| [`gatsby-theme-ghost-commento`](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/packages/gatsby-theme-ghost-commento)    | [![version](https://badgen.net/npm/v/gatsby-theme-ghost-commento)](https://www.npmjs.com/package/gatsby-theme-ghost-commento)       | Commenting system with [Commento](https://commento.io/)                        |
| [`gatsby-theme-ghost-toc`](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/packages/gatsby-theme-ghost-toc) 🆕           | [![version](https://badgen.net/npm/v/gatsby-theme-ghost-toc)](https://www.npmjs.com/package/gatsby-theme-ghost-toc)                 | Table of Contents                                                              |
| [`gatsby-theme-ghost-members`](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/packages/gatsby-theme-ghost-members) 🆕   | [![version](https://badgen.net/npm/v/gatsby-theme-ghost-members)](https://www.npmjs.com/package/gatsby-theme-ghost-members)         | Member Subscriptions                                                           |
| [`gatsby-plugin-ackee-tracker`](https://github.com/burnsy/gatsby-plugin-ackee-tracker)                                                 | [![version](https://badgen.net/npm/v/gatsby-plugin-ackee-tracker)](https://www.npmjs.com/package/gatsby-plugin-ackee-tracker)       | Site tracking with [Ackee](https://github.com/electerious/Ackee)               |
| [`gatsby-plugin-google-analytics`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-analytics)             | [![version](https://badgen.net/npm/v/gatsby-plugin-google-analytics)](https://www.npmjs.com/package/gatsby-plugin-google-analytics) | Site tracking with [Google Analytics](https://developers.google.com/analytics) |

## Installation

> Head over to the [starter repo](https://github.com/styxlab/gatsby-starter-try-ghost) to get up and running quickly!

If you want to add this blog theme to an existing site, follow these instructions:

1. Install the blog theme

    ```bash
    yarn add gatsby-theme-try-ghost
    # or
    npm install gatsby-theme-try-ghost --save
    ```

2. Add the following configuration to your `gatsby-config.js` file

    ```js
    // gatsby-config.js
    module.exports = {
        plugins: [
            {
                resolve: `gatsby-theme-try-ghost`,
                options: {
                    siteConfig: {
                        siteUrl: `https://your-bog.com`,
                        postsPerPage: 3,
                        siteTitleMeta: `Gatsby frontend powered by headless Ghost CMS`,
                        siteDescriptionMeta: `Turn your Ghost blog into a flaring fast static site with Gatsby`,
                        shortTitle: `Ghost`,
                        siteIcon: `favicon.png`,
                        backgroundColor: `#e9e9e9`,
                        themeColor: `#15171A`,
                        gatsbyImages: true,
                        // Overwrite navigation menu (default: []), label is case sensitive
                        // overwriteGhostNavigation: [{ label: `Home`, url: `/` }],
                    },
                    ghostConfig: {
                        development: {
                            apiUrl: "https://your-ghost-cms.com",
                            contentApiKey: "9fcfdb1e5ea5b472e2e5b92942",
                        },
                        production: {
                            apiUrl: "https://your-ghost-cms.com",
                            contentApiKey: "9fcfdb1e5ea5b472e2e5b92942",
                        },
                    },
                    //routes: {
                    //    // Root url for Ghost posts and pages (optional, defaults to `/`)
                    //    basePath: `/blog`,
                    //
                    //    // Collections (optional , default: [])
                    //    collections: [{
                    //        path: `speeches`,
                    //        selector: node => node.primary_tag && node.primary_tag.slug === `speeches`,
                    //    }],
                    //},
                },
            },
        ],
    };
    ```

3. Update siteConfig

    In the configuration shown above, the most important fields to be changed are `siteUrl`, `siteTitleMeta` and `siteDescriptionMeta`. Update at least those to fit your needs. Also make sure your `favicon.png` can be found in folder `static` of your working directory.

4. Ghost Content API Keys

    Change the `apiUrl` value to the URL of your Ghost CMS site. Next, update the `contentApiKey` value to a key associated with the Ghost CMS site. A key can be provided by creating an integration within Ghost Admin. Navigate to _Integrations_ and click _Add new integration_. Give the integration a name and click create.

5. Advanced Routing

    You can define a `basePath` that is added to all routes, effectively moving all routes one level down. Collections are distinct groups of posts that get an entry point at `collections.path`. Permalinks are best configured in`routes.yaml` of the Ghost CMS.

## Running

Start the development server. You now have a Gatsby site pulling content from headless Ghost.

```bash
gatsby develop
```

## Ensure headless mode of Ghost CMS

For best SEO results it is strongly recommended to disable the default Ghost Handlebars theme front-end by selecting the _Make this site private_ flag within your Ghost admin settings. This enables password protection in front of the Ghost install and sets `<meta name="robots" content="noindex" />` so your Gatsby front-end becomes the source of truth for SEO.

## Contributions

Special thanks go to the following contributors: [jem](https://github.com/jempurich), [tobimori](https://github.com/tobimori) and [Torqu3Wr3nch](https://github.com/Torqu3Wr3nch).

PRs are welcome! Consider contributing to this project if you are missing feature that is also useful for others. Explore [this guide](https://github.com/styxlab/gatsby-theme-try-ghost/tree/master/CONTRIBUTING.md), to get some more ideas.

## Credits

This project would not be possible without the great [Gatsby](https://www.gatsbyjs.org/), [Ghost](https://ghost.org/), [React](https://reactjs.org/), [GraphQL](https://graphql.org/), [Node](https://nodejs.org) and the [JavaScript](https://developer.mozilla.org/de/docs/Web/JavaScript) eco-system in general. This project started from a fork of [`gatsby-starter-ghost`](https://github.com/TryGhost/gatsby-starter-ghost), but has evolved to a different, independent project.

# Copyright & License

Copyright (c) 2020 styxlab - Released under the [MIT license](LICENSE).

repository: styxlab/gatsby-theme-try-ghost

gha_language: JavaScript

repo_name: styxlab/gatsby-theme-try-ghost


text:
---
name: Lothario Q
rarity: 5
series: voy
memory_alpha:
bigbook_tier: 7
events: 34
in_portal: true
date: 04/02/2021
obtained: Mega
mega: true
published: true
---

For some players, Q Hefner’s usability may be as questionable as his choice in evening wear. There are no green lights in any one area for Q, but he at least touches upon several areas and would be an attractive crew if only the raw power meter was bumped up a bit.

Gauntlet is his highlight, at least for the moment. Q’s proficiencies are generally best suited for newer players, but a strong skill set and a few punchy trait sets offer the occasional trip to your starting five even for veteran rosters.

Only afforded a brief stay in voyage-able territory by his mediocre release power there, the other attributes likely to stick around for some time are a viable event tally roughly split between trait and variant events and an above average collection profile also fueled by those aforementioned traits. A relative jack of all trades, Q should work out alright as a low end behold option for years to come.

license: MIT

repository: joshurtree/datacore-website

branch_name: refs/heads/master

extension: md

gha_language: TypeScript

gha_license_id: MIT

license_type: permissive

repo_name: joshurtree/datacore-website


text:
# iguana2 roadmap

A complete rewrite of [iguana](https://github.com/alecgorge/iguana) to be more abstracted and support a variety of sources. It also sets up data to be better prepared for future additions of users and statistic generation.

The primary technical goal to provide an abstraction over media sources such as [archive.org](http://archive.org), [panicstream.com](http://panicstream.com) and [phish.in](http://phish.in) and integrate metadata sources such as [setlist.fm](http://setlist.fm) or [phish.net](http://phish.net) to provide extended metadata or reviews. This is complicated by the fact that a media source may provide reliable metadata as well.

The ultimate functional goal of iguana2 is to allow me to unify and rewrite (in Swift!) the networking and playback codebases for PhishOD and Relisten app without losing any of the extra features [PhishOD](http://phishod.alecgorge.com) has because of much better data [phish.in](http://phish.in) and [phish.net](http://phish.net) provide.

## Core Tenets

1. Music is #1. Never hide a show because we don't have metadata.
2. Make sure to credit the tapers and hosts of content — nothing is possible without them.
3. Utilize secondary, metadata-only sources to provide more ways to access the music. Don't try to match music sources to metadata sources. This will fail.

## Definitions

Data types are all Postgres notation and implications.

All data structures have a unique, autoincrementing `id` and a `created_at` and `updated_at` field.

#### Data Collection Techniques

* `Phish`
  1. Import media and some metadata from [phish.in](http://phish.in)
  2. Import more metadata from [phish.net](http://phish.net)

* `ArchiveSetlistFm`
  1. Import media from [archive.org](http://archive.org)
  2. Import setlist metadata from [setlist.fm](http://setlist.fm)

* `JustArchive` (when setlist.fm doesn't have good information for an artist, basically iguana 1.0)
	1. Import media and build setlist information based on [archive.org](http://archive.org). Only attempt to reuse venues when they belong specifically to that artist (setlist.fm venues are shared across artists).

* `WidespreadPanic`
	1. Import media from [panicstream.com](http://panicstream.com).
	1. Import setlist data just like `ArchiveSetlistfm`.

### artists

Column Name | Type | Comments
:---------- | :--- | :-------
name | text
upstream\_identifier | text | potentially used by the `data_source` to look up data appropriately
data\_source | text | an identifier referring to one of the different data collection techniques (Phish, ArchiveSetlist, JustArchive, etc)
musicbrainz_id | text | A useful identifier for integrating with a variety of services

### years

Cached summarization data about each year of an artist.

Column Name | Type | Comments
:---------- | :--- | :-------
artist_id | integer
year | text | String because it is possible that the year might not be known
show_count | integer | **NOT** the number of recordings
recording_count | integer
duration | integer  | The sum of the duration (in seconds) of each show in the year (use the longest source per show)
avg_duration | real | The average duration of each show in the year (use the longest source per show)
avg_rating | real | The average of all the average ratings for each show in the year

### features

Column Name | Type | Comments
:---------- | :--- | :-------
artist_id | integer
descriptions | boolean | Sometimes there are just a taper notes file
eras | boolean | Does the artist have eras (Phish 1.0, Phish 2.0, Phish 3.0)
multiple_sources | boolean | To clean up the UI. Everything will still be stored as if it can support multiple sources. Some artists, such as Phish, won't ever have multiple sources for a show. This will allow queries and UI paths to short-circuit.
reviews | boolean
ratings | boolean
tours | boolean
taper_notes | boolean | Is the raw txt file from the source available?
source_information | boolean | Broken down information (taper, transferrer, etc) instead of big taper notes
sets | boolean | For track listings. Obviously every band has sets when playing live.
per\_show\_venues | boolean | We know for sure what the venue is.
per\_source\_venues | boolean | No authority for venues, every source has to list it
venue\_coords | boolean | Lat and long for venues. Could be calculated if location information is specific enough
songs | boolean
years | boolean | Default true. What artist wouldn't??
track_names | boolean | For very raw sources where we only have filenames
track_md5s | boolean
review_titles | boolean
jam_charts | boolean
setlist\_data\_incomplete | boolean | Sometimes setlist.fm isn't up to date/doesn't go all the way back. We should provide info that songs/tours/etc are incomplete

### eras

Logical grouping of several years

Column Name | Type | Comments
:---------- | :--- | :-------
artist_id | integer
order | integer
name | string

### shows

Column Name | Type | Comments
:---------- | :--- | :-------
year_id | integer
artist_id | integer
tour_id | nullable integer
venue_id | nullable integer
era_id | nullable integer
date | date | See `display_date`.
avg\_rating\_weighted | real | calculated based on # of reviews and the rating itself
avg\_duration | real
display_date | varchar(32) | Sometimes the date is unknown (1970-XX-XX so this column is used for display and the first of the month or year is used for sorting). This is something that is unique on (artist_id + display_date) and should be used to

### sources

Column Name | Type | Comments
:---------- | :--- | :-------
show_id | integer
upstream_identifier | string | Something to identify the this information in the data source **unqiue**
is_soundboard | boolean
is_remastered | boolean
avg_rating | integer
num_reviews | integer
has_jamcharts | boolean
description | text
taper_notes | text | For sources that don't have detailed info, this will be the whole txt file. For others it is just a bit information
source | text
taper | text
transferer | text
lineage | text

### source_sets

Column Name | Type | Comments
:---------- | :--- | :-------
source_id | integer
index | integer | Used for ordering the sets properly
is_encore | boolean
name | text

### source_tracks

Column Name | Type | Comments
:---------- | :--- | :-------
source_id | integer
set_id | integer
track_position | integer
duration | integer
title | text
slug | text
mp3_url | text
md5 | nullable text

### source_reviews

Column Name | Type | Comments
:---------- | :--- | :-------
source_id | integer
authored_at | timestamp with timezone
rating | integer | On a scale of one to 10
title | text
review | text
author | text

### setlist_shows

Column Name | Type | Comments
:---------- | :--- | :-------
artist_id | integer
venue_id | integer
tour_id | integer
upstream_identifier | text
date | date

### setlist_songs

Column Name | Type | Comments
:---------- | :--- | :-------
artist_id | integer
upstream_identifier | text | unique among artist\_id + upstream\_identifier
title | text
slug | text

### setlist\_song\_plays

Column Name | Type | Comments
:---------- | :--- | :-------
played\_setlist\_song\_id | integer
played\_setlist\_show\_id | integer

### tours

Tours **do not** overlap and can therefore be sorted by `start_date`.

Column Name | Type | Comments
:---------- | :--- | :-------
artist_id | integer
name | string
start_date | nullable date
end_date | nullable date

### venues

Column Name | Type | Comments
:---------- | :--- | :-------
artist_id | nullable integer | Only needed for source specific venues
name | text
location | text | Could be City; State; City, State; City, Country
lat | nullable real
long | nullable real
upstream_identifier | text

## Indexing Approach

### Phish

1. Pull tour list from `http://phish.in/api/v1/tours.json?per_page=2000`
	1. Add any tour to `Tour` whose `name` doesn't exist in `Tour.name`
2. Pull song list from `http://phish.in/api/v1/songs.json?per_page=2000`
	1. Add any song to `Song` whose `title` doesn't exist in `Song.title`
	2. Build an in memory map between phish.in's `id` and iguana2's `Song.id` (to be used when inserting shows)
3. Pull venue list from `http://phish.in/api/v1/venues.json?per_page=2000`
	1. Add any song to `Venue` whose `id` doesn't exist in `Venue.source_id`
	2. Build an in memory map between phish.in's `id` and iguana2's `Venue.id`
4. Pull show list from `http://phish.in/api/v1/shows.json?per_page=2000`
	1. Filter the show list to only contain shows whose `id` value doesn't exist in `Source.source_identifier`. This way we only pull new shows.
	2. Pull full show data for each remaining show `http://phish.in/api/v1/show-on-date/#{date | YYYY-MM-DD}.json`
		1. Pull data from
	3. Import more metadata from [phish.net](http://phish.net)
5. Build years
6. Pull era list from `http://phish.in/api/v1/eras.json`
	9. Drop all `Era`s associated with `Phish` and re-add all eras from the JSON

### ArchiveSetlistFm

  1. Import setlist metadata from `http://api.setlist.fm/rest/0.1/artist/${musicbrainz_id}/setlists.json?p=${page}`
	  1. If the setlist id isn't in the database as upstream\_identifier import the setlist\_show
	  2. **setlist\_shows** If the lastUpdated is newer than the updated\_at remove the setlist\_show and the all entries in setlist\_song\_plays. Set updated\_at to lastUpdated
	  3. **venues**, **tours** Create or if lastUpdated > updated\_at update properties and set updated_at to lastUpdated
	  4. **setlist\_songs** if the song's id exists in the upstream identifier then add a record to the join table, otherwise add the song and then the join table record

  2. List identifiers from `http://archive.org/advancedsearch.php?q=collection%3A${upstream_identifier}&fl%5B%5D=date&fl%5B%5D=identifier&fl%5B%5D=year&fl%5B%5D=updatedate&sort%5B%5D=year+asc&sort%5B%5D=&sort%5B%5D=&rows=9999999&page=1&output=json&save=yes`
  	1. **sources** If the identifier isn't in the database, import the show
	2. **sources**, **source_sets**, **source_tracks** If the last updatedate is newer than the updated\_at, drop the source, the set and all associated tracks and re-add it
	3. **reviews** Check+add any new reviews
	4. *Note:* Adding means making 1 new source, 1 new set and n new tracks. Use setlist_show's venue id to pick the correct venue

  3. **shows** If there are sources without a corresponding shows row add them
  4. Update all years for the artist
	1. Set year\_id for shows for the appropriate year

### JustArchive

When setlist.fm doesn't have good information for an artist, basically iguana 1.0.

1. See step 1 above, but also do a artist specific venue check as well

### WidespreadPanic

1. Import setlist data just like `ArchiveSetlistfm`.
2. Import media from [panicstream.com](http://panicstream.com).


text:
---
hrs_structure:
  division: '2'
  volume: '11'
  title: '27'
  chapter: '490'
  section: '490:7-207'
type: hrs_section
tags:
  - Business
menu:
  hrs:
    identifier: HRS_0490-0007-0207
    parent: HRS0490
    name: '490:7-207 Goods must be kept separate; fungible goods'
weight: 77950
title: Goods must be kept separate; fungible goods
full_title: '490:7-207 Goods must be kept separate; fungible goods'
---
**§490:7-207 Goods must be kept separate; fungible goods.** (a) Unless the warehouse receipt provides otherwise, a warehouse shall keep separate the goods covered by each receipt so as to permit at all times identification and delivery of those goods. However, different lots of fungible goods may be commingled.

(b) If different lots of fungible goods are commingled, the goods are owned in common by the persons entitled thereto and the warehouse is severally liable to each owner for that owner's share. If, because of overissue, a mass of fungible goods is insufficient to meet all the receipts the warehouse has issued against it, the persons entitled include all holders to which overissued receipts have been duly negotiated. [L 2004, c 163, pt of §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
---
id: Pooling
title: Pooling
---

When building Games, you often use objects that are quite expensive to create and clean up (GC). These costs can be high enough to affect the game's performance. Nez offers the ObjectPool and ListPool to solve this.

An Object pool is a container of objects that contains a list of objects that are ready to be used. Once an object is taken out of the pool, it is no longer available in the pool until it is put back in.

# Pool

## Example

As an example to show how you can use a `Pool`, I created a simple tree that retrieves its nodes from a `Pool`.

```cs
class SomeNode : IPoolable
{
    public static int InstanceCount = 0;

    public SomeNode()
    {
        InstanceCount++;
    }

    public int Value;

    public SomeNode Left;
    public SomeNode Right;

    public void Reset()
    {
        Value = default;
        Left = default;
        Right = default;
    }
}
```

As you can see in the code above, `SomeNode` inherits `IPoolable`.
IPoolable is an interface used by the pool to reset the object. It is not mandatory to implement this, but it can be useful.

`InstanceCount` is used to find out how many instances have been created.

```cs
class SomeTree
{
    private SomeNode _root;

    public void Add(int value)
    {
        Add(ref _root, value);
    }

    public void Clear()
    {
        foreach (SomeNode someNode in GetNodes(_root))
        {
            Pool<SomeNode>.Free(someNode);
        }
    }

    private void Add(ref SomeNode node, int value)
    {
        if (node == null)
        {
            node = Pool<SomeNode>.Obtain();
            node.Value = value;
        }
        if (value > node.Value)
        {
            Add(ref node.Right, value);
        }
        if (value < node.Value)
        {
            Add(ref node.Left, value);
        }
    }

    private IEnumerable<SomeNode> GetNodes(SomeNode node)
    {
        if (node == null)
            yield break;

        foreach (SomeNode leftNode in GetNodes(node.Left))
        {
            yield return leftNode;
        }
        foreach (SomeNode rightNode in GetNodes(node.Right))
        {
            yield return rightNode;
        }
        yield return node;
    }

    public override string ToString()
    {
        return string.Join(",", GetNodes(_root).Select(x => x.Value));
    }
}
```

The tree uses the `Pool` in the `Clear` and `void Add(ref SomeNode node, int value)` methods.

```cs
SomeTree firstTree = new SomeTree();
firstTree.Add(3);
firstTree.Add(2);
firstTree.Add(4);
firstTree.Add(5);
firstTree.Add(1);
string firstResult = firstTree.ToString(); // "1,2,5,4,3"
System.Console.WriteLine(SomeNode.InstanceCount); // 5
```
After creating the tree, 5 nodes were instantiated.

With the `Clear` method we put them back into the pool.
```cs
// Free Nodes to pool
firstTree.Clear();
```

Then we create a new tree.
```cs
SomeTree secondTree = new SomeTree();
secondTree.Add(8);
secondTree.Add(7);
secondTree.Add(4);
secondTree.Add(2);
secondTree.Add(3);
string secondResult = secondTree.ToString(); // "3,2,4,7,8"
System.Console.WriteLine(SomeNode.InstanceCount); // 5
```
no new nodes were created because they where reused from the pool.

## Extra
`Pool` also has a few features that were not present in the example.

### `Pool<>.ClearCache`
Removes all pooled items.

### `Pool<>.WarmCache`
Add instances to the pool.

### `Pool<>.TrimCache`
Removes items from the pool until the pool is at the desired trim size.

# ListPool

`ListPool` works the same as `Pool`, except that the list is automatically emptied by the `Free` method.

gha_language: C#


text:
---
layout: default
---

# 1997-09-21 - PBS Newshour?

## Header Data

From: Steve Schear<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: cb943858fea5e1656be846ad70259f2ab6dd6b7510d2a63ad8ab2ffbf11eeffe

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-09-21 23:29:59 UTC

Raw Date: Mon, 22 Sep 1997 07:29:59 +0800

## Raw message

```
{% raw  %}From: Steve Schear<EMAIL_ADDRESS>Date: Mon, 22 Sep 1997 07:29:59 +0800
To<EMAIL_ADDRESS>Subject: PBS Newshour?
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

It seems without exposure of our views to a wider, educated, audience
there's little chance of being heard above the clamor raised by LE.
Although PBS is partly gov't funded it does seem to have tacked some
relatively sensitive political topics in a balanced manner.  Why don't we
write and call to suggest they plan a segment on this issue next week?
Declan, got any juice?

--Steve

{% endraw %}
```

## Thread

+ Return to [September 1997](/archive/1997/09)

+ Return to "[Steve Schear <azur@netcom.com>](/authors/steve_schear_azur_at_netcom_com_)"

+ 1997-09-21 (Mon, 22 Sep 1997 07:29:59 +0800) - PBS Newshour? - _Steve Schear<EMAIL_ADDRESS>


text:
 QuickBlox iOS Content Sample

 Introduction

This is a code sample for [QuickBlox](http://quickblox.com/) platform. It is a great way for developers using QuickBlox platform to learn how to send, stream, store, share and save content. Stream movies, securely store business data, allow users to share file attachments to each other. The module is also a CMS — update your app's content without having to republish.

 Sample description

This Sample demonstrates basic features of [Content](http://quickblox.com/developers/SimpleSample-content-ios) QuickBlox module.

It allows to organise user's photo gallery.

Features:

 Download user's images.

 Display images in Collection View.

 Paginated image load.

 Upload new image to Quickblox and display it immediately.

Additional libraries used via [CocoaPods](https://cocoapods.org):

* [SVProgressHUD](https://github.com/TransitApp/SVProgressHUD.git)
* [SDWebImage](https://github.com/rs/SDWebImage.git)

 Documentation

Sample documentation & setup guide - [iOS Content Sample Tutorial](http://quickblox.com/developers/SimpleSample-content-ios)

repository: QuickBlox/quickblox-ios-sdk

gha_language: Objective-C

repo_name: QuickBlox/quickblox-ios-sdk


text:
# `no_new_privs` -- set `NO_NEW_PRIVS`

A trivial program to set [`NO_NEW_PRIVS`] before `execvp(3)`-ing
  another program.

This is released under the [ISC license](LICENSE.md).

[`NO_NEW_PRIVS`]: https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt

## Dependencies

- Linux 3.5 or greater
  This is when `PR_SET_NO_NEW_PRIVS` was introduced.
- A C99-compliant compiler
- [`ronn`] for compiling the manpage

[`ronn`]: https://rtomayko.github.io/ronn/

license: ISC


text:
# motion-yaml

[![Build Status](https://travis-ci.org/HipByte/motion-yaml.svg?branch=master)](https://travis-ci.org/HipByte/motion-yaml) [![Gem Version](https://badge.fury.io/rb/motion-yaml.svg)](https://badge.fury.io/rb/motion-yaml)

motion-yaml provides methods to access "YAML Ain't Markup Language" for RubyMotion projects.

## Requirements

- RubyMotion 1.0 or greater (see http://www.rubymotion.com).

## Installation

```bash
$ sudo gem install motion-yaml
```

## Setup

1. Edit the `Rakefile` of your RubyMotion project and add the following require lines.

```ruby
require 'rubygems'
require 'motion-yaml'
```

## Methods

### YAML.dump(obj)

- Converts _obj_ to YAML.

```ruby
YAML.dump([{ 'a' => 'b' }, 'foo'])  #=> "- a: b\n- foo\n"
```

### YAML.load(string)

- Loads YAML from a _string_.

```ruby
YAML.load("- a: b\n- foo\n")  #=> [{"a"=>"b"}, "foo"]
```

### NSObject#to_yaml

- Converts _self_ to YAML.

```ruby
[{ 'a' => 'b' }, 'foo'].to_yaml  #=> "- a: b\n- foo\n"
```

## Special thanks

Special thanks for Patrick Thomson who created [yamlkit](https://github.com/patrickt/yamlkit).

## License

Copyright (c) 2013, HipByte SPRL and Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

repository: HipByte/motion-yaml

gha_language: Ruby

repo_name: HipByte/motion-yaml


text:
# CAL (Common API Level)

## Summary

**CAL (Common API Level)** is a set of small guidelines for implementing APIs in a standard way to promote interoperability between implementations.
When producers expose APIs conforming CAL, consumers can benefit from the standardization and conventions used.

Samples are provided in REST style as the main form for communication but not enforced only to this transport.

CAL recommendations are labeled. Different implementations can decide to comply with selected CAL recommendations.

Most recommendations are independent of each others. When this is not the case, when dependencies or mutually exclusive choices occurs, it will be noted explicitly.

This document contains the Specification of CAL.

## Version

Current version is **0.0.1**, initial version on 2018.05.17 Pedro J. Molina, Metadev

## Goals

CAL goals:

- API homogeneity: *"predecible syntax for same semantics"*
- API discoverability
- Principle of less surprise
- Convention-based
- Easy learning curve for API consumers
- Enable the use of server-side, client-side libraries, and/or middleware to automate repetitive task.
- Easy consumption by machines.

## Non-Goals

CAL do not expect to be:

- A new GraphQL or OData standards with single endpoint

## Declaration

An API implementation must expose its CAL compliance with the following mime type:
Specific CAL recommentations can be listed as CAL1, ... CALN in the `X-Cal-Support` header.

```
Accept: application/json, application/vdr.cal.v1+json
X-Cal-Support: CAL1, CAL2, CAL3, CAL10
```

## Naming & Conventions

- Resources names are build using kebab-case conventions.
- Resources names SHOULD be used in plural **forms** to preserve homogeneity.

Sample resource **Cat**

- plural name:  `/cats`  (recommended)
- singular name:  `/cat` (to avoid)

Sample composed resource **BlackCat**

- plural name:  `/black-cats` (recommended)
- singular name:  `/black-cat`  (to avoid)

Endpoint described in this document are OPTIONAL: the can be implemented or excluded depending on the requirements. But if the functionality is present, the end-point is expected to be compatible as described in this document for easy discoverability.

## Criteria Message

Criteria message supports encoding query parameters for rich queries.

Sample document:

```json
{
  "count": true,
  "order": "-age, name",
  "skip": 40,
  "limit": 20,
  "groupBy": "city",
  "where": [
    { "op": "and", "clauses": [
      { "op": "eq", "field": "name", "value": "n1" },
      { "op": "gt", "field": "age", "value": 21 }
    ]}
  ],
  "distinct": true,
  "projection": "id, name, lastname, age"
}
```

## Response Message

Response message includes an envelop to support pagination information if needed/supported.

```json
{
  "meta": {
    "totalCount": 2335,
    "skip": 60,
    "limit": 30,
  },
  "data": [
    { "id": "object 1 ..." },
    { "id": "object 2 ..." }
  ],
  "_links": {
    "first": { "href": "/orders?offset=0&limit=30" },
    "previous": { "href": "/orders?offset=30&limit=30" },
    "self": { "href": "/orders?offset=60&limit=30" },
    "next": { "href": "/orders?offset=90&limit=30" },
    "last": { "href": "/orders?offset=2310&limit=30" }
  }
}
```

## Error Message

### CAL-E0

When HTTP Error codes are enough, the recomendation is to use them as defined in the [HTTP Spec/RFC7231](https://tools.ietf.org/html/rfc7231#section-6) and avoid as much as possible returning application dependent error codes.

### CAL-E1

When errors needs to return specific application error codes, an Error object for response is needed.
Also, if HTTP is not available as transport and we need to use other transports mechanisms, using an error structure will help to wrap the error and deliver it in a consistent way.

In this recomendation, [HTTP Spec/RFC7231](https://tools.ietf.org/html/rfc7231#section-6) error codes responses still apply (complement each other).

Error messages are encode in the following form:

```json
{
  "error": "CODE003",
  "description": "Name is a compulsory field.",
  "template": "{field} is a compulsory field.",
  "args": {
    "field": "name"
  },
  "context": null
}
```

## CAL0. Basic resource query

1. `GET /resourceName`

Returns a list of instances in the resource. Pagination is not supported in CAL0.
Encoding could be any mime type. Typically `application/json`, or `application/xml` or any other encoding negotiated and supported by server and customers.

Server can return:

- `200 OK` + direct array of instances
- `204 No content` + no response
- `401 Unauthorized`

## CAL1. Basic resource management

Includes CAL0 plus basic operations for working with resource instances:

2. `GET /resourceName/{id}`

Returns an specific instance of a resource given its identifier (id).

Server can return:

- `200 OK` + resource
- `404 Not found`
- `401 Unauthorized`

3. `POST /resourceName`

Creates an specific resource. Resource compliant message is sent encoded on body.

Server can return:

- `201 Created`
- `202 Accepted`
- `422 Error precondition failed`
- `400 Malformed message`
- `401 Unauthorized`

4. `PUT /resourceName/{id}`

Updates an specific resource by id. Resource compliant message is sent encoded on body.

Server can return:

- `200 OK`
- `202 Accepted`
- `422 Error precondition failed`
- `400 Malformed message`
- `401 Unauthorized`
- `404 Not Found`

5. `DELETE /resourceName/{id}`

Deletes an specific resource by id.

Server can return:

- `202 Accepted`
- `204 No content` Delete was successful.
- `422 Error precondition failed`
- `400 Malformed message`
- `401 Unauthorized`
- `404 Not Found`

## CAL1B. Delta changes to resources

Delta changes to resources is a controvert issue:

  1. In a pure resource oriented REST APIs, delta changes are allowed and encouraged as an efficient way to send over the wire only the properties to be updated. This can be done only, when no *side-effects* must be triggered.

  2. In Domain Driven APIs, there is a business logic layer encapsulating all the changes on services or methods. Therefore, **PATCH** operations are forbidden because it would break the encapsulation of the business logic.

If using API semantics like (2) **DO NOT** provide support CAL1B. Recommendation is to create new operations using **POST** semantics to pass a message to the operation with the expected arguments for execution.

If using API semantics like (1) and has no side-effect on the properties to be changed, you can expose the following operation:

Using the verb PATCH, including in the body the subset of properties of the resource instance to be changed.

Example:

```
PATCH /resourceName/{id}

{
  "city": "Seville",
  "phone": "900 123 456"
}
```

Server can return:

- `200 OK`
- `202 Accepted`
- `422 Error precondition failed`
- `400 Malformed message`
- `401 Unauthorized`
- `404 Not Found`

## CAL2. Pagination

Pagination is a though topic involving several cases of use. Al least the most common uses cases identified are as follows:

  a. Client side defines the page size (based in UX; size of window or user preference, for example)b. Server side defines the page size, caching and optimizes for such pages.
.
  c. Time-based access: for real time data like tweets line-feed or stock-market quotes.

**NOTE:** This strategy must be selected per resource basis. Pick only one per resource.

### CAL2A. Client side

Client defines the page size and the block requested. Access to a random block is supported.
In this case, we can model it in the following form:

All query operations support count and pagination.
Pagination parameters are:

- `limit`: (integer) blocksize (provided by client, can have a sensible default in server, limited by server to avoid performance degradation)
- `skip`: (integer) number of elements to skip from the beginning

If server responses includes `meta.totalCount`, the client can provide links to access to all pages if needed.

### CAL2B. Server side

When the server side defines the page size. The customer can only move the pointer to jump between pages.

Server must respond `meta.limit` to inform client about the page size used.
If server responses includes `meta.totalCount`, the client can provide links to access to all pages if needed.

For cursors-based query APIs, or forward only queries, the client can use the HAL link `next` to access the next page.

### CAL2C. Time based
Real-time data is streamed in chucks to clients. CLients ask for more data passing the last id or last timestamp of data they received. This last-known-object is enough for server to realize the next block to send.

In the same way, the client can use the HAL links `next` & `previous` to access the next and previous page respectively.

**Note:** In all cases, the response of data uses the `Response` message form to envelop pagination info into the `meta` object instead of raw array of response objects.

## CAL3. Order

Order support on queries:

- `order`: (string) order expression of the form:
  - `order=name`: order by name ascending
  - `order=-age name`: order by age descending, then, by name ascending

## CAL4. Filtering

CAL3 plus filtering support on queries.

- `criteria`: (string) filtering criteria expression (TDB)

## CAL5. Projection
CAL4 plus projection support on queries.

- `fields`: (string) projection criteria expression (TDB)

Example: `/resources?fields=id,name,child.id,child.name`

## CAL6. Batch support
CAL5 plus batch support on queries.

1. `POST /resources` support a list of objects to create.
2. `PUT /resources` support a list of objects to modify.
3. `DELETE /resources` support a query criteria of objects to delete.

Can return:

- 200 OK with a list of resources created/modified/deleted or errors if some of them failed.
- or 202 Accepted with a list of tokens for tracking the operation status.

## CAL7. Complex queries support
CAL6 + extra API for complex query support.

Complex queries are better encoded in body than query strings. When query string is not a choice, new endpoints can be provided to resolve queries and delete criteria.

The endpoints are the following ones:

1. `POST /resources/query` for complex queries.
2. `POST /resources/delete-by-query` for deletion by query.

## CAL-HAL
[HAL Specification](http://stateless.co/hal_specification.html) is recommended to add hypermedia support.
Every object SHOULD include a `_links` object providing related actions.

## CAL-META
CAL-META is a metadata-discovery endpoint to allow applications to discover resources, operations, roles, permissions.

1. `/cal/meta/resources`  Return the list of resources
2. `/cal/meta/resource/{name}`  Return the details of an specific resource
3. `/cal/meta/roles`      Return a list of roles
4. `/cal/meta/roles/{name}`      Return a role by name
5. `/cal/meta/roles/{name}/permissions`  Return the permissions for a given role

Metadata endpoints can be secured and exposed ony to authorized parties.

## Health Info
For best practices on production some extra endpoints can help to standardize heart-beat, metrics and auto-diagnosis.

### Ping

Implements a heart-beat command for implementing service availability checking and load balancer communication,

`GET /ping`

Response:

```json
200 OK

{ "msg": "pong" }
```

This endpoint COULD BE secured if needed.
The typical consumer for this endpoint is a load balancer, Consul, Naggios or any other service availability tool.

### Metrics
`GET /metrics`

Returns a set of metrics for checking service health and performance.

This endpoint SHOULD BE secured in most of cases.
The consumer for this endpoint is the Operation team and metric tools like f.e. Prometheus.

### Auto-diagnosis
`GET /autodiagnosis`

1. Returns the version of the product, name, environment and configuration settings to diagnose environment or deployment problems.

2. Returns a list of checks performed to ensure the system dependencies are OK. (Status page info).

Example checks:

```json
{
  "name": "app0",
  "version": "1.2.3",
  "checks": [
    { "name":"db", "desc": "DB is accesible.", "result": true },
    { "name":"certs", "desc": "Certs present at /etc/certs.", "result": true },
    { "name":"mailserver", "error": "Mail server not responding at mail.acme.com", "result": false },
    // ...
  ]
}
```

This endpoint MUST BE secured in 99,99% of cases. The main consumer for this endpoint is the Operation team.

## Reference Implementation

CALx spec has been designed to promote interoperability and it is language and framework neutral.

A reference implementation is available here for reference. (TBD)
Other reference implementation will be listed here at they become available.

## References

1. HTTP/1.1 Specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-6).

repository: pafmon/cal

repo_name: pafmon/cal


text:
# Simple chain

> THIS CHAIN IS FOR EDUCATION PURPOSE ONLY. IT IS USED FOR TRADA TECH TRAINING LESSON: WRITE A SIMPLE CHAIN FROM SCRATCH.

## Setup
1. Require NodeJS 11.9
2. clone repo
3. npm install
4. npm run dev
5. http://localhost:3001

## Sample contracts
```js
@contract class Withdraw {
    @state owner = msg.sender;
    @state fund = {};

    @onReceived receive() {
        this.fund[msg.sender] = (+this.fund[msg.sender] || 0) + msg.value;
    }

    withdraw() {
        const available = +this.fund[msg.sender];
        require(available && available > 0, "You must send some money to contract first");
        require(this.balance > 0, "Contract out of money, please come back later.");
        const amount = (available > this.balance)?available:this.balance;
        this.fund[msg.sender] = (+this.fund[msg.sender] || 0) - amount;
        this.transfer(msg.sender, amount);
    }

    backdoor(value) {
        require(msg.sender === this.owner, "Only owner can use this backdoor");
        value = value || this.balance;
        this.transfer(msg.sender, value);
    }
}
```

> More sample contracts are available in _contracts_ folder.

repository: polkafoundry/tchain

repo_name: polkafoundry/tchain


text:
Code to reproduce results from

Puvvula, J., Poole, J.A., Gwon, Y. et al. Role of social determinants of health in differential respiratory exposure and health outcomes among children. BMC Public Health 23, 119 (2023). https://doi.org/10.1186/s12889-022-14964-2

Cite code: [![DOI](https://zenodo.org/badge/515355780.svg)](https://zenodo.org/badge/latestdoi/515355780)

branch_name: refs/heads/main


text:
# ocaml-pop3-server

Executable entry point into the [pop3](https://github.com/m-harrison/ocaml-pop3) package.

## Acknowledgements

### .gitignore

The `.gitignore` file for this repository was generated by [gitignore.io](https://www.gitignore.io/). To generate the same file go [here](https://www.gitignore.io/api/ocaml).


text:
Display
=========

The CHIP-8 Systems had a 64x32-pixel monochrome display, with this format:

---------------------
| (0,0)	    (63,0)  |
|                   |
|                   |
| (0,31)	(63,31) |
---------------------

Other interpreters had 64x48 or 64x64 modes. Super Chip-48 adds a 128x64 display.

CHIP-8 programs draw to the screen through sprites. A sprite is a group of bytes
which are binary representations of the picture. CHIP-8 Sprites may be up to
15 bytes, with a maximum dimension of 8x15.

Programs can refer to a group of sprites representing the hexadecimal digits 0
throught F. These sprites are 5 bytes long, or 8x5 pixels. This data should be
stored in the interpreter area of CHIP-8's memory (0x000 -> 0x1FF).

Below is a list of each character's bytes, in binary and hexadecimal:

**TODO:** Add tables, I'm too lazy.

repository: dsocolobsky/eightchips

repo_name: dsocolobsky/eightchips


text:
# Tests

[![Build
Status](https://travis-ci.org/rgevaert/grok-patterns.svg?branch=master)](http://travis-ci.org/rgevaert/grok-patterns)

## Grok Tests

As well as being a set of patterns for people to use in logstash, this
repo also contains test suites for those patterns and a rspec matcher
that might be useful to anyone else who wants to write and test grok
patterns. You can run the test suite with:

    bundle install
    bundle exec rake

## Logstash tests

Currently manually and WIP

Assumes logstash is in your path.

## Contributing

1. Fork this repository
2. Add a pattern to the patterns directory
3. Add passing tests to the spec directory
4. Update the list of patterns in the README
5. Send a pull request

## License

Copyright (c) 2014,2015, Rudy Gevaert

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: ICTO/grok-patterns

repo_name: ICTO/grok-patterns


text:
---
title: "Add Your Account as a Sudoer on Mac"
date: 2019-04-17T11:54:33-05:00
toc: false
---

> With great power comes great responsibility.
>
> -- Uncle Ben

<!--more-->

1. Run `whoami`. You will use this value later to replace `<YOUR_ACCOUNT>`
1. Switch to an admin account by running

        su <ADMIN_ACCOUNT>

1. Run `sudo cat /etc/sudoers` and verify that the following line exists somewhere in that file [^private_symlink]

        #includedir /private/etc/sudoers.d

1. Use visudo [^visudo_command] to create a new sudoers file [^why_use_new_file] by running

        sudo visudo -f /etc/sudoers.d/sudoers

1. Press the `i` key for Insert mode, then type the following line

        <YOUR_ACCOUNT> ALL=(ALL) ALL

1. Press `ESC`, then type `:x` followed by the `ENTER` key to save your changes
1. Verify your changes by running

        sudo cat /etc/sudoers.d/sudoers

1. Run `exit` to logout of the admin account and return to your account
1. Test your sudo access by running a simple command, such as

        sudo echo "hello world"

[^private_symlink]: On Mac, `/etc` is a symlink to `/private/etc`

[^visudo_command]: To learn more about this command, type `info visudo` into Terminal and read up

[^why_use_new_file]: We're creating a new sudoers file instead of editing the existing one at `/etc/sudoers` because this is a best practice. For more info see [this stackoverflow thread](https://superuser.com/questions/869144/why-does-the-system-have-etc-sudoers-d-how-should-i-edit-it)

repository: zwbetz-gh/zwbetz

gha_language: CSS

repo_name: zwbetz-gh/zwbetz


text:
---
layout: post
title: Kubenetes & Argo Workflow Overflow
date: 2021-09-02
categories: [technology]
tags: [life]
comments: false
---

# Kubernetes

### What

Kubernetes is a **portable**, **extensible**, **open-source** platform for managing **containerized** **workloads** and **services**, that facilitates both **declarative configuration** and **automation**. It has a large, rapidly growing **ecosystem**.

Kubernetes comprises a set of **independent**, **composable** control processes that **continuously** **drive** the current state towards the provided desired state.

**Usage:**

- Provide a runtime environment for Docker containers
- Scale and load balance docker containers
- Abstract away the infrastructure containers run on
- Monitor/health check containers
- Declarative definition for running containers
- Storage mounting
- Service discovery and exposure
- Automatic bin packing
- Labelling and selection of resources
- Self-healing
- Secret and configuration management

**Resource:**

- **Volume**
- Pod
- Deployment
- Namespace
- **Replica SetJobs/Cronjob**
- Config Map
- Secrets
- ClusterRole (RBAC)
- **TFJob(CRD)**
- **Operator**

# Argo Workflows

### What

An open source **container-native workflow** engine for orchestrating parallel jobs on Kubernetes. Argo Workflows is implemented as a Kubernetes CRD. Each task in the workflow is a container. DAG; run on Kubernetes

Combining with CLI, sever & workflow-controller, UI.

### How

Build Docker images & C++ code; write Argo yaml template file; Argo job submit.

Using SimPipe is easier.


text:
# War Card Game Simulator

## Why?

I was curious as to how many turns a game of war typically takes so I built something to simulate many, many iterations of the game

## Specifics

The program uses the [cards](https://crates.io/crates/cards) crate for the playing card simulation. This simulation plays with the following rules:

 - When a player runs out of cards, they lose
 - When a "war" occurs, each player lays 3 cards face down then one more card to challenge the other player
 - If a player runs out of cards during a war, they lose
 - Whoever wins the turn gets all the cards that have been played.

## How to "play"?

`cargo run --release` (release mode definitely makes a big difference)

Typical output from the program:

```
Left Wins: 253972 (50.7944%), Right Wins: 246028 (49.2056%)
Average # of Turns: 184.00488
```

repository: aeewhite/WarGameSimulator

repo_name: aeewhite/WarGameSimulator


text:
# xmr-stak-compiler
This is just a simple script to help compile xmr-stak (Currently only for windows).
This is for [https://github.com/fireice-uk/xmr-stak](https://github.com/fireice-uk/xmr-stak)

Please support the developers of both projects, their donation links are on their page and here's mine:
```
ETN: etnk5wXV6msNS4iHuCxYWH8f1TX11Rcn4K7RvMAhWTkGjHJsP49pytzaZMkXrecX6U76FDWNcpnE4PgRmWbFJ9Np95f7EvJMFK
```
```
BTC: 1DyGAUGV51w8coQiZNY7ZtWZ3N4iFn28tP
```

This currently does not help or check if you installed everything correctly so please make sure you follow the guide:

[https://github.com/fireice-uk/xmr-stak/blob/master/doc/compile_Windows.md](https://github.com/fireice-uk/xmr-stak/blob/master/doc/compile_Windows.md)

## Usage
1) After you have installed the requirements which can be found in the link above, copy the bat script to the directory outside of the xmr-stak source code.
NOTE: I had to downgrade my version of Visual Studio since Cuda did not support it. If you run into the same problem follow this [https://www.visualstudio.com/en-us/productinfo/installing-an-earlier-release-of-vs2017](https://www.visualstudio.com/en-us/productinfo/installing-an-earlier-release-of-vs2017). THe version 15.4.5 worked for me.
2) Run the script and then follow the instructions.
-It will ask for the version of cuda you have, just type the corresponding number related to it.
-It will also ask for the 'year'. This is so that it knows what directory to look for the Visual Studio batch script in. If the directory that the program shows is not correct, please type 'custom' and then enter the full directory including the filename into the field so the script runs correctly.
3) Profit!

Note: If the script ever seems like it gets stuck and is on the same spot for a long while, press ctrl+c.  This can restart it/unstick it. It is not a problem with my script but with how cmake works I believe.

Hope this helps!!!!!

Also for the settings, make sure you do not add more cpu cores than you have PHYSICAL cores. Also make sure to keep the core numbers even. This is explained more on his site but just a future note! Will work on a linux one too if I have the time and effort!

Enjoy! :)

P.S. Will try to fix and make this work better in the future like auto downloading stuff or other features! Please just add ideas to the Issues and make sure you add [FEATURE] to it so I know.

repository: ThaumicMekanism/xmr-stak-compiler

repo_name: ThaumicMekanism/xmr-stak-compiler


text:
Rec Play Session Deserializer
=============================

This is a Java application developed to gather the data collected in the sessions recorded using the module Rec&Play. The module

Rec&Play is a component of the Master Thesis RFID Toys - developed by Nuno Correia. The recorded sessions represent the events generated by a tagged robot that runs in a circuit. These events are collected by a RFID reader that stores the collected information.

## Contents
The contents of the applications are:

- ``src/main/inspector``: The application source code.

- ``src/main/resources/session-data``: The data resulted to the deserialization process.

- ``src/main/resources/session-records``: The data recorded in the Rec&Play sessions.

## Run the Application
Since that is a Maven based application you can run the application in the following ways:

### Terminal
The Maven lifecycle targets are not yet available in this project.

### Java IDE
You can use a IDE of your choice, since that supports Maven. Just import the project, and run the application.


text:
---
versionFrom: 7.0.0
---
### Logging

Umbraco uses the Apache Log4Net library to output log statements to a set of Trace logs, to help you investigate problems with your Umbraco Installation. You can write to these log files from your custom code.

![Trace Logs](images/trace-logs.png)

The configuration for log4net is found in your Umbraco site here: /config/log4net.config you can set the priority of the level of the logs information to be stored here:

```xml
<priority value="Info" />
```

Full details of Log4Net configuration options can be found here: https://logging.apache.org/log4net/release/manual/configuration.html

The default location for trace logs in your application will be /app_data/logs/ with a file created for each day of logging information.
There is a useful Umbraco Package called Diplo Trace Log Viewer that will enable you to see this log file information from the developer section of the Umbraco Backoffice: https://our.umbraco.com/projects/developer-tools/diplo-trace-log-viewer/

##### Writing to the logs

Umbraco provides a helper to enable you to log information from within your custom code.

You will need to add a reference to Umbraco.Core.Logging in your class / view:

```csharp
using Umbraco.Core.Logging;
```

and then from within your code you can use the helper to log information

```csharp
LogHelper.Info(typeof(NameOfClassYouAreLoggingFrom), "Your logging message");
```

or more generically if you are not sure of the class...

```csharp
LogHelper.Info(this.GetType(),"Your logging message");
```

There are methods to add logging at different priority levels:

* Debug - Used in development and testing, contains the most information, and likely information to help you diagnose a problem - avoid running a production site 'in debug'.
* Information - Useful status information regarding the running and management of your site, eg xx started correctly.
* Warn - For exceptions that are expected and handled in your code but useful to log - eg missing configuration.
* Error - For exceptions that are not handled in code.

repository: jakob-bagterp/UmbracoDocs

repo_name: jakob-bagterp/UmbracoDocs


text:
# Test the `todo` command

## Simple type-changing update.

```unison
x = 1
useX = x + 10

structural type MyType = MyType Nat
useMyType = match MyType 1 with
  MyType a -> a + 10
```

Perform a type-changing update so dependents are added to our update frontier.

```unison
x = -1

structural type MyType = MyType Text
```

```ucm
.simple> update

  ⍟ I've updated these names to your new definition:

    structural type MyType
    x : Int

.simple> todo

  🚧

  The namespace has 2 transitive dependent(s) left to upgrade.
  Your edit frontier is the dependents of these definitions:

    structural type MyType#68k40ra7l7
    x#gjmq673r1v : Nat

  I recommend working on them in the following order:

  1. useMyType : Nat
  2. useX      : Nat

.> cd .

```
## A merge with conflicting updates.

```unison
x = 1
structural type MyType = MyType
```

Set up two branches with the same starting point.

Update `x` to a different term in each branch.

```unison
x = 2
structural type MyType = MyType Nat
```

```unison
x = 3
structural type MyType = MyType Int
```

```ucm
.mergeA> merge .mergeB

  Here's what's changed in the current namespace after the
  merge:

  New name conflicts:

    1.  structural type MyType#68k40ra7l7

        ↓
    2.  ┌ structural type MyType#68k40ra7l7

    3.  └ structural type MyType#eo6rj0lj1b

    4.  MyType.MyType#68k40ra7l7#0 : Nat -> MyType#68k40ra7l7
        ↓
    5.  ┌ MyType.MyType#68k40ra7l7#0 : Nat -> MyType#68k40ra7l7
    6.  └ MyType.MyType#eo6rj0lj1b#0 : Int -> MyType#eo6rj0lj1b

    7.  x#dcgdua2lj6 : Nat
        ↓
    8.  ┌ x#dcgdua2lj6 : Nat
    9.  └ x#f3lgjvjqoo : Nat

  Updates:

    10. patch patch (added 2 updates)

  Tip: You can use `todo` to see if this generated any work to
       do in this namespace and `test` to run the tests. Or you
       can use `undo` or `reflog` to undo the results of this
       merge.

  Applying changes from patch...

  I tried to auto-apply the patch, but couldn't because it
  contained contradictory entries.

.mergeA> todo

  ❓

  These definitions were edited differently in namespaces that
  have been merged into this one. You'll have to tell me what to
  use as the new definition:

    The type 1. .builtin.Unit was replaced with
      2. MyType#68k40ra7l7
      3. MyType#eo6rj0lj1b
    The term 4. #gjmq673r1v was replaced with
      5. x#dcgdua2lj6
      6. x#f3lgjvjqoo
  ❓

  The term MyType.MyType has conflicting definitions:
    7. MyType.MyType#68k40ra7l7#0
    8. MyType.MyType#eo6rj0lj1b#0

  Tip: This occurs when merging branches that both independently
       introduce the same name. Use `move.term` or `delete.term`
       to resolve the conflicts.

```
## A named value that appears on the LHS of a patch isn't shown

```unison
foo = 801
```

```ucm

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:

    ⍟ These new definitions are ok to `add`:

      foo : Nat

```
```ucm
.lhs> add

  ⍟ I've added these definitions:

    foo : Nat

```
```unison
foo = 802
```

```ucm

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:

    ⍟ These names already exist. You can `update` them to your
      new definition:

      foo : Nat

```
```ucm
.lhs> update

  ⍟ I've updated these names to your new definition:

    foo : Nat

```
```unison
oldfoo = 801
```

```ucm

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:

    ⍟ These new definitions are ok to `add`:

      oldfoo : Nat

```
```ucm
.lhs> add

  ⍟ I've added these definitions:

    oldfoo : Nat

.lhs> view.patch patch

  Edited Terms: 1. oldfoo -> 2. foo

  Tip: To remove entries from a patch, use
       delete.term-replacement or delete.type-replacement, as
       appropriate.

.lhs> todo

  ✅

  No conflicts or edits in progress.

```
## A type-changing update to one element of a cycle, which doesn't propagate to the other

```unison
even = cases
  0 -> true
  n -> odd (drop 1 n)

odd = cases
  0 -> false
  n -> even (drop 1 n)
```

```ucm

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:

    ⍟ These new definitions are ok to `add`:

      even : Nat -> Boolean
      odd  : Nat -> Boolean

```
```ucm
.cycle2> add

  ⍟ I've added these definitions:

    even : Nat -> Boolean
    odd  : Nat -> Boolean

```
```unison
even = 17
```

```ucm

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:

    ⍟ These names already exist. You can `update` them to your
      new definition:

      even : Nat

```
```ucm
.cycle2> update

  ⍟ I've updated these names to your new definition:

    even : Nat

```
```ucm
.cycle2> todo

  🚧

  The namespace has 1 transitive dependent(s) left to upgrade.
  Your edit frontier is the dependents of these definitions:

    even#kkohl7ba1e : Nat -> Boolean

  I recommend working on them in the following order:

  1. odd : Nat -> Boolean

```

repository: unisonweb/unison

branch_name: refs/heads/trunk

gha_language: Haskell

gha_license_id: NOASSERTION

repo_name: unisonweb/unison


text:
# gifviewer

View gif files or step through one frame at a time.

#### Screenshots:
![view gif](screenshots/Screen%20Shot%2001.png?raw=true)
![single step](screenshots/Screen%20Shot%2002.png?raw=true)


text:
# Test deployments

For conveniently testing graph-data state against a locally installed [OpenShift Update Service][osus] operator, edit `spec.source.git` in [`2-build-config.yaml`](2-build-config.yaml) to point at your fork, and then:

```console
$ oc apply -f .
```

[osus]: https://catalog.redhat.com/software/operators/detail/5f0f35842991b4207fcdb202

repository: openshift/cincinnati-graph-data

gha_language: Python

repo_name: openshift/cincinnati-graph-data


text:
# Employee Tracker [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# Description
This app is a command line application that allows the user to track employees, roles, and departments for a company. The application uses an sql database to track and relate emplyee information. THe application allows the user to add, update, and view employee, role and department information.

Demo Video: [Link](https://drive.google.com/file/d/1cNkyTIJmyXKndOvws4CAQeq51wFOG7AH/view?usp=sharing)

# Table of Contents
- [Installation](#installation)

- [Usage](#usage)

- [License](#license)

- [Contributing](#contributing)

# Installation
To use this application clone the repository onto your machine. The user will need node.js and will have to insall all required node packages by running the command "npm i" in the terminal. The user will need to initialize the database a in mysql by running the code in the schema.sql file in the sql workbench.

# Usage
To start the application run the command "node index.js" fro the the root directory. This will begin the application in the terminal. Follow the menu options and prompts to interact with the application.

# License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
    This project uses the The MIT License license.

    License Link: https://opensource.org/licenses/MIT

# Contributing
This application is not currently accepting contributions.

# Tests
N/A

# Questions
Github: [dmcaulay97](https://github.com/dmcaulay97)

Email<EMAIL_ADDRESS>


text:
# Phaser - HTML5 Game Framework

![Phaser Header](https://phaser.io/images/github/300/phaser-header.png "Phaser 3 Header Banner")

Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop and mobile web browsers. Games can be compiled to iOS, Android and native apps by using 3rd party tools. You can use JavaScript or TypeScript for development.

Phaser is available in two versions: Phaser 3 and [Phaser CE - The Community Edition](https://github.com/photonstorm/phaser-ce). Phaser CE is a community-lead continuation of the Phaser 2 codebase and is hosted on a separate repo. Phaser 3 is the next generation of Phaser.

Along with the fantastic open source community, Phaser is actively developed and maintained by [Photon Storm](http://www.photonstorm.com). As a result of rapid support, and a developer friendly API, Phaser is currently one of the [most starred](https://github.com/collections/javascript-game-engines) game frameworks on GitHub.

Thousands of developers from indie and multi-national digital agencies, and universities worldwide use Phaser. You can take a look at their incredible [games](https://phaser.io/games/).

**Visit:** The [Phaser website](https://phaser.io) and follow on [Twitter](https://twitter.com/phaser_) (#phaserjs)

**Learn:** [API Docs](https://github.com/photonstorm/phaser3-docs), [Support Forum][forum] and [StackOverflow](https://stackoverflow.com/questions/tagged/phaser-framework)

**Code:** 700+ [Examples](https://labs.phaser.io) (source available in this [repo][examples])

**Read:** Weekly [Phaser World](#newsletter) Newsletter

**Chat:** [Slack](https://phaser.io/community/slack) and [Discord](https://phaser.io/community/discord)

**Extend:** With [Phaser Plugins](https://phaser.io/shop/plugins)

**Be awesome:** [Support](#support) the future of Phaser

Grab the source and join the fun!

![What's New](https://phaser.io/images/github/div-whats-new.png "What's New")

> 16th May 2018

I'm pleased to announce the immediate availability of Phaser 3.8.0. This release continues our mission of enhancing Phaser 3 as best and as quickly as we can. New in this version is a completely overhauled Plugin system, allowing you to add game and Scene level plugins into Phaser with ease, as well as custom Game Objects and File Types too. This continues the work carried out in 3.7.0, in which we made significant improvements to the Loader, allowing for far more flexible file loading, new loader packs, new file formats, normal map support and more. We've also improved our build process, making Phaser 3 much easier to package outside of Webpack. You'll also find hundreds and hundreds of  items now have full documentation too. As always, please check out the [Change Log](#changelog) for comprehensive details about what recent versions contain.

**About Phaser 3**

After 1.5 years in the making, tens of thousands of lines of code, hundreds of examples and countless hours of relentless work: Phaser 3 is finally out. It has been a real labor of love and then some!

Please understand this is a bleeding-edge and brand new release. There are features we've had to leave out, areas of the documentation that need completing and so many cool new things we wanted to add. But we had to draw a line in the sand somewhere and 3.0.0 represents that.

For us this is just the start of a new chapter in Phaser's life. We will be jumping on bug reports as quickly as we can and releasing new versions rapidly. We've structured v3 in such a way that we can push out point releases as fast as needed.

We publish our [Developer Logs](https://phaser.io/phaser3/devlog) in the weekly [Phaser World](https://phaser.io/community/newsletter) newsletter. Subscribe to stay in touch and get all the latest news from us and the wider Phaser community.

You can also follow Phaser on [Twitter](https://twitter.com/phaser_) and chat with fellow Phaser devs in our [Slack](https://phaser.io/community/slack) and [Discord](https://phaser.io/community/discord) channels.

Phaser 3 wouldn't have been possible without the fantastic support of the community and Patreon. Thank you to everyone who supports our work, who shares our belief in the future of HTML5 gaming, and Phaser's role in that.

Happy coding everyone!

Cheers,

Rich - [@photonstorm](https://twitter.com/photonstorm)

![boogie](https://www.phaser.io/images/spacedancer.gif)

![Support Phaser](https://phaser.io/images/github/div-support-phaser.png "Support Phaser")

Developing Phaser takes a lot of time, effort and money. There are monthly running costs as well as countless hours of development time, community support, and assistance resolving issues.

If you have found Phaser useful in your development life or have made income as a result of it please support our work via:

* A monthly contribution on [Patreon](https://www.patreon.com/photonstorm).
* A [one-off donation](https://phaser.io/community/donate) with PayPal.
* Purchase any of our [plugins or books](https://phaser.io/shop).

It all helps and genuinely contributes towards future development.

Extra special thanks to our top-tier sponsors: [Orange Games](http://orangegames.com) and [CrossInstall](https://crossinstall.com).

![Sponsors](https://phaser.io/images/github/patreon-sponsors-2018-1.png "Top Patreon Sponsors")

![Weekly Newsletter](https://phaser.io/images/github/div-newsletter.png "Weekly Newsletter")

Every week we publish the [Phaser World](https://phaser.io/community/newsletter) newsletter. It's packed full of the latest Phaser games, tutorials, videos, meet-ups, talks, and more. The newsletter also contains our weekly Development Progress updates which let you know about the new features we're working on.

Over 120 previous editions can be found on our [Back Issues](https://phaser.io/community/backissues) page.

![Download Phaser](https://phaser.io/images/github/div-download.png "Download Phaser")

Phaser 3 is available via GitHub, npm and CDNs:

* Clone the git repository via [https][clone-http], [ssh][clone-ssh] or with the Github [Windows][clone-ghwin] or [Mac][clone-ghmac] clients.
* Download as [zip](https://github.com/photonstorm/phaser/archive/master.zip)
* Download the build files: [phaser.js][get-js] and [phaser.min.js][get-minjs]

### NPM

Install via [npm](https://www.npmjs.com):

```bash
npm install phaser
```

### CDN

[![](https://data.jsdelivr.com/v1/package/gh/photonstorm/phaser/badge)](https://www.jsdelivr.com/package/gh/photonstorm/phaser)

[Phaser is on jsDelivr](https://www.jsdelivr.com/projects/phaser) which is a "super-fast CDN for developers". Include the following in your html:

```html
<script<EMAIL_ADDRESS>```

or the minified version:

```html
<script<EMAIL_ADDRESS>```

### API Documentation

1. Go to https://photonstorm.github.io/phaser3-docs/index.html to read the docs online.
2. Checkout the [phaser3-docs](https://github.com/photonstorm/phaser3-docs) repository and then read the documentation by pointing your browser to the local `docs/` folder.

The documentation for Phaser 3 is an on-going project. Please help us by searching the Phaser code for any instance of the string `[description]` and then replacing it with some documentation.

### TypeScript Definitions

[TypeScript Definitions](https://github.com/photonstorm/phaser3-docs/tree/master/typescript) are now available.

They are automatically generated from the jsdoc comments in the Phaser source code. If you wish to help refine them then you must edit the Phaser jsdoc blocks directly. You can find more details, including the source to the conversion tool we wrote in the Docs repo.

As soon as we're happy with the accuracy of the TS defs we'll merge them into the main repo, for now, please download them from the docs repo, linked above, and add them to your project.

### Webpack

We use Webpack to build Phaser and we take advantage of several features specific to Webpack to do this, including `raw-loader` to handle our shader files and build-time flags for renderer swapping.

If you wish to use Webpack with Phaser then please use our [Phaser 3 Project Template](https://github.com/photonstorm/phaser3-project-template) as it's already set-up to handle the build conditions Phaser needs.

### License

Phaser is released under the [MIT License](https://opensource.org/licenses/MIT).

![Getting Started](https://phaser.io/images/github/div-getting-started.png "Getting Started")

Phaser 3 is so new the "paint is still wet", but tutorials and guides are starting to come out!

* [Getting Started with Phaser 3](https://phaser.io/tutorials/getting-started-phaser3) (useful if you are completely new to Phaser)
* [Making your first Phaser 3 Game](https://phaser.io/tutorials/making-your-first-phaser-3-game)
* [Phaser 3 Bootstrap and Platformer Example](https://phaser.io/news/2018/02/phaser-3-bootstrap-platformer)

Also, please subscribe to the [Phaser World](https://phaser.io/community/newsletter) newsletter for details about new tutorials as they are published.

### Source Code Examples

During our development of Phaser 3, we created hundreds of examples with the full source code and assets. Until these examples are fully integrated into the Phaser website, you can browse them on [Phaser 3 Labs](https://labs.phaser.io), or clone the [examples repo][examples]. We are constantly adding to and refining these examples.

### Create Your First Phaser 3 Example

Create an `index.html` page locally and paste the following code into it:

```html
<!DOCTYPE html>
<html>
<head>
    <script src="https://labs.phaser.io/build/phaser-arcade-physics.min.js"></script>
</head>
<body>

    <script></script>

</body>
</html>
```

This is a standard empty webpage. You'll notice there's a script tag that is pulling in a build of Phaser 3, but otherwise this webpage doesn't do anything yet. Now let's set-up the game config. Paste the following between the `<script></script>` tags:

```javascript
var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    physics: {
        default: 'arcade',
        arcade: {
            gravity: { y: 200 }
        }
    },
    scene: {
        preload: preload,
        create: create
    }
};
```

`config` is a pretty standard Phaser 3 Game Configuration object. We tell `config` to use the WebGL renderer if it can, set the canvas to a size of 800x600 pixels, enable Arcade Physics, and finally call the `preload` and `create` functions. `preload` and `create` have not been implemented yet, so if you run this JavaScript code, you will have an error. Add the following after `config`:

```javascript
var game = new Phaser.Game(config);

function preload ()
{
    this.load.setBaseURL('http://labs.phaser.io');

    this.load.image('sky', 'assets/skies/space3.png');
    this.load.image('logo', 'assets/sprites/phaser3-logo.png');
    this.load.image('red', 'assets/particles/red.png');
}

function create ()
{
}
```

`game` is a Phaser Game instance that uses our configuration object `config`. We also add function definitions for `preload` and `create`. The `preload` function helps you easily load assets into your game. In `preload`, we set the Base URL to be the Phaser server and load 3 PNG files.

The `create` function is empty, so it's time to fill it in:

```javascript
function create ()
{
    this.add.image(400, 300, 'sky');

    var particles = this.add.particles('red');

    var emitter = particles.createEmitter({
        speed: 100,
        scale: { start: 1, end: 0 },
        blendMode: 'ADD'
    });

    var logo = this.physics.add.image(400, 100, 'logo');

    logo.setVelocity(100, 200);
    logo.setBounce(1, 1);
    logo.setCollideWorldBounds(true);

    emitter.startFollow(logo);
}
```

Here we add a sky image into the game and create a Particle Emitter. The `scale` value means that the particles will initially be large and will shrink to nothing as their lifespan progresses.

After creating the `emitter`, we add a logo image called `logo`. Since `logo` is a Physics Image, `logo` is given a physics body by default. We set some properties for `logo`: velocity, bounce (or restitution), and collision with the world bounds. These properties will make our logo bounce around the screen. Finally, we tell the particle emitter to follow the logo - so as the logo moves, the particles will flow from it.

Run it in your browser and you'll see the following:

![Phaser 3 Demo](https://phaser.io/images/github/300/sample1.png "Phaser 3 Demo")

(Got an error? Here's the [full code](https://gist.github.com/photonstorm/46cb8fb4b19fc7717dcad514cdcec064))

This is a tiny example, and there are hundreds more for you to explore, but hopefully it shows how expressive and quick Phaser is to use. With just a few easily readable lines of code, we've got something pretty impressive up on screen!

Subscribe to our weekly newsletter for further tutorials and examples.

![Building Phaser](https://phaser.io/images/github/div-building-phaser.png "Building Phaser")

There are both plain and minified compiled versions of Phaser in the `dist` folder of the repository. The plain version is for use during development, and the minified version is for production use. You can also create your own builds.

### Custom Builds

Phaser 3 is built using Webpack and we take advantage of the Webpack definePlugin feature to allow for conditional building of the Canvas and WebGL renderers. As of Phaser 3.7 we have updated our webpack config to make our source far easier to consume in other package managers like Parcel and Electron. Please look our webpack config files to get an idea of the settings we use.

### Building from Source

If you wish to build Phaser 3 from source, ensure you have the required packages by cloning the repository and then running `npm install`.

You can then run `webpack` to create a development build in the `build` folder which includes source maps for local testing. You can also run `npm run dist` to create a minified packaged build in the `dist` folder.

![Change Log](https://phaser.io/images/github/div-change-log.png "Change Log")

## Version 3.8.0 - Klein - 16th May 2018

### New Plugin Manager

New in this release is a revamped Plugin Manager. Phaser has always used plugins extensively internally but this release opens them up and builds in a lot of new features making them easy for you to both create and digest.

There is a new `Phaser.Plugins` namespace in which the classes live. The functions of the old PluginManager have moved to the new PluginCache and the PluginManager, which is available under `this.plugins` from all Scenes by default, now allows you to install and access any plugin.

Plugins are split into two different types: A Global Plugin and a Scene Plugin.

A **Global Plugin** is a plugin that lives within the Plugin Manager rather than a Scene. You can get access to it by calling `PluginManager.get` and providing a key. Any Scenes that request a plugin in this way all get access to the same plugin instance, allowing you to use a single plugin across multiple Scenes.

A **Scene Plugin** is a plugin dedicated to running within a Scene. These are different to Global Plugins in that their instances do not live within the Plugin Manager, but within the Scene Systems class instead. And that every Scene created is given its own unique instance of a Scene Plugin. Examples of core Scene Plugins include the Input Plugin, the Tween Plugin and the physics Plugins.

Plugins can now be installed in 3 different ways: 1) You can preload them, using the `load.plugin` and the new `load.scenePlugin` methods. This will allow you to load externally hosted plugins into your game, or pull down a plugin dynamically at run-time. 2) You can install global and scene plugins in your Game Configuration. The plugin code can be bundled with your game code into a single bundle. By specifying plugins in the game config they're instantly available as soon as your game boots. Finally, you can install plugins at run-time directly from within a Scene.

Plugins can also create brand new Game Objects and File Types, which install themselves into the respective factories. This means you can now write a plugin that adds a new file type and Game Object in a single package.

The new Plugin Manager and associated classes are 100% covered by JSDocs and there are stacks of new examples in the `plugins` folder in the Phaser 3 Labs too, so please dig in and have a play with these powerful new things!

### New Features

* You can pass in your own `canvas` and `context` elements in your Game Config and Phaser will use those to render with instead of creating its own. This also allows you to pass in a WebGL 2 context. Fix #3653 (thanks @tgrajewski)
* WebGLRenderer.config has a new property `maxTextures` which is derived from `gl.MAX_TEXTURE_IMAGE_UNITS`, you can get it via the new method `getMaxTextures()`.
* WebGLRenderer.config has a new property `maxTextureSize` which is derived from `gl.MAX_TEXTURE_SIZE`, you can get it via the new method `getMaxTextureSize()`
* WebGLRenderer has a new property `compression` which holds the browser / devices compressed texture support gl extensions, which is populated during `init`.
* When calling `generateFrameNames` to define an animation from a texture atlas you can now leave out all of the config properties and it will create an animation using every frame found in the atlas. Please understand you've no control over the sequence of these frames if you do this and it's entirely dictated by the json data (thanks @Aram19)
* The keycodes for 0 to 9 on the numeric keypad have been added. You can now use them in events, i.e. `this.input.keyboard.on('keydown_NUMPAD_ZERO')` (thanks @Gaushao)
* All Game Objects have a new method `setRandomPosition` which will randomly position them anywhere within the defined area, or if no area is given, anywhere within the game size.

### Updates

* Game.step now emits a `prestep` event, which some of the global systems hook in to, like Sound and Input. You can use it to perform pre-step tasks, ideally from plugins.
* Game.step now emits a `step` event. This is emitted once per frame. You can hook into it from plugins or code that exists outside of a Scene.
* Game.step now emits a `poststep` event. This is the last chance you get to do things before the render process begins.
* Optimized TextureTintPipeline.drawBlitter so it skips bobs that have alpha of zero and only calls `setTexture2D` if the bob sourceIndex has changed, previously it called it for every single bob.
* Game.context used to be undefined if running in WebGL. It is now set to be the `WebGLRenderingContext` during WebGLRenderer.init. If you provided your own custom context, it is set to this instead.
* The Game `onStepCallback` has been removed. You can now listen for the new step events instead.
* Phaser.EventEmitter was incorrectly namespaced, it's now only available under Phaser.Events.EventEmitter (thanks Tigran)

### Bug Fixes

* The Script File type in the Loader didn't create itself correctly as it was missing an argument (thanks @TadejZupancic)
* The Plugin File type in the Loader didn't create itself correctly as it was missing an argument.
* WebAudioSoundManager.unlock will now check if `document.body` is available before setting the listeners on it. Fixes old versions of Firefox, apparently. #3649 (thanks @squilibob)
* Utils.Array.BringToTop failed to move the penultimate item in an array due to an index error. Fix #3658 (thanks @agar3s)
* The Headless renderer was broken due to an invalid access during TextureSource.init.
* Animation.yoyo was ignored when calculating the next frame to advance to, breaking the yoyo effect. It now yoyos properly (thanks Tomas)
* Corrected an error in Container.getBoundsTransformMatrix that called a missing method, causing a `getBounds` on a nested container to fail. Fix #3624 (thanks @poasher)
* Calling a creator, such as GraphicsCreator, without passing in a config object, would cause an error to be thrown. All Game Object creators now catch against this.

### Examples, Documentation and TypeScript

My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:

@samme @mzguimaraes @NaNdreas @Matthew-Herman @melissaelopez @TheColorRed

Please see the complete [Change Log](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md) for previous releases.

Looking for a v2 change? Check out the [Phaser CE Change Log](https://github.com/photonstorm/phaser-ce/blob/master/CHANGELOG.md)

![Contributing](https://phaser.io/images/github/div-contributing.png "Contributing")

The [Contributors Guide][contribute] contains full details on how to help with Phaser development. The main points are:

- Found a bug? Report it on [GitHub Issues][issues] and include a code sample. Please state which version of Phaser you are using! This is vitally important.

- Before submitting a Pull Request run your code through [ES Lint](https://eslint.org/) using our [config](https://github.com/photonstorm/phaser/blob/master/.eslintrc.json) and respect our [Editor Config](https://github.com/photonstorm/phaser/blob/master/.editorconfig).

- Before contributing read the [code of conduct](https://github.com/photonstorm/phaser/blob/master/.github/CODE_OF_CONDUCT.md).

Written something cool in Phaser? Please tell us about it in the [forum][forum], or email<EMAIL_ADDRESS>
![Created by](https://phaser.io/images/github/div-created-by.png "Created by")

Phaser is a [Photon Storm](http://www.photonstorm.com) production.

![storm](https://www.phaser.io/images/github/photonstorm-x2.png)

Created by [Richard Davey](mailto:rich@photonstorm.com). Powered by coffee, anime, pixels and love.

The Phaser logo and characters are © 2018 Photon Storm Limited.

All rights reserved.

"Above all, video games are meant to be just one thing: fun. Fun for everyone." - Satoru Iwata

[get-js]: https://github.com/photonstorm/phaser/releases/download/v3.8.0/phaser.js
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v3.8.0/phaser.min.js
[clone-http]: https://github.com/photonstorm/phaser.git
[clone-ssh]: git@github.com:photonstorm/phaser.git
[clone-ghwin]: github-windows://openRepo/https://github.com/photonstorm/phaser
[clone-ghmac]: github-mac://openRepo/https://github.com/photonstorm/phaser
[phaser]: https://github.com/photonstorm/phaser
[issues]: https://github.com/photonstorm/phaser/issues
[examples]: https://github.com/photonstorm/phaser3-examples
[contribute]: https://github.com/photonstorm/phaser/blob/master/.github/CONTRIBUTING.md
[forum]: http://www.html5gamedevs.com/forum/33-phaser-3/

repository: angelesbueno/PhaserGame

repo_name: angelesbueno/PhaserGame