text:
---
title: Converting Editor Templates to Snippets
weight: '20'
---

# Converting Editor Templates to Snippets

## Overview

In Aptana Studio 2, there was an option for users to have editor templates, which could be used to include multiple template tags. This functionality can be accomplished in Aptana Studio 3 through the use of snippets. This page will show how to convert existing editor templates to Aptana Studio 3.

::: warning ⚠ Warning
We assume you've read through our section on [creating snippets](/guide/Axway_Appcelerator_Studio/Axway_Appcelerator_Studio_Guide/Customizing_Studio/Snippets/Creating_a_New_Snippet/) before and have a basic understanding of how snippets work.
:::

## Exporting Existing Editor Templates from Aptana Studio 2

::: warning ⚠ Warning
You can also use editor templates that other users have already exported. In that case, you may not need to export them from your installation of Studio 2.
:::

The editor templates are located under Aptana Studio 2 preferences. For example, if you would like to export your javascript templates, try the following:

1. Navigate to Preferences and go to Aptana > Editors > JavaScript > Templates.

2. Highlight all the templates that you would like to export.

3. Click on Export...

4. Select the destination for your exported templates.

![Export_Editor_Templates](./Export_Editor_Templates.png)

## Editor Template Format

The editor template should be in an XML format. The top-level XML node should be a `<templates>` node, with `<template>` nodes as children.

Here is an example of an editor template with a single entry:

```javascript
<templates>
<template autoinsert="true" context="com.aptana.ide.editors.contextType.text/javascript" deleted="false" description="Function" enabled="true"
        id="com.aptana.ide.editors.js.templates.function.tm" name="fun">function ${name} (${args}) {
  ${cursor}
}</template>
</templates>
```

## Converting a template entry

In this section, we will reference the editor template above and convert the template entry into a snippet. From the example above, each `<template>` node would correspond to a snippet that will want to add to your ruble.

As you may know from the [Creating a New Snippet](/guide/Axway_Appcelerator_Studio/Axway_Appcelerator_Studio_Guide/Customizing_Studio/Snippets/Creating_a_New_Snippet/) section, there are three key items for a snippet (trigger, expansion, and scope). The relationship between the template node and the key items are as follows:

* trigger: The 'name' attribute.

* expansion: The content inside the `<template>` node.

* scope: The editor scope where this snippet will be active (in this case, it would be javascript).

The description attribute of "Function" also corresponds to the description of the snippet.

The snippet for the template would look like:

```javascript
snippet "Function" do |s|
  s.trigger = "fun"
  s.expansion = "function ${1:name} (${2:args}) {
  ${3:cursor}
}"
end
```

repository: sgtcoolguy/titanium-docs

repo_name: sgtcoolguy/titanium-docs


text:
obs settings » audio:
  sample rate = 48khz

obs settings » output:
  output mode = advanced

obs settings » recording:
  type = custom output (ffmpeg)
  ffmpeg output type = output to url
  file path or url = icecast://source:hackme@<IP_ADDRESS>:8000/the.h264
  container format = h264 (video)
  muxer settings (if any) =
  video bitrate = 2500 kbps
  keyframe interval (frames) = 30
  rescale output [ ]
  [x] show all codecs (even if potentially incompatible)
  video encoder = libx264
  video encoder settings (if any) = -tune zerolatency -preset veryfast -g 30 -crf 26 -profile:v baseline -coder 0 -bf 0 -flags -loop -wpredp 0
  audio encoder = disable encoder

obs settings » video:
  downscale filter = lanczos
  common fps values = 30

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
doepipeline
===========

This is yet another pipeline package. What distinguishes `doepipeline` is
that it enables pipeline optimization using methodologies from statistical
`Design of Experiments (DOE) <https://en.wikipedia.org/wiki/Design_of_experiments>`_

Pipeline-config
---------------

The pipeline is specified in a YAML config file. Example:

    design:
        # Design type is case insensitive
        type: BoxBehnken

        factors:
            # Factors are quantitiative unless specified otherwise. The factor
            # names probably works with spaces as well (Todo: test that).
            FactorA:
                # Minimum value.
                min: 0
                # Maximum value.
                max: 40
                # Low initial value.
                low_init: 0
                # High initial value.
                high_init: 20
            FactorB:
                min: 0
                max: 4
                low_init: 1
                high_init: 2
            FactorC:
                low_init: 140
                high_init: 160

        responses:  # One or more.
            ResponseA:
                criterion: maximize

    # File where final results are dumped. One file per "experiment" will be
    # produced.
    results_file: my_results.txt

    working_directory: ~/my_work_directory

    pipeline:
        # Specifies order of jobs. These names must match the job-names below.
        - MyFirstJob
        - MySecondJob
        - MyThirdJob

    MyFirstJob:
        # The script can be multi-line.
        script: >
            bash first_script_command.sh {% FactorB %} -o $MY_DIR
        factors:
            # The factors must match factors in the design.
            FactorA:
                # If script_option is given, the current factor value will be
                # added as a option to the job-script.
                script_option: --factor_a
            FactorB:
                # If substitute is given (and true), the script's {% FactorC %}
                # will be replaced with the current factor value.
                substitute: true

    MySecondJob:
        script: >
            bash my_second_script.sh --expressionWithFactors {% FactorC %}
        factors:
            FactorC:
                substitute: true

    MyThirdJob:
        script: python make_output.py -o {% results_file %}

    before_run:  # Optional setup.
        environment_variables:
            # Variables which will be set in the execution environment of
            # the pipeline run.
            MY_DIR: ~/my/dir/
        scripts:
            - ./a_script_to_run_before_starting.sh
            - python a_second_one.py

The key-value pairs are specified below.
### `design`

Specifies factors and responses to investigate as well as what design to use in key-value mapping. Valid keys specifying design are:

* `type`: Required. Design to use. Available choices (case-insensitive) are:
    * `ccc`/ `ccf`/ `cci`: Central composite designs.
    * `fullfactorial2levels`/`fullfactorial3levels`
    * `placketburman`
    * `boxbehnken`
* `factors`: Required. Mapping of one or more factors.
    * `<factor-name>`: Keys are name used for factor and will be used for substitutions. Values are specified below.
* `responses`: Required. Mapping of one or more response.
    * `<response-name>`: Keys are name used for response, values are specified below.
* `screening_reduction`: Optional. `auto` (default) or positive integer. Specifies reduction factors used for GSD during screening.

### `<factor-name>`
Specification of each factor. Valid keys specifying factors are:
* `type` Optional. Type will be quantitative if not specified. Valid values are:
    * `quantitative`: Default. Numeric factor which can take real values.
    * `ordinal`: Numeric factor constrained to integer values.
    * `categorical`: Categorical values.
* `low_init`: Required for numeric factors. Low starting value.
* `high_init`: Required for numeric factors. High starting value.
* `max`: Optional for numeric factors. Maximum allowed value, default is positive infinity.
* `min`: Optional for numeric factors. Minimum allowed value, default is negative infinity.
* `values`: Required for categorical factors. Possible values.
* `screening_levels`: Optional for numeric factors. Number of levels investigated during screening phase. Default is 5.
### `<response-name>`
Specification of a response. Valid keys specifying responses are:

* `criterion`: Required for all responses. Valid values are:
    * `maximize` / `minimize`: Response will be maximized or minimized respectively.
    * `target`: Reach target value (optimum is neither above nor below value)
* `target`: Required when there are multiple responses for responses for any criterion.
* `low_limit`: Required when there are multiple responses for responses with criterion `target`or `maximize`, optional otherwise. Indicates lowest acceptable value.
* `high_limit`: Required when there are multiple responses for responses with criterion `target` or `minimize`, optional otherwise. Indicates highest acceptable value.
* `transform`: Optional. Indicates what transform used prior to optimization: Valid values are:
    * `log`: Log transformation
    * `box-cox`: [Box-Cox transformation](https://en.wikipedia.org/wiki/Power_transform#Box%E2%80%93Cox_transformation).

### `pipeline`
Required. Ordered list specifying order of jobs. Values are `<job-name>` specified below.

### `<job-name>`

Specification of each job that will be run in the order specified in `pipeline`. Optionally, factors will be substituted.

* `script`: Required. String containing command that will be executed. May use substitution (see below) to parameterize commands. Substitution or appending of script option is required to input factors currently optimized.
* `factors`: Optional. Contains mapping of what factors that should be used in the current experiment. Valid keys are:
    * `<factor-name>`: One of the factors specified in `design`. Each factor must carry one of the two following key-value pairs to indicate how it should be input in the job:
        * `substitute: true`: Factor will be substituted using templating.
        * `script_option: --<option-name>`: A option flag will be appended to the script string. E.g., if `script_option: -a` is provided for factor `FactorA`, then `-a <value-of-FactorA>` will be appended to the script string.

### `results_file`
Required. Indicates the name of the file containing the results from each pipeline run, may be used for substitution. A results-file for each factor setup will be produced in the working-directory for the current experiment.

### `working_directory`
Required. Root directory which will contain the results from all iterations and experiments.

### `before_run`
Optional. Specify setup. Valid keys are:
* `environment_variables`: Key-value pairs of environment variables to be set prior to running pipeline.
* `scripts`: Ordered list of scripts to run prior to running pipeline.

### `constants`
Optional. Key-value pairs of constants accessible for substitution. Keys written in upper-case are interpreted as directories and
can be used for path-substitution.

### Substitution
`doepipeline` uses a simple templating system for substituting factors and other values into scripts. Factors
that should be substituted is wrapped in `{% ... %}`.

Factors are substituted using their names specified in the design.
An example, if the value of `FactorA` should be passed as argument to `my_script.sh` the script
specified in the job is written as `my_script.sh {% FactorA %}`. Special tags available for substitions
are:
* {% results_file %}: Will substitute the tag with the results-file for the current experiment.
* Other constants specified under `constants` not written in capital letters.

Path-substitutions can be used to use files available during the current iteration
or other special directories. Values for path-substitution are indicated by capital letters
and are used as following `{% DIRNAME filename %}`. This will substitute the tag with `DIRNAME/filename`.
Special paths available are:
* `BASEDIR`: Path to the root working-directory, i.e. `working_directory`.
* `WORKDIR`: Path to the current iterations working-directory.
* Other constants specified under `constants` written in capital letters.

repository: druvus/doepipeline

gha_license_id: MIT

repo_name: druvus/doepipeline


text:
irelate.go
==========

Streaming relation (overlap, distance, KNN) testing of (any number of) sorted files of intervals.

Currently supports BED, BAM, GFF, VCF.

[![GoDoc] (https://godoc.org/github.com/jakehagen/irelate?status.png)](https://godoc.org/github.com/jakehagen/irelate)
[![Build Status](https://travis-ci.org/brentp/irelate.svg?branch=master)](https://travis-ci.org/brentp/irelate)
[![Coverage Status](https://coveralls.io/repos/brentp/irelate/badge.svg?branch=master)](https://coveralls.io/r/brentp/irelate?branch=master)

Motivation
----------

We want to relate (e.g. intersect or by distance) sets of intervals. For example, we may want
to report the nearest gene to a set of ChIP-Seq peaks. BEDTools does this extremely well, *irelate*
is an attempt to provide an API so that users can write their own tools with little effort in
[go](https://golang.org).

Design
------

+ data-sources must support the *Relatable* Interface. (we provide parsers for common formats).
+ a user-defined function returns true if 2 *Relatable*'s are related. (only a small number of interval-pairs
  are sent to be tested--this is handled automatically by `IRelate`.). We provide `CheckRelatedByOverlap`
  to perform overlap testing.
+ i.Related() gives access to all of the related intervals (after they are added internally by `IRelate`)
+ the "API" is a for loop
+ A parallel chrom-sweep algorithm is used that avoids problems with chromosome order and parallelizes nicely
  up to about a dozen CPUs.

Example
-------

(also see [main/main.go](https://github.com/jakehagen/irelate/blob/master/main/main.go) which
is similar to bedtools intersect -sorted -sortout -c)

print the number of `b` alignments that overlap an interval in `a`

```go

// CheckRelatedByOverlap returns true if Relatables overlap.
func CheckRelatedByOverlap(a Relatable, b Relatable) bool {
        // note with distance == 0 this just overlap.
        return (b.Start() < a.End()) && (b.Chrom() == a.Chrom())
}

// determine ordering of Relatables.
func Less(a Relatable, b Relatable) bool {
    if a.Chrom() != b.Chrom() {
        return a.Chrom() < b.Chrom()
    }
    return a.Start() < b.Start() // || (a.Start() == b.Start() && a.End() < b.End())
}

// a and b are channels that send Relatables.
a, _ := bix.New('intervals.bed.gz')
b, _ := bix.New('some.vcf.gz')
for interval := range IRelate(CheckRelatedByOverlap, 0, Less, a, b) {
    fmt.Fprintf("%s\t%d\t%d\t%d\n", interval.Chrom(), interval.Start(), interval.End(), len(interval.Related()))
}
```

The 2nd argument determines the *query* set of intervals. So,
only intervals from `a` (the 0th) source will be sent from IRelate. If this is set to -1, then
all intervals from all sources will be sent. After this, any number of interval streams
can be passed to `IRelate`

If we only want to count variants with a given mapping quality, the loop becomes:

```go
for interval := range IRelate(CheckRelatedByOverlap, 0, Less, a, b) {
    n := 0
    for _, b := range interval.Related() {
         // cast to a bam to ge the mapping quality.
         if int(b.(*Variant).Score()) > 20 {
             n += 1
         }
    }
    fmt.Fprintf("%s\t%d\t%d\t%d\n", interval.Chrom(), interval.Start(), interval.End(), n))
}

```

*note* that *any number* of interval sources are supported even though the example is with 2.
We can see the source of each interval with: `interval.Source()`. That value is set automatically inside
of irelate.

This is a very simple example, but the point of this is that since the interface is a simple function (as in
CheckRelatedByOverlap) and a for loop, it is easy to create custom applications.

For example, here is the function to relate all intervals within 2KB:
```go
// CheckRelatedBy2KB returns true if intervals are within 2KB.
func CheckRelatedBy2KB(a Relatable, b Relatable) bool {
        distance := uint32(2000)
        // note with distance == 0 this just overlap.
        return (b.Start()-distance < a.End()) && (b.Chrom() == a.Chrom())
}

```

Note that we are guaranteed that b.Start() >= a.Start() so the check is quite
simple.

Relatable
---------

a key interface in *irelated* is:

```go
// Relatable provides all the methods for irelate to function.
// See Interval in interval.go for a class that satisfies this interface.
// Related() likely returns and AddRelated() likely appends to a slice of
// relatables. Note that for performance reasons, Relatable should be implemented
// as a pointer to your data-structure (see Interval).
type Relatable interface {
        Chrom() string
        Start() uint32
        End() uint32
        Related() []Relatable // A slice of related Relatable's filled by IRelate
        AddRelated(Relatable) // Adds to the slice of relatables
        SetSource() uint32    // Internally marks the source (file/stream) of the Relatable
}
```

Performance
-----------

irelate is quite fast, but use PIRelate for parallel intersection. It is less flexible
than irelate, but skips parsing of database intervals for sparse regions in the query.
In addition, it has very good (automatic) parallelization.

repository: JakeHagen/irelate

repo_name: JakeHagen/irelate


text:
---
date: 2018-09-17T15:21:22+02:00
title: Quick guide
description: A quick guide to the business extension.
weight: 2
---

The Business extension can be enabled via the Rehive [dashboard](https://dashboard.rehive.com). You can access the list of Rehive extensions in the side bar. Simply activate the Business extension to add it to the platform.

Once activated the business extension settings should be updated to have a list of manager groups that are allowed to create and manage businesses on their user accounts.

<aside class="notice">
	Once the extension is activated you can manage it via the dashboard or alternatively you can make use of the API directly. Do not activate the extension by calling the extension's activate endpoint directly.
</aside>

repository: rehive/docs-portal

gha_language: Dockerfile

repo_name: rehive/docs-portal


text:
# elections_lk

Various data about Sri Lankan elections sourced from the [Election Commision of  Sri Lanka](elections.gov.lk) and the [Department of Census and Statistics of Sri Lanka](statistics.gov.lk).

## Setup and Install

```
pip install elections_lk-nuuuwan
```

See also [https://pypi.org/project/elections-lk-nuuuwan/](https://pypi.org/project/elections-lk-nuuuwan/).

## Release History

### 2.1.3
* example4_racist_voting
* example5_party_continuity
* refactoring

### 2.1.2 (CURRENT RELEASE)
* refactoring

### 2.1.1
* fix: BUG in items_othered (returns proportion, instead of count)

### 2.1.0
* Added ElectionLocalAuthority
* tests & refactoring

### 2.0.0

* Made some significant changes. Will break most code written in 1.x.x. #BREAKING

branch_name: refs/heads/main


text:
---
layout: post
title: Quick Start Guide
categories:
  - Jekyll
  - tutorial
  - other
date: 2018-01-11T00:00:00.000Z
featured: true
image: assets/images/3.jpg
---
If you already **have** a full Ruby **development** environment with all **headers** and RubyGems installed (see Jekyll’s requirements), you can **create** a new **Jekyll** site by doing the **following**:

```ruby
# Install Jekyll and Bundler gems through RubyGems
gem install jekyll bundler

# Create a new Jekyll site at ./myblog
jekyll new myblog

# Change into your new directory
cd myblog

# Build the site on the preview server
bundle exec jekyll serve

# Now browse to http://localhost:4000
```

repository: mountainstorm/Website-Test

repo_name: mountainstorm/Website-Test


text:
F-Spot Photo Manager
http://f-spot.org/

# Chat
* [![Join the chat at https://gitter.im/mono/f-spot](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mono/f-spot?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* Also on #f-spot on gimpnet

# Build Status

| Branch | Status |
|--------|--------|
| Master |[![Build Status](https://travis-ci.org/mono/f-spot.svg?branch=master)](https://travis-ci.org/mono/f-spot)|

# Requirements

	- GNOME development libraries 2.4 or later, http://www.gnome.org

	- Mono 3.8.2 or later, http://www.go-mono.net

	- gtk-sharp 2.12.2 or later, http://www.go-mono.net

	- Sqlite 2.8.6 or later

	- liblcms 2 or later, http://www.littlecms.com/

	- hicolor-icon-theme 0.10 or later, https://www.freedesktop.org/wiki/Software/icon-theme

	- adwaita-icon-theme 3.18.0 or later, https://download.gnome.org/sources/adwaita-icon-theme/3.13

	- taglib-sharp <IP_ADDRESS> or later, https://github.com/mono/taglib-sharp

	- dbus-sharp 0.8 or later, https://github.com/mono/dbus-sharp

	- dbus-sharp-glib 0.6 or later, https://github.com/mono/dbus-sharp-glib

	- NuGet 2.14, if you want to build and run unit tests

The following requirements are automatically installed by make via
NuGet if you enable tests.

	- NUnit 2.6.4

	- Moq 4.2

# Installing missing Certificates

On distributions like Fedora or Mageia, Mono installations come without root certificates installed, and those may not necessarily be synced from the local root certificates as a post installation step either.
So on a fresh install, you may need to use the `cert-sync` tool in order to sync your local root certificates into the Mono truststore

More details in the [Mono 3.12 Release Notes](http://www.mono-project.com/docs/about-mono/releases/3.12.0/#cert-sync)

To invoke the tool manually use

```bash
sudo cert-sync /path/to/ca-bundle.crt
```

On Debian systems, that’s

```bash
sudo cert-sync /etc/ssl/certs/ca-certificates.crt
```

and on Red Hat derivatives (Fedora, CentOS, Mageia, etc...) it’s

```bash
sudo cert-sync /etc/pki/tls/certs/ca-bundle.crt
```

Your distribution might use a different path, if it’s not derived from one of those.

# Build

To compile, just go through the normal `autogen/configure` stuff and
then `make install`.

# Launch

To launch F-Spot, run `$(prefix)/bin/f-spot`.

# With MonoDevelop

If you want to use MonoDevelop to build and run F-Spot here are notes about that process.

There are a few steps you have to run before you can open MonoDevelop:

	1.  ./autogen.sh (on ubuntu you have to do ./autogen.sh)
	2.  cd build; make
	3.  cd lib/libfspot; make
	4.  sudo make install (this will install the libfspot.so files)

OR

	1. ./prep_linux_build.sh prefix={some/path}

I like to do `~/staging`

This will build a couple tools in ./build that are needed to build the projects in ./lib.

Once these two directories are built you can now open monodevelop and build and run f-spot from there.


text:
### Description

#### How can it be manually tested

#### Link to task on Jira

#### Screenshots if any

### Checklist

<!--
- Please mark your choice with an "x" (i.e. [x], see
https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments)
- PR's without test coverage will be closed.
-->

- [ ] My PR does not introduce breaking changes
- [ ] My PR Name summarizes what my code does
- [ ] New tests added or existing tests modified to cover all changes
- [ ] Code conforms with the style guide

repository: sartim/hypertrack-sdk

gha_language: Python

repo_name: sartim/hypertrack-sdk


text:
# Howto integrate a DI container into a Java FX project

This is an example of integration a DI container into a Java FX application.

This example uses the Spring (Boot) container and is based on a JavaFX quickstart project with the [Java FX basic archetype](https://github.com/javafx-maven-plugin/javafx-basic-archetype).

For integration:
* Add the DI-Container setup und shutdown in the `init()` and `stop()`
methods of the main-class.
* In fxml-applications like in this quickstart project, the fxml loaders
controller factory should be replaced with new DI-based factory.
See `SpringFXMLLoader` an its use as an example.

Running Application: `mvn jfx:run` or `mvn spring-boot:run`

Build executable Jar: `mvn clean jfx:jar`

Build nativ Installer: `mvn clean jfx:native`

repository: TMosebach/snippets

repo_name: TMosebach/snippets


text:
---
layout: post
title: A Comparision Between MongoDB and Cassandra
---

MngoDB can be a great alternative to MySQL, but it’s not really
appropriate for the scale-out applications targeted by Cassandra. Still, as
early members of the NoSQL category, the two do draw comparisons.

One important limitation in MongoDB is database-level locking. That is, only
one writer may modify a given database at a time. Support for collection-
level (a set of documents, analogous to a relational table) locking is
planned. With either database- or collection-level locking, other writers or
readers are locked out. Even a small number of writes can produce stalls in
read performance.

Cassandra uses advanced concurrent structures to provide row-level isolation
without locking. Cassandra even eliminated the need for row-level locks for
index updates in the recent 1.2 release.

A more subtle MongoDB limitation is that when adding or updating a field in
a document, the entire document must be re-written. If you pre-allocate
space for each document, you can avoid the associated fragmentation, but
even with pre-allocation updating your document gets slower as it grows.

Cassandra’s storage engine only appends updated data, it never has to re-
write or re-read existing data. Thus, updates to a Cassandra row or
partition stay fast as your dataset grows

Source :
http://www.datastax.com/dev/blog/2012-in-review-performance


text:
# `data-bloodhound` - A toolbox for Data Analysis

> `data-bloodhound` is a toolbox for data analysis written in `Python` and `C++`. The goal of `data-bloodhound` is to facilitate the task of data analysis and further implementation Pattern Recognition and Big Data solutions.

## Requirements

No specific requirements. See 'requirements.txt' file.

## Installation

No installation is required. Just import this module in your code and run. You can also include this module in your
<Python>\lib\site-packages folder, or include the path to the file in your PYTHONPATH variable.

## Support

* Platforms: Win32, Linux, and Mac OS


text:
---
layout: post
title: Installed Elixir---> NOW WHAT?
---

Sat Feb  9 19:44:11 2019

#### Load up you App in REPL(iex)

So I have created a new app. Easy peezy.

```Elixir
mix new podder --sup
```

Although TDD is proposed , I like to play around a bit with what I am building
in the *REPL*
Loading the App created in REPL like this

```Elixir
iex -S mix
```
This loads the Application in the REPL.
We can reload with command
>recompile

#### What will we create

We will create a PodCast app that gets the data from Various Podcasts.
We use Genserver per Podcast name. It will fetch data from the API and then
store data fetched in ETS for each Podcast.

#### GenServer

Genserver starts an Elixir Process and holds its own state.
It has a set of callbacks which can be used to Apply the business Logic.

We start a Genserver per Podcast. I want to name each Genserver as I dont
want to deal with PIDs. For that I use the *:global* atom to store the name
in the Global Module.

```
  def start_link(state, name) do
    GenServer.start_link(__MODULE__, state, name: {:global, name})
  end
```

From iex start the Genserver as:

```
iex(1)> Podder.start_link(%{}, "jabber")
{:ok, #PID<0.134.0>}
iex(2)> Podder.get_episodes({:global, "jabber"})
%{}
iex(3)>
```

The above starts a GenServer with name *jabber* which is registered in the
global Registry

#### Observer

Fire up an Elixir Shell and
```
:observer.start
```

#### Fault Tolerance

Fault Tolerance is baked into the Elixir/Erlang Systems and we will achieve it
with Supervision Trees

So our app will start a Supervision Tree , which will start a
[Dynamic Supervisor](https://hexdocs.pm/elixir/DynamicSupervisor.html)
We need a Dynamic Supervisor as we dont know how many PodCast GenServer we will
be starting when the App Starts.
As and when I add my Favorite PodCast, the Dynamic Supervisor starts a new
Podcast Genserver.

#### More About GenServers

Lets look a little bit more about GenServers

According to Docs
> A GenServer is a process like any other Elixir process and it can be used to keep state, execute code asynchronously and so on.

So the basic structure of our App is as Follows

We have multiple users who will register into the App and subscribe to their
Favorite Podcasts.
For each user we spin up a Genserver using Dynamic Supervisor as mentioned
above.
Each GenServer holds some State, like the Ids of the Podcasts I am Subscribed
to.
It also provides us an interface to search podcasts using wildcard search.

*Note: We use a third party API to get our Podcast Data*

###### Local Registry

All the GenServers we spin up for each user returns us a PID, with which we can
interact with the GenServer. Remembering and storing PIDs is not something I
would like to do, hence we use the Local Process Registry to give the GenServer
a name and basically get the internal pid of the GenServer using the unique
name.

Basically when starting the GenServer we start it with the via module

```
GenServer.start_link(__MODULE__, state, name: via_tuple(user_name))
```

Note the via_tuple it takes the Name and stores it in the Registry

```
defp via_tuple(name), do: {:via, Registry, {Podder.Registry, name}}
```

We can get the PID of the process as below

```elixir
def whereis(name: name), do: Registry.whereis_name({Podder.Registry, name})
```

We also need to start the Registry, so in our main Application we start the
Registry under a Supervisor

```elixir
  def start(_type, _args) do
    # List all child processes to be supervised
    children = [
      # Starts a worker by calling: Podder.Worker.start_link(arg)
      # {Podder.Worker, arg},

      %{
        id: Registry,
        start: {Registry, :start_link, [[keys: :unique, name: Podder.Registry]]}
      },
      %{
        id: Podder.DynamicSupervisor,
        start: {Podder.DynamicSupervisor, :start_link, []}
      }
    ]

    # See https://hexdocs.pm/elixir/Supervisor.html
    # for other strategies and supported options
    opts = [strategy: :one_for_one]
    Supervisor.start_link(children, opts)
  end
	```
The above code starts a Local Process registry and a Dynamic Supervisor when our
Application starts.

###### Genserver callbacks

###### handle_call

When our server needs to return something back to the caller we use the
handle_call.
For our case we use it search for Podcasts and return the search results, we
dont have to modify the state, so we can write like.

```elixir
  def handle_call({:search, query}, from, state) do
    response =
      with {:ok, result} <- Podder.ListenProvider.API.search_podcasts(query) do
        result
        |> Map.get("podcasts")
        |> Enum.map(fn x -> Map.take(x, @fields_podcasts) end)
      else
        _ -> %{}
      end

    {:reply, response, state}
  end
```

	See the return from the function, we query the API( I had used Task.Async to
	query the API before, but thats an overkill)

	Return the response and keep the same state as before. This completes the
	Query interface

	*Note: Our Genserver will be blocked till the Query from the external API
	returns*

####### handle_cast

	We will use this only to change the state and not return any response back to
	the caller

```elixir
	  def handle_cast({:save, items}, state) do
    my_items =
      cond do
        is_list(items) -> items
        true -> [items]
      end

    new_pods = Map.get(state, "podcasts") |> Enum.concat(my_items)
    new_state = Map.put(state, "podcasts", new_pods)
    {:noreply, new_state}
   end
```

	Here we take an item , item is podcast or multiple podcasts that the user has
	subscribed.
	We change our state with new Podcasts the user has subscribed. Note there is
	nothing returned back to the calling process and our Genserver is not blocked.

####### handle_info

	Usually we can run periodic tasks here. We can see later about this.


text:
---
layout: default
title: About Us
description: Since 2009, King Tides organizers have been documenting high water events to sense what is to come with climate change.
---

## Our Mission

King Tides projects help people all over the world understand how sea level rise will impact their local community.  Via smartphones and social media, participants snap and share images of  “king tides” — the extreme tides of today which will be the average water level of the future.

The pictures that people take help scientists and managers better understand and plan for flood risks, and help artists and educators communicate about sea level rise.

### Recent News about King Tides
- [ABC News: People around the world are helping scientists in the fight against climate change by photographing this year's incredible, extreme high tides](https://abcnews.go.com/Technology/wireStory/photos-king-tides-globally-show-risks-climate-change-68768979)
- [Business Insider: Photos of 'king tides' globally show risks of climate change](https://www.businessinsider.com/incredible-pictures-king-tides-show-the-risks-of-climate-change-2020-2)

The King Tides Project has two goals:

1. **Educate the public about sea level rise.** Millions of people  – many of whom are physically, socially, or economically disadvantaged – live in areas which will be vulnerable or uninhabitable within the next 50 years. Yet most people don’t understand these risks, and support for adaptation planning is weak. We aim to help people understand what’s at risk and how they can be part of the adaptation solution.

2. **Create a catalogue of hyperlocal flood risk data for researchers and decision makers.** Around the world, trillions of dollars worth of private property, public infrastructure, and businesses are at risk, but flood prediction models often lack good validation data, and parcel-scale information needed for municipal planning is missing. We help fill those gaps through our innovative citizen science.

## How We Work

Organizers of King Tides projects the world over are part of a network that brings us together to share resources and support each other. Our network openly shares the King Tides experience. We embrace principles of:

- Collaboration
- Open data sharing and creative commons licensing
- Fun
- Diversity and local relevance
- Engaging regular citizens in science
- Curiosity about natural phenomena and the changing world around us
- Responsibility for improving our common future on a shared planet

Organizers do not endorse any political party or candidate through King Tides.  We do support projects that seek to provide resilient, healthy, thriving coastal areas and increase our understanding of climate change.

  We do this through photo-documentation, community mapping, art, and science.  This network of local initiatives is organized by planners, surfers, photographers, landscape architects, teachers, insurers, environmentalists, and others with an interest in the coast.

The contents of this website, and ad hoc coordination of the network is facilitated by two long-time King Tides organizers:

- [Marina Psaros](https://www.linkedin.com/in/mpsaros/) – King Tides Project founder and California King Tides Project organizer, USA
- [Heather Lynn Remacle](https://www.linkedin.com/in/heatherlr/) – King Tides International Network and Communications Lead, British Columbia Canada

The original King Tides outreach campaign was conceived of by Phil Watson of Australia’s Office of Environment and Heritage, Department of the Premier and Cabinet, during the 2009 king tides season.  The same year, project were started in California, Oregon, Washington, and BC Canada. The movement has been growing ever since. [You can be a part of it too by joining a project, starting a project, or partnering with us.](participate)

repository: HeatherRemacle/Kingtides

repo_name: HeatherRemacle/Kingtides


text:
# Corallium cinereum (Bull.) Hahn, 1883 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Pilzsammler 73 (1883)

#### Original name
Clavaria cinerea Bull., 1788

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Cantharellales/Clavulinaceae/Clavulina/Clavulina cinerea/ Syn. Corallium cinereum/README.md

repo_name: mdoering/backbone


text:
# Foreman worker for yggdrasil

This is a POC worker service for yggdrasil that can act as pull client for Foreman.

This is not meant for production use, only as a simple example how to hook into the ygg.

## Hacking

Client is in `foreman_worker`, that includes `yggdrassil_pb.rb` and `yggdrasil_services_pb.rb` to load the gRPC definitions.

For the server side we have the simle `publish_notify.rb` to play around with the server/client MQTT around and get the idea what is going on under the hood.
IRL it would be hooked into the smart_proxy, that will be notifying about the real jobs.

### Preparing gRPC

This is needed only if the ygg protocol will ever change.

Refreshing message and services definitions from proto:

```shell
gem install grpc-tools

grpc_tools_ruby_protoc -I ../yggdrasil/protocol/ --ruby_out=. --grpc_out=. yggdrasil.proto

```

gha_language: Go


text:
# Ansible Role: users

[![Build Status](https://travis-ci.org/linconf/ansible-users.svg?branch=master)](https://travis-ci.org/linconf/ansible-users)
[![Ansible Galaxy](https://img.shields.io/badge/docs-ansible--users-blue.svg)](http://linconf.com/ansible-users/)
[![Ansible Galaxy](https://img.shields.io/badge/galaxy-linconf.users-660198.svg)](https://galaxy.ansible.com/linconf/users/)

An Ansible role that manages users and groups on Debian/Ubuntu and RHEL/CentOS.

## Installation

```
ansible-galaxy install linconf.users
```

## Example Playbooks

**Add a User**

```
- hosts: localhost
  roles:
    - linconf.users
  vars:
    users_accounts:
      - name: 'NewUser'
        group: 'NewUser'
        # Additional Groups
        groups: ['wheel', 'users']
        password: '$6$c6pQJ3kzW80oZwTi$...'
        update_password: 'always'
```

See the [Ansible user module](http://docs.ansible.com/ansible/user_module.html) for a full list of available options.

Password hash created using: `mkpasswd --method=SHA-512`

**Remove a User**

```
users_accounts:
  - name: 'NewUser'
    state: absent
```

**Add a Group**

```
users_groups:
  - name: 'NewGroup'
```

Whenever you add a user to a group that doesn't yet exist on the system (using
the `groups:` option of `users_accounts`) you must also use `users_groups` to
add the group to the system.

**Additional Options**

See the [linconf.users documentation](http://linconf.com/ansible-users/) for a full list of available options.

Optionally, this role has 3 lists for users, and 3 lists for groups. This can be useful in
situations where groups of hosts share the same users.

- `users_accounts: []`
- `users_host_accounts: []`
- `users_group_accounts: []`
- `users_groups: []`
- `users_host_groups: []`
- `users_group_groups: []`

## Dependencies / Requirements

- None

## Testing

The master branch is continuously validated by Travis-CI.

Minor versions indicate the role passed local testing as described by the
`.kitchen` declaration. Instructions for performing test-kitchen runs locally
are detailed in the [LinConf Documentation](http://linconf.com/about/methodology/).

## Author and License

Chad Sheets - [GitHub](https://github.com/cjsheets) | [Blog](http://chadsheets.com/) |<EMAIL_ADDRESS>
Released under the [MIT License](https://tldrlegal.com/license/mit-license)

[![Analytics](https://cjs-beacon.appspot.com/UA-10006093-3/github/linconf/ansible-users?pixel)](https://github.com/linconf/ansible-users)

repository: linconf/ansible-users

repo_name: linconf/ansible-users


text:
# YoJS
YoJS is a dead simple Node.js module for the [Yo](http://justyo.co/) API.

[Just Yo](http://justyo.co/) is the simplest and most efficient (zero) communication tool in the world.

YoJS's goal is simplicity. Because of this there is literally no error handling in the module. If something goes wrong then the response (in the callback) of the Yo API contains the error message and gives a non 200 HTTP status code.

[![NPM](https://nodei.co/npm/yojs.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/yojs)

## Install

* directly from the git repository: ```git clone https://github.com/Anubisss/yojs```
* from the [npm](https://www.npmjs.com/) registry: ```npm install yojs```
* from the [bower](http://bower.io/) registry: ```bower install yojs```

## Usage
```javascript
var YoJS = require('yojs');

 // Your Yo account's API token/key.
 // Or you can set it via the YO_API_TOKEN environment variable.
var yoApiToken = '';
console.log('Trying to Yo...');
YoJS.yo('', yoApiToken, 'yoteam', '', '', function(err, res, body) {
  if (err) {
    console.log('Error: %s', err);
  } else {
    console.log('Success.');
  }
  console.log('res.statusCode: %s', res.statusCode);
  console.log('body: %s', body);
  // If you want to parse the body.
  var parsedBody = JSON.parse(body);
});

```

## Examples
Examples for how to use YoJS are in the example directory. You have to set the YO_API_TOKEN environment variable to try out the examples. YO_API_TOKEN have to contain your Yo account's API token/key.

## More details about the API
If you need more details about Yo's API then you should check this out: http://docs.justyo.co/v1.0/docs

## License
The MIT License (MIT)

repository: Anubisss/yojs

repo_name: Anubisss/yojs


text:
# Gourami

![Github Actions CI](https://github.com/Vydia/gourami/workflows/ci/badge.svg)

Keep your Routes, Controllers and Models thin with Plain Old Ruby Objects (PORO).

## Installation

Add this line to your Gemfile:

```ruby
gem 'gourami'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install gourami

## Usage

### A Typical `Gourami::Form` will

 - Define attributes (inputs & outputs)
 - Validate input
 - Perform an action

```ruby
class TypicalForm < Gourami::Form

  attribute(:typical_attribute)

  def validate
    # Define your validation rules here
  end

  def perform
    # Perform your action rules here
  end

end
```

### Your Rails 5 ActionController for the New/Create action:

```ruby
def new
  @form = CreateFishBowl.new
end

def create
  @form = CreateFishBowl.new(fish_bowl_params)

  if @form.valid?
    @form.perform
    redirect_to @form.record
  else
    render "new"
  end
end
```

### Example of a form that Creates a record

```ruby
class CreateFishBowl < Gourami::Form

  record(:fish_bowl)
  attribute(:width, type: :integer)
  attribute(:height, type: :integer)
  attribute(:liters, type: :float)
  attribute(:name, type: :string)
  attribute(:filter_included, type: :boolean, default: false)

  def validate
    validate_presence(:width)
    validate_range(:width, min: 50, max: 1000)

    validate_presence(:height)
    validate_range(:height, min: 50, max: 1000)

    validate_presence(:liters)
    validate_range(:liters, min: 5, max: 200)

    validate_presence(:name)
    validate_uniqueness(:name) do |name|
      FishBowl.where(name: name).empty?
    end
  end

  def perform
    self.fish_bowl = FishBowl.create(attributes)
  end

end
```

### Your Rails 5 ActionController for the Edit/Update action:

```ruby
def edit
  fish_bowl = FishBowl.find(params[:id])
  @form = UpdateFishBowl.new_from_record(fish_bowl)
end

def update
  @form = UpdateFishBowl.new(fish_bowl_params)

  if @form.valid?
    @form.perform
    redirect_to @form.record
  else
    render "edit"
  end
end
```

### Example of a form that Updates a record

```ruby
class UpdateFishBowl < Gourami::Form

  record(:fish_bowl)
  attribute(:width, type: :integer)
  attribute(:height, type: :integer)
  attribute(:liters, type: :float)
  attribute(:name, type: :string)
  attribute(:filter_included, type: :boolean, default: false)

  def self.new_from_record(fish_bowl)
    new(fish_bowl.attributes.merge(fish_bowl: fish_bowl))
  end

  def validate
    validate_presence(:width)
    validate_range(:width, min: 50, max: 1000)

    validate_presence(:height)
    validate_range(:height, min: 50, max: 1000)

    validate_presence(:liters)
    validate_range(:liters, min: 5, max: 200)

    validate_presence(:name)
    validate_uniqueness(:name) do |name|
      FishBowl.where(name: name).empty?
    end
  end

  def perform
    fish_bowl.update(attributes)
  end

end
```

#### Or inherit instead of duplicating the attributes and validations

```ruby
class UpdateFishBowl < CreateFishBowl

  # All attributes and validations inherited from CreateFishBowl.

  def self.new_from_record(fish_bowl)
    new(fish_bowl.attributes.merge(fish_bowl: fish_bowl))
  end

  def perform
    fish_bowl.update(attributes)
  end

end
```

#### Configure default attribute options

The following examples will result in all `:string` attributes getting the options `:strip` and `:upcase` set to `true`.

Set global defaults:

```ruby
Gourami::Form.set_default_attribute_options(:string, upcase: true)

# Make sure to define CreateFishBowl and other forms AFTER setting default options.
class CreateFishBowl < Gourami::Form
  attribute(:name, type: :string)
end

form = CreateFishBowl.new(name: "Snake Gyllenhaal")
form.name # => "SNAKE GYLLENHAAL"
```

Instead of global defaults, you can also apply defaults to certain form classes.

Just as `attributes` are inherited by subclasses, so are `default_attribute_options`.

Set local defaults:

```ruby
class ScreamingForm < Gourami::Form
  set_default_attribute_options(:string, upcase: true)
end

class CreateScreamingFish < ScreamingForm
  attribute(:name, type: :string)
end

class UpdateScreamingFish < CreateScreamingFish; end

create_form = CreateScreamingFish.new(name: "Snake Gyllenhaal")
create_form.name # => "SNAKE GYLLENHAAL"

update_form = UpdateScreamingFish.new(name: "Snake Gyllenhaal")
update_form.name # => "SNAKE GYLLENHAAL"

# Other Gourami::Forms are unaffected
class RegularForm < Gourami::Form
  attribute(:name, type: :string)
end

regular_form = RegularForm.new(name: "Snake Gyllenhaal")
regular_form.name # => "Snake Gyllenhaal"
```

#### Extensions / Plugins

##### Gourami::Extensions::Changes

Check to see if an attribute is being changed:

```ruby
class UpdateUserEmail < Gourami::Form

  include Gourami::Extensions::Changes

  record(:user)
  attribute(:email, :type => :string, :watch_changes => true)

  def perform
    user.update(attributes)

    do_something_like_send_confirmation_email(email) if changes?(:email)
  end

end
```

###### You can implement custom logic to determine if an attribute is changing

This is the equivalent behavior when you set `:watch_changes => true`

```ruby
attribute(:email, :watch_changes => ->(new_value) { new_value != user.email })
```

Your logic to check for changes can be as sophisticated as you want.

```ruby
class UpdatePageAuthorizedUsers < Gourami::Form

  include Gourami::Extensions::Changes

  record(:page)
  attribute(:authorized_users,
    :type => :array,
    :watch_changes => ->(new_value) { new_value.sort.uniq != page.authorized_users.sort.uniq })

  def perform
    page.update(attributes)

    do_something_like_notify_authorization_libraries(authorized_users) if changes?(:authorized_users)
  end

end
```

You can also keep track of side effects due to changes by using `did_change`.

```ruby
class UpdatePageWidgets < Gourami::Form

  include Gourami::Extensions::Changes

  record(:page)
  attribute(:widgets,
    :type => :array,
    :element_type => :string,
    :watch_changes => ->(new_value) {
      did_change(:pro_widget, new_value.include?("pro"))
      new_value.sort.uniq != page.widgets.sort.uniq
    })

  def validate
    append_error(:widgets, :unauthorized) if changes?(:pro_widget) && !current_user_has_pro_account?
  end

end
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests, or `rake test:watch` to automatically rerun the tests when you make code changes. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`.

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

To add another gem owner to gourami gem `gem owner --add<EMAIL_ADDRESS>gourami`

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Vydia/gourami. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

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

repository: Vydia/gourami

gha_language: Ruby

repo_name: Vydia/gourami


text:
# STM32 on Nim
This repository aims at the working of STM32 on Nim language. Moreover, the startup routine leaves to be written on Nim without assembly.

This program works well on STM32F303K8T6.

# What is implemented
- I/O registers
	- `RCC`
	- `USART1`
	- `GPIOA` .. `GPIOE`
	- `TIM2`
	- `SysTick`
	- `NVIC`
- `volatile` function templates
	- `ld()` for volatile load
		- e.g.) `GPIOA.ODR.ld` for getting the value
	- `st()` for volatile store
		- e.g.) `GPIOA.ODR.st 1` for storing 1 to GPIOA.ODR

# Compile
```bash
$ make
$ make flash
```

If you want to use UART for programming, don't type `make flash` and use flash programmers you like.


text:
# How to contribute

Our project is opened for contributions, and we are always happy to welcome best pieces of code from the Github community. So, **here are some ways you can help us**:

- [Feature requests](#feature)
- [Bug reports](#bug)
- [Pull requests](#pull)
- [More information](#info)

## Time for new features

You can request a new feature by submitting an issue to our [Github Repository](https://github.com/salman-bhai).

## Bug reports

A bug is a *demonstrable problem* that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!

Guidelines for bug reports:

1. **Use the GitHub issue search**. Check if the issue has already been reported.

2. **Check if the issue has been fixed**. Try to reproduce it using the latest master or development branch in the repository.

3. **Provide environment details**. Provide your operating system and browser(s).

4. **Create an isolated and reproducible test case**. Create a reduced test case.

A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report.

* What is your environment?
* What steps will reproduce the issue?
* What browser(s) and OS experience the problem?
* What would you expect to be the outcome?
**All these details** will help people to fix any potential bugs.

### Example:

>Short and descriptive example bug report title
>A summary of the issue and the browser/OS environment in which it occurs. If suitable, include the steps required to reproduce the bug.

>This is the first step

Any other information you want to share that is relevant to the issue being reported. This might include the lines of code that you have identified as causing the bug, and potential solutions (and your opinions on their merits).

## Pull requests
You can send Pull Requests by mentioning the Issue that you are closing and certain description as to what that particular Pull Request does!

## More information
You can find out more detailed information about contributing in the [WhatsApp-Web documentation](README.md)

[README]: https://github.com/salman-bhai/WhatsApp-web/blob/master/README.md
[GitHub]: https://github.com/salman-bhai/WhatsApp-web


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

### Description

Stack-based buffer overflow in an ActiveX control for the installer for Adobe Macromedia Shockwave Player <IP_ADDRESS> and earlier allows remote attackers to execute arbitrary code via crafted large values for unspecified parameters.

### POC

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

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

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# storybook-branches

[![Docker build status](https://img.shields.io/docker/cloud/build/pascalgn/storybook-branches.svg?style=flat-square)](https://hub.docker.com/r/pascalgn/storybook-branches/) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/pascalgn/storybook-branches/blob/master/LICENSE)

Provide [storybook](https://storybook.js.org/) builds for multiple branches and add a dropdown to quickly switch between those branches

    Switching between different versions on branches storybook-1, storybook-2 and storybook-3

## Usage

Start

    docker run --rm \
        -p 9001:9001 \
        -e "REPOSITORY=https://github.com/pascalgn/storybook-branches" \
        -e "BRANCHES=storybook.+" \
        pascalgn/storybook-branches:latest

## Options

The following environment variables are required:

* `REPOSITORY` The URL of the remote repository

Additionally, the following environment variables are supported:

* `DIR` The subdirectory within the repository (default _._)
* `PORT` The port to run the HTTP server on (default _9001_)
* `BRANCHES` Regular expression filter of the branches to build (default _.+_)
* `DEFAULT` Default branch to display (default remote branch will be used if unset)
* `SLEEP` The time to sleep between fetches, in seconds (default _60_)
* `OUTPUT` The output directory (default _dist_)
* `LOG_LEVEL` A [winston](https://github.com/winstonjs/winston) log level (default _info_)

Additionally, the following environment variables are available for
providing SSH keys, to connect to the remote repository:

* `KNOWN_HOSTS` The SSH host keys (stored in `~/.ssh/known_hosts`)
* `ID_RSA` The private SSH key (stored in `~/.ssh/id_rsa`)

## License

MIT

repository: pascalgn/storybook-branches

gha_language: JavaScript

repo_name: pascalgn/storybook-branches


text:
---
layout: kanji-remain
v4: 2526
kanji: 樗
keyword: plotosid
strokes: 15
on-yomi: チョ
permalink: /rtk/樗/
---

## Koohii stories:

1) [astridtops] 6-2-2007(25): We were seeking shelter for the rain under the plotosid tree, but someone had put a double snare there. As if that foul smelling tree wasn't enough trouble already.

2) [cb4960] 10-1-2009(18): ~~ Keyword should be sumac ~~ Sumacs are worthless trees. They don't protect from rain so you shouldn't use them for a ceiling - and they stink so you can't use them to make snares.

3) [marcmiddag] 16-8-2011(5): Keyword is wrong . I replace the keyword with "Deadwood". Story*I was collecting some deadwood when it started raining. I got closer to the tree to shelter myself from the rain, when I suddenly got snared by two branches, and it started strangling me! Guess the tree didn't wanted me to take his deadwood!! (thanks to_nihon) ちょざい 【 樗材 】deadwood —(Usually written using kana alone. ).

4) [Aerin] 22-12-2007(5): Plotosid: Japanese bead tree. The beads of the plotosid tree look like raindrops that have been ensnared by its two branches.

5) [to_nihon] 13-1-2009(4): According to my dictionary, this is a sendan; a Japanese bead tree that is not useless at all; it is sometimes used in the making of instruments and Buddhist statues and such. I was cutting down a sendan tree to make myself a koto, when it started raining. I got closer to the tree to shelter myself from the rain, when I suddenly got snared by two branches, and it started strangling me! Guess the sendan wanted to send an obvious message: don't cut me down!


text:
# zing
A fully extensible compiler and application engine.

**zing** allows for easy creation of graphical or terminal-based applications. Rendering and memory management are handled automatically so developers can focus on more important things.

zing programs may be run from previously compiled code *or* may be compiled and run realtime. The language these programs are written in is up to the user; even the compiler is fully extensible.

Note that this project is in an early stage of development and refactoring.

Depends on [libzed](https://github.com/ZacharyWesterman/libzed).

repository: ZacharyWesterman/zing

repo_name: ZacharyWesterman/zing


text:
# Sclerodepsis maxima (Mont.) Ryvarden, 1972 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Norw. Jl Bot. 19: 236 (1972)

#### Original name
Irpex maximus Mont., 1837

### Remarks
null

path: /life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Trametes/Trametes maxima/ Syn. Sclerodepsis maxima/README.md


text:
---
layout: bookreview
title: "The Icarus Girl"
date: 2019-11-02 13:00
bookfinished: 2019-11-02
rating: 3
---

Icarus Girl is the story of a British girl named Jessamy who visits her extended family in Nigeria, and returns with a rather shadowy problem. That problem is a big question mark: a girl who might be a ghost, or might be a figment of Jessamy's imagination, or might be something else entirely. She is something of a doppelganger for Jessamy, and a nebulously malicious one at that; suitably, Jessamy gives her a nickname that is itself a double, TillyTilly.

This story is a spooky one, and it's inspired by Yoruban folk tales obsessed with the concept of a doppelgangers who appear in the form of evil spirits. The book's title is clearly an illusion to a very different story, the myth of Daedalus and Icarus, which is centered on the possibility of flight and the sin of hubris. If anything Icarus Girl is something of a dualistic complement to the Icarus myth, since it is centered on the terror of the underworld and the sin of disappearance: first and foremost Jessamy's childish wish to remain invisible, isolated.

There are all sorts of other duals in this story, indeed it is something of an overdone theme. Jessamy has two names, a British and a Yoruban one; likewise she has two families. TillyTilly has two names; she has two personalities to match, a benevolently playful one and a terrifying and forthrightly malevolent one. Jessamy seems to live in two different worlds - the visible, tangible one made up of people and places that everyone else recognizes; and an invisible one in her own mind, the one which Yoruban folk tales refer to as "the bush".

It's difficult to make much sense of this book, I think partly because the plot itself is so spooky and unforgiving. The theme of duals and doppelgangers is by its nature abstract, and I'm not sure the book does much to make it more concrete. At the same time, it's a fascinating take on an ancient theme, certainly one which was new to me.


text:
# Good News!

> Quotes from [Archer](http://www.imdb.com/title/tt1486217/) and
[Futurama](http://www.imdb.com/title/tt0149460/) in your shell.

This repository provides a bit of entertainment by providing a quote from
Futurama or Archer every time a new shell is opened. This requires the addition
of just a single line to any of `.bashrc`, `.profile`, or `.bash_profile`. These
silly quotes are meant to bring joy when you're dealing with stressful debugging
problems or hectic workdays.

I'll happily take pull requests for additional quotes to these collections.

## Installation

To create a local database of quotes, simple clone this repository and use the
simple setup script provided:
```bash
git clone https://github.com/nhejazi/good-news.git ~/.good-news
sh ~/.good-news/_setup.sh
```

In addition to the setup provided here, this requires that a single line be
added to the `.bashrc`, `.bash_profile`, or `.profile` -- specifically, use
`gshuf -n1 ~/.goodnews` if on OS X and using [Homebrew](brew.sh) (or, more
simply, just `shuf` if running Linux). For examples implementing both of these,
see the files `bash_profile` and `profile` in [my
dotfiles](https://github.com/nhejazi/mydotfiles.git).

## Credit

This project was largely inspired by -- and borrowed in part from -- [Vince
Buffalo's good-news-everyone](https://github.com/vsbuffalo/good-news-everyone).

---

## License

© 2016 Nima Hejazi

This repository is licensed under the MIT license. See `LICENSE` for details.

repository: nhejazi/good-news

repo_name: nhejazi/good-news


text:
# Unity-Stuff
Different unity scripts and functions created by me at one place. Readme contains description of all scripts in this repository.

***

## Network/MulticastDiscovery.cs
UDP Multicast discovery service. Class with similar function like Unity NetworkDiscovery component, but my works with multicast, not a broadcast. It's helpful if you have more network adapters.

***

## File/Share.cs
## File/Editor/ShareInspector.cs

### Usage
You need to create GameObject in scene and add FileShare.cs script as component. Then you can call it from other scripts.

```c#
FileShare.RegisterReceiveAction("someAction", (file) => { Debug.Log("received file: " + file); });
FileShare.Send("someFile.xml", "someAction");
```

You can set target directory for received files. For example:
```c#
FileShare.SetTempDirectory(Application.dataPath);
```

### Explanation
At the start you need action (ex. lambda function) after receive file on client side. Identifier of this action is string. Also you have a option to remove (UnregisterReceiveAction) this action. Progress of sending a file is starting with Unity message sended to all clients, to be prepared to receive file on specified port. Client (sender of file) ask server for client addresses and send the file to all of them. Each client after receiving a file invokes action by specified identifier.

### Warning
Unity message are identified by "short" value. This script is using Unity highest (47) +1 and +2. If you are using those message numbers, you can change it directly in script region "network message stuff".

While you are testing sharing files, use two computers. Windows not allowing open same port for multiple instances.

Tested on Unity 5.5 and 2017.2. Tested only on Windows.

***

## Editor/SkyboxEditor.cs
Help utility to setup 6 Sided skybox material. You can find it in top menu Window > Skybox Editor.

***

## Development/Invoker.cs
## Development/InvokerInspector.cs
Extension for Unity3D editor to have a option to invoke any method from any component script on any GameObject

One video should say more then a lot of words. Tested on Unity 5.5 and 2017.2.

[![Youtube](http://img.youtube.com/vi/JZ4mGmtQTvA/0.jpg)](http://www.youtube.com/watch?v=JZ4mGmtQTvA)

Available method argument types:
* Base types also available in array and List
  * int
  * float
  * bool
  * string
  * long
* Unity struct types
  * Vector2
  * Vector3
  * Vector4
  * Quaternion
  * Rect
  * Color
  * Bounds
  * AnimationCurve
* all classes inherited from UnityEngine.Object like GameObject, Transform, etc.

_How to render this arguments is defined in Invoker.cs, you have option to extend it with your own. Same render way is used for render method output value, if it's not void._

***

## MouseOverUI.cs
Verify if mouse cursor or any finger touch is over any UI element. It's important that UI elements needs to have turned on "Raycast Target". Static approach, just ask for property "Verify".

***

## GyroControl.cs
Script to move camera with gyro sensor (usually at mobile device). Device can have 3 different sensors to recognize rotation and not all are always installed. This script uses most used installed sensor (usually if device support auto display rotation it has this sensor).

## Thanks and support

repository: stefanak-michal/Unity-Stuff

gha_language: C#

repo_name: stefanak-michal/Unity-Stuff


text:
# Microprocessor-Without-Interlocked-Pipeline-Stages-MIPS.

[![Contributors][contributors-shield]][contributors-url]
[![Stargazers](https://img.shields.io/github/stars/MaharshSuryawala/Microprocessor-Without-Interlocked-Pipeline-Stages-MIPS?style=flat-square)]()
[![MIT License][license-shield]][license-url]
[![Followers](https://img.shields.io/github/followers/MaharshSuryawala?style=flat-square)](https://github.com/MaharshSuryawala)
[![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/MaharshSuryawala/Microprocessor-Without-Interlocked-Pipeline-Stages-MIPS)

## Table of Contents

- [Microprocessor-Without-Interlocked-Pipeline-Stages-MIPS](#microprocessor-without-interlocked-pipeline-stages-mips)
  - [Table of Contents](#table-of-contents)
  - [About The Project](#about-the-project)
    - [Built With](#built-with)
    - [Features](#features)
    - [Specifications](#specifications)
    - [Opcodes and Operations](#opcodes-and-operations)
    - [Instruction Formats](#instruction-formats)
    - [Block Diagram](#block-diagram)
  - [Individual Modules](#individual-modules)
    - [Arithmetic-Logic Unit](#arithmetic-logic-unit)
    - [Execution Block](#execution-block)
    - [Program Counter and Instruction Memory Block](#program-counter-and-instruction-memory-block)
    - [Register Bank](#register-bank)
    - [Data Memory Block](#data-memory-block)
    - [Stall Control Block](#stall-control-block)
    - [Write Back Block](#write-back-block)
    - [Jump Control Block](#jump-control-block)
    - [Dependency Check Block](#dependency-check-block)
  - [Simulation Results](#simulation-results)
  - [Usage](#usage)
  - [Contributing](#contributing)
  - [License](#license)
  - [Contact](#contact)
  - [Acknowledgements](#acknowledgements)

## About The Project

![Motherboard](images/motherboard.jpg)

Photo by Michael Dziedzic on Unsplash

RISC based 8-bits five stage pipelined processor, operating at 585 MHz clock frequency with 19 I/O
pins and 28 instructions having 5 Addressing formats. Tested on Xilinx Artix-7 FPGA.

### Built With
* [Xilinx ISE](https://www.xilinx.com/products/design-tools/ise-design-suite.html)
* [Nexys A7: FPGA](https://store.digilentinc.com/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum/)

### Features

* Interrupt allowed.
* Pipeline structure.
* Unconditional or Conditional jumps, both are allowed.

### Specifications

* Architecture: 8 Bits
* Total stages: 5
* Instruction set: 24 Bit
* Input / Output pins: 21
* Frequency: 585 MHz (100 MHz on Artix-07)
* CPI: 1.25
* Data memory: 8 Width, 256 Depth
* Program Memory: 24 Width, 256 Depth
* Opcodes: 28
* Total interrupts: 1
* Registers: 32
* Address: 8 Bits
* Total flags: 4
  * flag[0]= carry
  * flag[1]= zero
  * flag[2]= overflow
  * flag[3]= parity
* Register bank size: 32*8 bits
* Instruction formats: 7
* Total types of jumps: 5
  * Conditional: 4
  * Unconditional: 1

### Opcodes and Operations
![Opcodes and Operations](images/opcodes_and_operations.png)

### Instruction Formats
![Instruction Formats](images/instruction_format.png)

### Block Diagram
![Block Diagram](images/MIPS.jpg)

## Individual Modules

### Arithmetic-Logic Unit

* An arithmetic logic unit (ALU) is a digital electronic circuit that performs arithmetic and bitwise logical operations on integer binary numbers.
* An ALU is a fundamental building block of many types of computing circuits, including the central processing unit (CPU) of computers and graphics processing units (GPUs).
* A single CPU or GPU may contain multiple ALUs.
* The inputs to an ALU are the data to be operated on, called operands; and an opcode (operation code) indicating the operation to be performed; the ALU's output is the result of the performed operation.
* In many designs, the ALU also exchanges additional information with a status register (flag), which relates to the result of the current or previous operations.

### Execution Block

* The executon block fetches instructions from the queue, decodes the instructions and executes the arithmetic-logical operations using the ALU block.

* Note:
  * Arithmetic operations are on 2's complemented numbers.
  * 'reset' is negative level triggered and clock synchronous.

![Execution Block](images/execution_block.png)

* Execution Block Simulation Results:

![Execution Block Sim 1](images/execution_block_sim_1.PNG)

![Execution Block Sim 2](images/execution_block_sim_2.PNG)

![Execution Block Sim 3](images/execution_block_sim_3.PNG)

![Execution Block Sim 4](images/execution_block_sim_4.PNG)

### Program Counter and Instruction Memory Block

* Generates instructions for decode, execution, and data memory blocks.
* Takes care of different controls.

![Program Counter and Instruction Memory Block](images/pc_im_block.png)

* There are 3 different 2 x 1 multiplexer having selection line namely ‘Stall’, ‘pc_mux_sel’ and ‘Stall_pm’ respectively.
* ‘Stall’ generated from ‘stall control’ block (i.e. one of the module of processor) which is used to select assign either Hold_Address or Next_Address as CAJ.
* ‘pc_mux_sel’ decides whether current address will pass to program memory or address provided by ‘jump control’ block.
* A mux with ‘Stall_pm’ selection bit decides whether to pass actual instruction (PM_out) or pass previous instruction (ins_prv) to ‘ins_pm’.
* Another two multiplexers with ‘reset’ selection bit are used to reset ‘Current_Address’ and ‘ins’ values.
* Processor needs to generate new instruction at every positive edge of clock and ‘program counter’ will provide address of the new instruction.
* Program counter is combination of ‘increment’ (+) and ‘register’ block.
* ‘Increment’ block increments address and register will pass that value to ‘Next_Address’ on every positive edge of the clock and when there is reset it will clear the output of ‘register’.
* Another important block is program memory which has been designed using Xilinx IP core generator.

* Program Counter and Instruction Memory Block Simulation Results:

![PC and IM Sim](images/pm_sim.PNG)

* Note:
  * The memory data for each address can be written in the COE file. The COE file can be generated using Xilinx ISE. The ROM_data.txt is present in the repository.
  * [For more details click here.](https://www.xilinx.com/support/documentation/sw_manuals/xilinx10/isehelp/cgn_p_memed_single_block.htm)

### Register Bank

* This block generates operands (A and B) for Execution block based on the instruction generated from Instruction Memory block.
* Instruction bits 13 to 9 are used as first operand (A) address and 8 to 4 are used as second operand (B) address.

![Register Bank](images/rb.png)

* If applied instruction is register type then both the operands are fetched from register bank, else one operand (A) is fetched from register bank and other operand (B) is taken as an immediate number (imm).
* This selection is controled by 2x1 Mux.
* Data forwarding operations are performed by both 4x1 Mux based on the values applied to it’s selection line (mux_sel_A and mux_sel_B).
* Answer from Data Memory block (ans_dm) is written in register bank as per the address indicated by RW_dm.

![Data Forwarding](images/df.png)

* Register Bank Simulation Results:

![RB Sim](images/rb_block_sim.PNG)

### Data Memory Block

* Data Memory is designed using IP core.
* It’s a 256x8 RAM with R/W and enable signal.

![Data Memory](images/dm.png)

* Data read or write in Data Memory is possible only if ‘mem_en_ex’ signal is
  * If ‘mem_rw_ex’ is 0 data read operation will perform else data write.
* Data written in the Data Memory should be provided to ‘DM_data’; and ‘ans_ex’ is used as an address.
* 2x1 Mux is used to select between execution block answer (Ex_out) or Data Memory’s output (DM_out).
* When ‘mem_mux_sel_dm’ is 1, it will select ‘DM_out’ as an ‘ans_dm’ else it will select ‘Ex_out’ as an ‘ans_dm’.

* Data Memory Block Simulation Results:

![DM Sim](images/dm_block_sim.png)

### Stall Control Block

* Some instructions like ‘Load’ and ‘Conditional Jump’ will create control hazard in pipeline processor.
* To overcome this problem, we need to stall pipeline for one or two clock cycles.

![Stall Control Block](images/sc_block.png)

* Stall Control block decides when to stall a pipeline.
* Also, this block will stall pipeline forever when ‘HLT’ instruction will execute.

Stall Control Block Simulation Results:

![SC Sim](images/sc_sim.PNG)

### Write Back Block

* Write Back block is used to delay ‘ans_dm’ for one clock cycle.
* This block helps to resolve read after write hazard in the IDOF (Instruction Decode and Operand Fetch) stage.

![Write Back Block](images/wb_block.png)

### Jump Control Block

* Jump control block generates jump location address (jmp_loc) and mux control signal (pc_mux_sel) for program memory block, based on jump conditions and value of interrupt.
* For conditional jumps (JC, JNC, JZ and JNZ), if condition is true then ‘pc_mux_sel’ value will be ‘1’, else we check for unconditional jump (JMP), interrupt and return (RET) instructions, if any of these instruction/signal is true then also ‘pc_mux_sel’ value will be ‘1’, for other cases ‘pc_mux_sel’ value will be ‘0’.

![Jump Control Block](images/jc_block.png)

* When interrupt signal value is ‘1’, we stores ‘current_address’ and ‘flag_ex’ in the system and program will jump to interrupt subroutine location (8’hF0).
* When interrupt subroutine is over then we provide RET instruction to continue our main program, for that we need to reproduc ‘current_address’ and ‘flag_ex’ which was previously stored in system.

* Jump Control Block Simulation Results:

![JC Sim](images/jc_sim.PNG)

### Dependency Check Block

* Dependency check block handles data hazard in pipeline processor.
* It can check dependency of current instruction with previous three instructions and enables data forwarding in pipeline by generating ‘mux_sel_A’ and ‘mux_sel_B’ signals.
* This block is also generates memory control and immediate control signals. All outputs of this block are generated at the positive edge of clock.

![Dependency Check Block](images/dc_block.png)

* Dependency Check Block Simulation Results:

![DC Sim](images/dependency_check_sim.PNG)

## Simulation Results

* Addition

![Addition](images/Addition.PNG)

* Multiplication

![Multiplication](images/Multiplication.PNG)

## Usage

* Upload the mainmodule.bit file on [Nexys A7: FPGA.](https://store.digilentinc.com/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum/)

* Download the repository. Open the project in Xilinx ISE and simulate the mainmodule_tb.v file.

## Contributing

Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/amazing-feature`)
3. Commit your Changes (`git commit -m 'feat: some amazing feature'`)
4. Push to the Branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

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

## Contact

* Team:
  * [Ayush Panara](https://www.linkedin.com/in/ayush-m-panara-a51843154/)
  * [Jay Patel](https://www.linkedin.com/in/ohdeargodjay/)
  * [Kahan Majmudar](https://www.linkedin.com/in/kahan-majmudar-095221191/)
  * [Maharsh Suryawala](https://www.linkedin.com/in/maharsh-suryawala/)

## Acknowledgements
* [Img Shields](https://shields.io)
* [Iconify](https://iconify.design/)
* [MIT License](https://opensource.org/licenses/MIT)
* [Unsplash](https://unsplash.com/)
* [Badgen](https://badgen.net/)
* [For The Badge](https://forthebadge.com/)

[![ForTheBadge built-with-love](http://ForTheBadge.com/images/badges/built-with-love.svg)](https://github.com/MaharshSuryawala)

[contributors-shield]: https://img.shields.io/github/contributors/MaharshSuryawala/Microprocessor-Without-Interlocked-Pipeline-Stages-MIPS?style=flat-square
[contributors-url]: https://github.com/MaharshSuryawala/Microprocessor-Without-Interlocked-Pipeline-Stages-MIPS/graphs/contributors
[license-shield]: https://img.shields.io/github/license/MaharshSuryawala/Microprocessor-Without-Interlocked-Pipeline-Stages-MIPS?style=flat-square?style=flat-square
[license-url]: https://github.com/MaharshSuryawala/Microprocessor-Without-Interlocked-Pipeline-Stages-MIPS/blob/master/LICENSE.txt

gha_language: Verilog


text:
# The JavaScript API to consume openrouteservice(s) painlessly!

[![Build and test](https://github.com/GIScience/openrouteservice-js/actions/workflows/github-actions-build-and-test.yml/badge.svg)](https://github.com/GIScience/openrouteservice-js/actions/workflows/github-actions-build-and-test.yml)
[![codecov](https://codecov.io/gh/GIScience/openrouteservice-js/branch/main/graph/badge.svg?token=WCLd69Jqbp)](https://codecov.io/gh/GIScience/openrouteservice-js)

This library lets you consume the openrouteservice API in *JavaScript* applications. It allows you to painlessly consume the following services:

- Directions (routing)
- Geocoding | Reverse Geocoding | Structured Geocoding (powered by Pelias)
- Isochrones (accessibility)
- Time-distance matrix
- POIs (points of interest)
- Elevation (linestring or point)
- Optimization

See the examples in the [examples folder](examples)

*Note:* In order to use this client, you have to register for a token at [openrouteservice](https://openrouteservice.org). To understand the features of openrouteservice, please don't forget to read the docs. For visualization purposes on the map please use [openrouteservice maps](https://maps.openrouteservice.org).

## Documentation

This library uses the ORS API for request validation. To understand the input of each API specifically, please check [API Playground](https://openrouteservice.org/dev/#/api-docs) that provides an interactive documentation.

## Installation and Usage

Requirements

- git
- nodeJS
- *if not included in nodeJS:* npm

Install the library with npm:

```shell
npm install openrouteservice-js --save
```

### Use es module import
```js
import Openrouteservice from 'openrouteservice-js'
let orsDirections = new Openrouteservice.Directions({ api_key: "XYZ"});
// ...
```

### Use requirejs
```js
const Openrouteservice = require("openrouteservice-js");
let orsDirections = new Openrouteservice.Directions({ api_key: "XYZ"});
// ...
```

### Use the distribution file directly in html
```html
<script type="module" src="../openrouteservice-js/dist/ors-js-client.js"></script>
<script>
  let orsDirections = new Openrouteservice.Directions({ api_key: "XYZ"});
  // ...
</script>
```

### Pair with local openrouteservice instance
```js
// Note: The API key is currently still passed as a parameter but not needed by the local instance
import Openrouteservice from 'openrouteservice-js'
let orsDirections = new Openrouteservice.Directions(
  { host: "http://localhost:8082/ors" }
);
// ...
```

## Integrate the APIs in your application

### Isochrones Example

```javascript
// Add your api_key here
const Isochrones = new Openrouteservice.Isochrones({ api_key: "XYZ"})
try {
  let response = await Isochrones.calculate({
    locations: [[8.690958, 49.404662], [8.687868, 49.390139]],
    profile: 'driving-car',
    range: [600],
    units: 'km',
    range_type: 'distance',
    attributes: ['area'],
    smoothing: 0.9,
    avoidables: ['highways'],
    avoid_polygons: {
      type: 'Polygon',
      coordinates: [
        [
          [8.683533668518066, 49.41987949639816],
          [8.680272102355957, 49.41812070066643],
          [8.683919906616211, 49.4132348262363],
          [8.689756393432617, 49.41806486484901],
          [8.683533668518066, 49.41987949639816]
        ]
      ]
    },
    area_units: 'km'
  })
  // Add your own result handling here
  console.log("response: ", response)

} catch (err) {
  console.log("An error occurred: " + err.status)
  console.error(await err.response.json())
}
```

### Directions HGV example (browser)
> Note: Nested parameters from the options object are easier accessible like  `restrictions`, `avoidables`
> and `avoid_polygons` (cf. [API docs](https://openrouteservice.org/dev/#/api-docs/v2/directions/{profile}/post))
```html
<script>
  window.onload = async function() {
    // Add your api_key here
    let orsDirections = new Openrouteservice.Directions({ api_key: "XYZ"});

    try {
      let response = await orsDirections.calculate({
        coordinates: [[8.690958, 49.404662], [8.687868, 49.390139]],
        profile: 'driving-hgv',
        restrictions: {
          height: 10,
          weight: 5
        },
        extra_info: ['waytype', 'steepness'],
        avoidables: ['highways', 'tollways', 'ferries', 'fords'],
        avoid_polygons: {
          type: 'Polygon',
          coordinates: [
            [
              [8.683533668518066, 49.41987949639816],
              [8.680272102355957, 49.41812070066643],
              [8.683919906616211, 49.4132348262363],
              [8.689756393432617, 49.41806486484901],
              [8.683533668518066, 49.41987949639816]
            ]
          ]
        },
        format: 'json'
      })
      // Add your own result handling here
      console.log("response: ", response)

    } catch (err) {
      console.log("An error occurred: " + err.status)
      console.error(await err.response.json())
    }
  };
</script>
```

### Geocode examples

```javascript
// Add your api_key here
const Geocode = new Openrouteservice.Geocode({ api_key: "XYZ"})

try {
  let response = await Geocode.geocode({
    text: "Heidelberg",
    boundary_circle: { lat_lng: [49.412388, 8.681247], radius: 50 },
    boundary_bbox: [[49.260929, 8.40063], [49.504102, 8.941707]],
    boundary_country: ["DE"]
  })
  // Add your own result handling here
  console.log("response: ", response)

} catch (err) {
  console.log("An error occurred: " + err.status)
  console.error(await err.response.json())
}

try {
  let response_reverse = await Geocode.reverseGeocode({
  point: { lat_lng: [49.412388, 8.681247], radius: 50 },
  boundary_country: ["DE"]
})
  // Add your own result handling here
  console.log("response: ", response_reverse)

} catch (err) {
  console.log("An error occurred: " + err.status)
  console.error(await err.response.json())
}

try {
  let response_structured = await Geocode.structuredGeocode({
  locality: "Heidelberg"
})
  // Add your own result handling here
  console.log("response: ", response_structured)

} catch (err) {
  console.log("An error occurred: " + err.status)
  console.error(await err.response.json())
}
```

### Matrix example
```javascript
// Add your api_key here
const Matrix = new Openrouteservice.Matrix({ api_key: "XYZ"})

try {
  let response = Matrix.calculate({
  locations: [[8.690958, 49.404662], [8.687868, 49.390139], [8.687868, 49.390133]],
  profile: "driving-car",
  sources: ['all'],
  destinations: ['all']
})
  // Add your own result handling here
  console.log("response: ", response)

} catch (err) {
  console.log("An error occurred: " + err.status)
  console.error(await err.response.json())
}
```

### Elevation example
```js
// Add your api_key here
const Elevation = new Openrouteservice.Elevation({api_key: "XYZ"})

try {
  let response = Elevation.lineElevation({
  format_in: 'geojson',
  format_out: 'geojson',
  geometry: {
    coordinates: [[13.349762, 38.11295], [12.638397, 37.645772]],
    type: 'LineString'
  }
})
  // Add your own result handling here
  console.log("response: ", response)

} catch (err) {
  console.log("An error occurred: " + err.status)
  console.error(await err.response.json())
}
```
### Optimization example
Or consume Optimization API to solve [vehicle routing problems](https://en.wikipedia.org/wiki/Vehicle_routing_problem)

```javascript
// Add your api_key here
let Optimization = new openrouteservice.Optimization({api_key: "XYZ"});

try {
  let response = Optimization.optimize({
  jobs: [
    {
      id: 1,
      service: 300,
      amount: [1],
      location: [2.03655, 48.61128],
      skills: [1]
    },
    {
      id: 2,
      service: 300,
      amount: [1],
      location: [2.03655, 48.61128],
      skills: [2]
    },
  ],
  vehicles: [
    {
      id: 1,
      profile: 'driving-car',
      start: [2.35044, 48.71764],
      end: [2.35044, 48.71764],
      capacity: [3],
      skills: [1, 2],
    }
  ],
})
  // Add your own result handling here
  console.log("response: ", response)

} catch (err) {
  console.log("An error occurred: " + err.status)
  console.error(await err.response.json())
}
```

## Development Setup

Clone the openrouteservice-js repository from GitHub into a development environment of your choice.

```shell
git clone https://github.com/GIScience/openrouteservice-js.git
cd openrouteservice-js

# Install the dependencies
npm install

# Make your openrouteservice API key available for tests, examples and dev_app
sh setup.sh <your-api-key>
```

Start the dev_app for debugging when working with source files:
```shell
# runs the app at http://localhost:5173
vite
```

Now you can either use the devtools of your browser to set breakpoints (e.g. in `OrsGeocode`)
or create a `JavaScript Debug` configuration to debug with WebStorm:
![debug_config](https://user-images.githubusercontent.com/23240110/195876234-4a0ad923-1c5c-4cfe-976a-d39dd23a50d8.png)

Run the config in debug mode to open the Chrome browser and reload the page after changes for them to take
effect immediately.

## Running Tests

To run specific unit test files in `src/__tests__` on demand during development, run
```shell
npm run test:e2e
```
Choose one of your installed browsers in the cypress UI you want to test in and select the test file you want to run.

Component tests for the web app can be run by switching to component testing.

To run tests without ui use the npm scripts ending with `:ci` e.g. for unit, component and e2e tests:
```shell
npm run test:ci
```
## Commits and versioning

- This app uses the `commitizen` plugin to generate standardized commit types/messages. After applying any change in a feature branch, use `git add .` and then `npm run commit` (instead of `git commit ...`)
- The plugin `standard-version` is used to generate changelog entries, version tag and to bump the app version in package.json.

Deployment flow:

- Apply the changes in a feature branch and test it locally
- Once the feature is ready, merge it to `develop`, deploy it to the testing environment
- Checkout in `main`, merge from develop and use `npm run release` to generate a release. This will generate a new release commit as well as a git tag and an entry in [CHANGELOG.md](CHANGELOG.md).

*For more details about `commitizen` and `standard-version` see [this article](https://medium.com/tunaiku-tech/automate-javascript-project-versioning-with-commitizen-and-standard-version-6a967afae7)*

repository: GIScience/openrouteservice-js

repo_name: GIScience/openrouteservice-js


text:
SpreeLocationsNearYou
=====================

[![Circle CI](https://circleci.com/gh/railsdog/spree_locations_near_you.svg?style=svg)](https://circleci.com/gh/railsdog/spree_locations_near_you) [![Code Climate](https://codeclimate.com/github/railsdog/spree_locations_near_you/badges/gpa.svg)](https://codeclimate.com/github/railsdog/spree_locations_near_you)

# spree_locations_near_you
Spree extension to provide a list of retail locations near a users' provided postal code

# What this gem does

- Target Spree 2.4 in the first release
- Provide a means of geocoding any given ActiveRecord model based on address
- Supports a single geocoding provider
- Provides a facility for looking up a user-submitted location identifier (presumably a postal code) and returning a  ActiveRecord result set of locations sorted by ascending distance from the supplied starting point
- Delegates to the `alexreisner/geocoder` where possible to simplify `(lat,lng)` lookups
- Targets PostgreSQL exclusively using the `earthdistance` addon.
  - May support MySQL via its [spatial extensions](http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html) in a future release
- Provides a vendored copy of the [jQuery Store Locator Plugin](https://github.com/bjorn2404/jQuery-Store-Locator-Plugin) for optional frontend mapping needs
- Uses the `acts_as_list` gem's DSL as a guideline for inclusion with a Spree model specified by the gem user

## What this gem does not do

- Provide its own location / store AR model
- Support all versions of Spree

Installation
------------

Add spree_locations_near_you to your Gemfile:

```ruby
gem 'spree_locations_near_you'
```

Bundle your dependencies and run the installation generator:

```shell
bundle
bundle exec rails g spree_locations_near_you:install
```

Testing
-------

First bundle your dependencies, then run `rake`. `rake` will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using `rake test_app`.

```shell
bundle
bundle exec rake
```

When testing your applications integration with this extension you may use it's factories.
Simply add this require statement to your spec_helper:

```ruby
require 'spree_locations_near_you/factories'
```

Copyright (c) 2015 [name of extension creator], released under the New BSD License
=======
>>>>>>> 52a513fa8d985d1757a1f1f982efafc09c83e49b