text:
# GlmSharpN

GlmSharp is a C# library for linear algebra in up to four dimensions. GlmSharp is automatically generated by the program GlmSharpGenerator in the same repository. GlmSharpN is a fork of the project where you can tell GlmSharpGenerator to generate matrix and vector classes for higher dimensions.

Usage:
1) In `Program.cs` in the GlmSharpGenerator project set `Program.N` to whatever maximum dimension you want.
2) Build GlmSharpGenerator.
3) Navigate to directory with GlmSharpGenerator.exe and run the command

`glmsharpgenerator ..\..\..`

or replace `..\..\..` with the path of the folder containing GlmSharp.sln if necessary.

It would be preferable if `N` could be specified at runtime, but this would require a more significant rewrite of GlmSharpGenerator, so for now you will have to rebuild GlmSharpGenerator for each new `N`.

In the class `vecN` the names of the `N` coordinates are the first `N` characters in `"xyzwvuts"`. You can swizzle using the first `N` characters in `"xyzwvuts"` or `"rgbaklpq"`. These strings are set in `Program.DIMS` and `Program.CDIMS`, and if you want to use `N > 8` then you will have to add to these strings.

The generated code for swizzling grows as `O(N^N)`. For GlmSharp5 the swizzle folder is already 18 MB, and I expect for `N > 5` you will have to turn off swizzling entirely, although I have not implemented this. Extrapolating, the swizzle folder should be over 65 GB for `N = 8`. You could always just run GlmSharpGenerator for `N = 8` then immediately delete the swizzle folder. I think the rest of the generated code grows as `O(N!)`, which is explosive but not as explosive as the swizzle folder.

I have only tested the library for `N = 5`. In this repository you will find the generated code for `N = 5`.

The README for GlmSharp is below.

# GlmSharp

Open-source MIT-licensed C#/.NET math library for small vectors and matrices.

The naming and behavior is inspired by the excellent [OpenGL Mathematics](http://glm.g-truc.net/) lib by Christophe Riccio.

## Example

```C#
vec3 v = new vec3(0, 1, 0);
vec3 left = vec3.Cross(v, new vec3(2f));

mat4 view = mat4.LookAt(vec3.Ones, vec3.Zero, vec3.UnitY);
vec4 v4 = view.Inverse * new vec4(v, 0f);

v4 *= glm.Smoothstep(0.2f, 0.4f, v.Length);

string s = v4.ToString();
vec4 vv = vec4.Parse(s);

vv.xy = v.swizzle.yy;
```

## NuGet

Install via [NuGet](https://www.nuget.org/packages/GlmSharp/):

```

PM> Install-Package GlmSharp

```

Current version: _0.9.7_

## Overview

Supported types:
* `vec2`
* `vec3`
* `vec4`
* `mat2`
* `mat3`
* `mat4`
* `quat`
* non-quadratic mats (`mat2x3`, `mat2x4`, `mat3x4`, `mat3x2`, `mat4x2`, `mat4x3`)

Supported base types:
* `int` (`ivec`)
* `uint` (`uvec`)
* `long` (`lvec`)
* `float` (`vec`)
* `double` (`dvec`)
* `decimal` (`decvec`)
* `System.Numerics.Complex` (`cvec`, only in .NET 4.5 and higher)
* `long` (`lvec`)
* `bool` (`bvec`)
* `Half` (`hvec`, using [C# Half](http://sourceforge.net/projects/csharp-half/))
* generic `T` (`gvec<T>`)

(Currently a total of 160 types in about 50k LOC)

Supports read-only swizzling, e.g. `v.swizzle.bgr` (or equivalently `v.swizzle.zyx`).
Supports read-write inline-swizzling, e.g. `v.zw = v.yx`.

## Syntax, Usage

Instead of introducing a `glm` namespace, GlmSharp puts most functions in the respective type.
For example, `glm.dot(v1, v2)` for `vec3` is now `vec3.Dot(v1, v2)`.

Since 0.9.7, a `glm` static class also provides most functionality in form of static functions, including operations on base types.

## Requirements

The code itself is written using C# 6 features, the NuGet package however only requires .NET 2.0 (with some restrictions).
Starting with .NET 4.5, `System.Numerics.Complex` and `IReadOnlyList<T>` are supported in GlmSharp.

## Features

* Arithmetic type support: `int`, `uint`, `long`, `float`, `double`, `decimal`
* Boolean vectors, matrices
* `System.Numerics.Complex` support
* Generic `gvec<T>, gmat<T>` support
* Swizzling
* Basetype constants are propagated (`double.Epsilon` => `dvec3.Epsilon`)
* Basetype functions are propagated
* Performance considerations
* Extensive operator overloading
* Proper `ToString`, `Parse`, `TryParse` for vectors (including format providers)
* Most `Math` and basetype functions work component-wise for vectors (e.g. `float.IsInfinite(v)` => `vec3.IsInfinite(v)`)
* Vectors and matrices implement `IReadOnlyList<>` and `IEquatable<>`
* Various constructors and explicit casts for vectors and matrices
* Implicit casts for vectors where base types can be casted implicitly
* Most GLSL functions
* Radians-only lib
* Serialization via `[Serializable]`, `[DataContract]` and `[DataMember]` (and thus [Json.NET](https://github.com/JamesNK/Newtonsoft.Json))
* Marshalling via `[StructLayout(LayoutKind.Sequential)]`
* Quaternions
* Support for .NET 2.0 (with new features since .NET 4.5)
* Aggregated functionality in static `glm` class
* Support for 16-bit floating points (using [C# Half](http://sourceforge.net/projects/csharp-half/))
* Generated library

### Swizzling

In theory, each swizzle string ('xyz') could be implemented as a property in the respective vector struct.
However, this absolutely spams Intellisense (706 combinations for vec4). (Extension methods are not solution either as tools like Resharper show all available methods.)

Thus, swizzling is implemented as a swizzle surrogate type (e.g. `swizzle_vec4`) that has all combinations as properties.
Each vector type has a `swizzle` property that returns an instance of the surrogate type.
Therefore, swizzling becomes `v.swizzle.xz`.
(Hopefully, the runtime engine elides all superfluous moves/copies.)

Swizzling is generated for `xyzw` and `rgba`.

Since 0.9.8, read-write inline-swizzling is supported. All ordered subsets of components can now be read and set, e.g. `v2.xzw = new vec3(v1.yx, 1f)`.

### Performance consideration

All vectors and matrices are value-types and contain all components directly. (A matrix is not an array of vectors.)
These types are therefore suited for serialization and marshalling.

Most functions are "rolled out" by the generator and should therefore have minimal overhead.

## License

This library is MIT-licensed.

## TODO-List

* test generation
* ToString, Parse, TryParse for matrices
* some GLU functions (e.g. PickMatrix)
* advanced glsl/glm functions
* extensive documentation (parameters, return values, formulas)
* noise functions
* random extensions
* explicit JSON support
* matrix column/row setter
* base type glm classes

repository: akriegman/GlmSharpN

repo_name: akriegman/GlmSharpN


text:
# db-waitlist

Copyright (C) 2017 The Open Library Foundation

This software is distributed under the terms of the Apache License,
Version 2.0. See the file "[LICENSE](LICENSE)" for more information.

## Introduction

This contains `init_mod_waitlist.py` which can be used to populate `mod-waitlist` datatables with sample `waitlist reserves` data.

## Pre-Requisite: Mod-Waitlist Postgres Schema

In order for `init_mod_waitlist.py` to work properly, the datatables for `mod-waitlist` must be generated for the `diku` tenant. The datatables can be autogenerated by enabling `mod-waitlist` for the `diku` tenant through the Okapi gateway.

### Further Explanation

Datatables for `mod-waitlist` are autogenerated when `mod-waitlist` is enabled for a given user (e.g. `diku`) through the following process:

1. An HTTP POST request to enable `mod-waitlist` for `diku` is sent to the Okapi gateway.
1. The Okapi gateway calls the `/_/tenant` endpoint of `mod-waitlist`.
1. The `/_/tenant` endpoint uses a template to autogenerate the postgres, tenant-specific schema for `mod-waitlist`.

## Ingesting Mod-Waitlist Sample Data

Ingesting mod-waitlist sample data involves:

1. Running and enabling `mod-waitlist` through Okapi, in order to trigger the creation of the `diku_mod_waitlist` schema and `courses`/`items`/`instructors` tables.
1. Running `init_mod_waitlist.py` which will automatically add uuidv4 ids to the json objects and then insert them into the `jsonb` column of their corresponding postgres datatables.

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
**ALERT: THIS IS ONLY FOR REPORTING BUGS, NOT IF YOU HAVE ISSUES WITH YOUR GAME**
Always ask your questions first in general or EFT, if it turns out to be a bug then report it on the github issue tracker.

## Requirements
- a github account (create one for free if you haven't already!)
- make sure that it's indeed a bug you report!
- make sure that the issue hasn't been reported already!

### the issue is already reported?
leave a reaction emoji on the issue, and any additional information if required.

## Creating the ticket
- go to the repository of the project you experience an issue with (i.e.: https://www.github.com/justemutarkov/Server)
1. click on the issues tab below the repository name
2. click on the "new issue" button on the right top side
3. add information to the issue (keep it concise and precise!), optionally add screenshots or a youtube video.
4. press the "submit new issue" button

### Issue Closed?
This either means that the issue has been fixed, or is invalid.

## Issue Template
```**general information**
Server: <server version or server commit hash>
Launcher: <launcher version or launcher commit hash>
Assembly: <assembly version or assembly commit hash>
Client: <game version>

**the issue**
<write what goes wrong and what you expect to happen>

**how to reproduce**
1. <step 1>
2. <step 2>
3. <etc>
```

## Example
![](https://cdn.discordapp.com/attachments/681164874654417060/682174810876411943/unknown.png)

license: MIT


text:
---

title: 'Welcoming Communities'
author: Gregor
layout: blog-post
comments: true

---

> **You don’t build a community. You build a space.**
— [Saron Yitbarek](https://twitter.com/saronyitbarek/)

A lot of people enjoy contributing to Open Source projects. And Open Source projects love contributions. And yet I keep seeing newcomers struggling to contribute and project maintainers struggling to find contributors. What’s the catch?

![The Hoodie Animals on an open fire](/dist1/blog/camp.png)

There is a gap. A gap between the desire to contribute to a community and the ability to find one. A gap between what contributions are welcome, and what people *think* is wanted. A gap between what people wish they could contribute, but don’t know how, or are afraid to try.
At the [Hoodie Community](http://hood.ie/ "Hoodie – A generic backend with a client API for Offline First applications"), we work hard to close this gap. And despite being an independent project with little to no resources, it aspires to be “[one of Open Source’s most diverse and inclusive communities](https://opensource.com/life/16/2/hoodie-open-source-community).”

The are 3 things we focus on

1. We reach out to new contributors
1. We make Hoodie fun
1. We keep it fun

## I. Reach out

A typical Open Source contributor starts out as a user of the software. They find a bug, documentation lacking on a specific point or want a feature to be added, and contribute code through a code hosting platform like [GitHub](https://github.com/). Others just want to work on a fun project. How can they find yours?

### 1. Go where your future contributors are

Become part of initiatives like [First Timers Only](http://www.firsttimersonly.com/ "First Timers Only - Get Involved in Open Source and commit code to your first project!"), [Your First PR](https://twitter.com/yourfirstPR) or [Up For Grabs](http://up-for-grabs.net/#/ "Up For Grabs"). Participate in projects like [Google Summer of Code](https://summerofcode.withgoogle.com/), [Rails Girls Summer of Code](http://railsgirlssummerofcode.org/ "Rails Girls Summer of Code") or [Outreachy](https://www.gnome.org/outreachy/).

### 2. Turn contributors into ambassadors

Make the experience a great one, and even one-time contributors will promote your project in the future.

### 3. Host events

“Meet the Hoodies” is an [event series](https://ti.to/hoodie/) we host wherever we can. It’s simple and people love it. ProTip: [invite other projects to join forces](http://hood.ie/blog/a-new-kind-of-open-source-event.html "A new kind of Open Source Event"). Start small.

### 4. Share your thoughts

Your project is much more than just code, it tries to solve a problem. Talk about it, write about it.

### 5. Stickers

People love stickers :)

## II. Make it fun — for everyone

You have taken the first hurdle, you’ve gained interest. The immediate questions that decides whether a visitor becomes a contributor or not are:

- “Is this a safe place?”
- “Am I good enough?”
- “Is it worth my time?”
- “What is the license?”

Some of these might seem obvious, but please keep in mind: *this is not about you*. What is about you and is in your best interest is to recruit contributors who enjoy and who are capable of doing the things that you are not. Do you enjoy coding, but not answering issues? Then identify those individuals in your community who do and let them have it. This approach works well and goes a long way in minimizing maintainer burnout.

### 1. Be Safe

It doesn’t matter how fun and amazing your project is, if people don’t feel safe — they won’t contribute. Security is a [hygienic factor](https://en.wikipedia.org/wiki/Two-factor_theory) — make sure it is good enough. You want a **Code of Conduct**. [Contributor Covenant](http://contributor-covenant.org/ "Contributor Covenant: A Code of Conduct for Open Source Projects") is a great resource for this, but refrain from just copy & pasting. Take a moment and read it, and make sure you document how you will enforce it and be prepared to enforce it. Here is [Hoodie’s Code of Conduct](http://hood.ie/code-of-conduct "hood.ie code of conduct").

### 2. Be Legal

Not only will people refrain from contributing to your project if it lacks a **license**, but not having one can and will get you in all kinds of trouble. And according to [the definition](http://www.opensource.org/osd) of the term “open source,” *your library is not open source if it doesn’t have a license*. So [choose an Open Source license](http://choosealicense.com/ "Choose an open source license - Choose a License").

### 3. Be Inclusive

Use simple language ([Hemingway](http://www.hemingwayapp.com/ "Hemingway Editor") can help). List all professions like “Design”, “Editorial”, “Documentation” instead of saying “Non-Coding”. Use gender-neutral language, prefer “them” and “they” over “him” and “she”. Avoid phrases like “Hey guys”. If you use Slack, you can configure slackbot to suggest [alternatives](https://gist.github.com/boennemann/09e4133958e57fb53103), as we do in our [Hoodie Chat](http://hood.ie/chat/ "hood.ie IRC"). This is your chance to “set a tone” in your community. It helps to limit unfriendly, over-demanding and self-entitled requests from strangers.

### 4. Lower barriers

*It is the process of contributing that is oftentimes the most challenging.* Link to [Make a Pull Request](http://makeapullrequest.com/ "Make a Pull Request") for Open Source beginners. Optimize for (new) contributors. Avoid excessive guidelines. Less [RTFM](http://www.urbandictionary.com/define.php?term=RTFM "Urban Dictionary: RTFM"), more [LMFTFY](http://www.urbandictionary.com/define.php?term=lmftfy "Urban Dictionary: lmftfy"). Less acronyms ;) Split up your code into self-contained, documented modules. For example, [the Hoodie Server is made of small modules](https://github.com/hoodiehq/hoodie/tree/master/server#architecture), new code contributors only need to understand the module they contribute to not the larger project. Require the minimum amount of tools. Invest in good tests and 100% coverage, so you can accept code contributions quickly and with confidence.

### 5. Dedicate space

“Just look through the open GitHub issues” is a great way to lose a potential contributor. Create a dedicated place for new (and existing) contributors. This is your chance to say what kind of contributions you are looking for, how much they matter, whom to ask for help, mention guidelines, link to open issues, and show what people are currently working on. At Hoodie, we have [Hoodie Camp](https://github.com/hoodiehq/camp) — a place dedicated to Hoodie’s contributors and maintainers.

### 6. Be welcoming

Imagine you hear about Hoodie for the first time, you are curious and have some time on your hands. And then you see an[ open issue like this](https://github.com/hoodiehq/camp/issues/9) — what is your reaction? Probably something like “Wow. They really put a lot of effort into this”. Which is what we do, and for that exact reason. We want to make it easy for people to contribute and you can do it, too. Before you object, this is a lot of work, but it’s not just about making a lasting first-time impression. It’s about sending a signal to everyone about the importance of helping new contributors, while encouraging new maintainers to review pull requests. This is about creating a community of people who will go out and spread the word about how awesome your project is, which will help you find even more contributors.

### III. Keep it fun

It’s one thing to gain new contributors. It’s a whole different story to retain them. Most of your contributors will be volunteers. And that means: **as an Open Source project, you are doomed to be fun**.

### 1. Make contributions matter

Once someone’s contribution is ready, probably in the form of a pull request, try to get back to them as quickly as possible. A comment like “Thanks so much! I’ll review this next week” is better than not commenting at all. Once a code contribution gets merged, release a new version as fast as possible. At Hoodie, we automate that process entirely with [semantic-release](https://github.com/semantic-release/semantic-release). *A new Hoodie version with the new contribution is usually available minutes after the Pull Request is merged*.

### 2. Build relationships

Most communications within Open Source projects are anonymous. It makes a huge difference when your contributors are able to connect, even if it’s through a short video chat. Regular team hangouts are a great way for contributors to meet the people running a project. Something I personally like to do is to invite a new contributor to a spontaneous call, so I can say thank you in person and introduce myself.

### 3. Turn contributors into committers

A committer can edit code, create branches and manage issues. It’s a sign of trust and an award to be officially invited to become part of the project. You can require that all tests still pass and code coverage remains at 100% before anything can get merged into a master branch. Another integration we like at Hoodie is [LGTM](https://lgtm.co/) — it requires a “LGTM” comment from two members of the maintainers team. And if you use GitHub for collaboration, there are great ways to [protect branches](https://help.github.com/articles/about-protected-branches/), so nothing can (accidentally) be damaged.

## 4. Turn committers into maintainers

A maintainer’s overarching goal is to maintain and improve the space for contributors. This can mean a lot of things:

a. Respond to issues
b. prepare issues for new contributors
c. document workflows
d. write tutorials
e. summarize what happened so more people can follow the progress.

### 5. Show genuine appreciation

A symbolic award increases the retention rate of new Wikipedia editors by 25% (with a statistically significant effect for a year). An award can be as simple as saying thank you in public. It is powerful. It’s about fostering a culture around appreciation. That’s what [we do with regular shout outs at Hoodie](http://hood.ie/blog/shoutouts-week-16.html "Shoutouts Week 16"), for example. Also check out [all-contributors](https://github.com/kentcdodds/all-contributors).

### 6. Be Transparent

Avoid private discussions. All discussions should be documented and made public with enough time for everyone to who cares to comment.  Especially when it comes to money, try to be as transparent as possible. A promising new project to help with that is [Open Collective](https://opencollective.com/).

### 7.  Remember: nobody is entitled to your attention. With that in mind, with more users, you will need more contributors. And with more contributors, you will need more maintainers. I highly recommend to read [Mikeal’s Healthy Open Source](https://medium.com/u/70d203660866) and [Growing a contributor base in modern open source](https://opensource.com/life/16/5/growing-contributor-base-modern-open-source) on that topic.

## What’s next?

A lot of the work we invest into making Hoodie a welcoming community is manual labor. Finding out who contributed? It turns out it is not so easy, if you care about more than just code. Creating well documented issues for new and existing contributors? It is a lot of copy and paste.
And as coders, what do we do when we repeat ourselves? We create tools to automate our chores. In the case of community management however, we shouldn’t automate everything, but we should create amazing tools that help us at becoming better and more efficient.

Imagine if the tools for our communities were as good as for our code. Imagine if we could see how the balance between users, contributors and maintainers evolves over time. Imagine if we could see who contributed something, if it was their first contribution to your project, or to Open Source in general. Imagine if everyone could show appreciation for every contribution.

An issue [like this](https://github.com/hoodiehq/camp/issues/9) could be created with very little effort. An automated bot could ping maintainers depending of the day and the time. It could automate the workflow from claiming an issue by a new contributor, to starting a pull request, to reaching out to the right maintainers at the right time, to letting the contributor know when the code was released, adding the contributor to the team, giving a shout out, and learning more about demographics of your project.
Code is not the challenge of our Open Source communities.

**People are.**

**Let’s put them first.**

* * *

Thanks to [Coraline Ada Ehmke](https://twitter.com/CoralineAda), [Jan Lehnardt](https://twitter.com/janl), [Kent C. Dodds](https://twitter.com/kentcdodds) and Kim Crayton for their reviews ❤

branch_name: refs/heads/gh-pages

gha_language: HTML


text:
# Wave
A cross platform music player built using [Electron.js](https://electronjs.org/). This software is under develpment. Main motto behind this app is to learn electron js concepts.

## Installation and Starting App (Development and Testing only)
```
npm install
npm start
```


text:
# 7.3 Handling abnormal thread termination

* One of the few times when you might want to consider catching `RuntimeException` is when you are calling unknown, untrusted code through an abstraction such as `Runnable`

## Example

* If a worker thread task in a thread pool throws an unchecked exception, let the thread die, but send notification that the thread has died so that some recovery may occur

```java
public void run() {
  Throwable thrown = null;
  try {
    while (!isInterrupted()) {
      runTask(getTaskFromQueue());
    }
  } catch (Throwable e) {
    thrown = e;
  } finally {
    exitThread(this, thrown);
  }
}
```

## 7.3.1 Uncaught exception handlers

* When a thread exits due to an uncaught exception, the JVM reports this event to the `UncaughtExceptionHandler`
* The handler could print an error message and a stack trace, or it could try restarting the thread, shutting down the application, send a notification, etc
* Specify the `UncaughtExceptionHandler` when constructing a `ThreadPoolExecutor`
* Exceptions thrown from tasks make it to the `UCEH` only if they are submitted with `execute`
  * Exceptions thrown (checked and unchecked) for tasks submitted with `submit` are considered part of the task's return status
  * These exceptions are rethrown by `Future.get` wrapped in an `ExecutionException`

url: https://raw.githubusercontent.com/jaebradley/notes/b9cb0fac012e61205d12ed8d139bbc494319e392/Software Engineering/Languages/java/Java Concurrency In Practice/Chapter 7/3 Handling abnormal thread termination.md

repository: jaebradley/notes

branch_name: refs/heads/main

gha_license_id: MIT

repo_name: jaebradley/notes


text:
# Lucid Technical Assessment

The problem
-----

We have a set of tasks, each running at least daily, which are scheduled with a simplified cron.

We want to find when each of them will next run.

The scheduler configuration looks like this:

    30 1 /bin/run_me_daily
    45 * /bin/run_me_hourly
    * * /bin/run_me_every_minute
    * 19 /bin/run_me_sixty_times

The first field is the minutes past the hour, the second field is the hour of
the day and the third is the command to run. For both cases * means that it
should run for all values of that field.

In the above example run_me_daily has been set to run at 1:30am every day and
run_me_hourly at 45 minutes past the hour every hour. The fields are
whitespace separated and each entry is on a separate line.

We would like you to write a command line program that outputs the soonest
time at which each of the commands will run and whether this will be today
or tomorrow.

The config input will be via STDIN, and the output should be via STDOUT.

The 'current time' will be the single command line argument to the program
in the format HH:MM.

For example given the above examples as input and the simulated
'current time' command-line argument 16:10 the output should be:

    1:30 tomorrow - /bin/run_me_daily
    16:45 today - /bin/run_me_hourly
    16:10 today - /bin/run_me_every_minute
    19:00 today - /bin/run_me_sixty_times

You may use any programming language you are comfortable in to solve this
problem, and you may use source code snippets found elsewhere as long as
you can comprehensively explain them.

We will want to run your tool against an automated test suite, so please
supply instructions for running it and installing any dependencies.
Additionally, it must work on at least one of OSX and Linux (ideally both).

Publishing
-----

Please submit all code as attachments, not in the body of the email.
Alternatively you can share a source code repository with us.

repository: ppgsalomao/lucid-challenge

path: /docs/Lucid Technical Assessment.md

filename: Lucid Technical Assessment.md

repo_name: ppgsalomao/lucid-challenge


text:
# Overview

Mangosta (esp. for mongoose) is a factory library for mongoose, which provides a simple but powerful interface.

# Installation

$ npm install mangosta

# User Guide

find the API under: http://doodzik.github.io/mangosta

###Factory file
__dirname/test/factory/test_factory.js

```javascript
var factory, test_factory1, Factory, mongoose;

mongoose = require('mongoose');
Factory = require('mangosta');
model = mongoose.model("factory");//get model, which was previously created
test_factory1 = require(__dirname/test/factory/test_factory.js);

factory = new Factory(model, function() {
  return {
    key: value,
    $child: { // child factory -> isnt going to be in the doc
      // define child factory as an object or a function
      // define child as function if it is important that the child is build on every build/create operation
      //   -> for example another factory
      child_name: function() {
        return {
          key: value
        };
      },
      child_name: {
        key: value
        $child: {
          child_name: function() {
            //example of another factory in a factory -> call this as a regular child no changes needed
            var $docs;
            test_factory1.build({}, function(err, doc){
              $docs = doc;
            });
            return {
              firstName: $docs.test
            };
          }
        }
      }
    }
  }
});

module.exports = factory;
```

###Test file
__dirname/test/index.js

```javascript

factory = require("./factories/test_factory.js");

//build and create accept the same parameters
factory.create(obj, callback)
factory.build(obj, callback)

// if single document return object else Array Object
// create return same param as model.create
callback = function(err, docs) {}

obj =
  {
    $seq: Int,
    // reset seq to given num
    $factory: String,
    // if factory isnt defined use the default factory
    $docs:[
    //or $doc but then without the squared brackets
    //you can skip every key -> you can parse a empty object
      {
        // if the factory isnt defined use the factory of the parent
        $factory: String,
        //define how many of these object should be created
        $num: Int,
        // you can modify the values of the factory
        key: value
      }
      //add objects here to create multi num document with different factory
      //or/and value for key of main factory
    ]
  };;

// if you wish you can access the model directly by factory.model

// string methods
// just include them in the value
// please visit the strgMethods module to see what you can do
// https://github.com/doodzik/strg_methods

```

or to see more examples look at the testfile

# License

(The MIT License)

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

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

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

repository: MrPaulCR/Code

repo_name: MrPaulCR/Code


text:
# Melanopus calyculus (Pat.) Pat., 1900 SPECIES

#### Status
SYNONYM

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

#### Published in
Essai Tax. Hyménomyc. (Lons-le-Saunier) 80 (1900)

#### Original name
Polyporus calyculus Pat. & Gaillard, 1888

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Polyporus/Polyporus leprieurii/ Syn. Melanopus calyculus/README.md

repo_name: mdoering/backbone


text:
# tfctl

Go client for TF Operator. See [here](https://github.com/kubeflow/tf-operator).

## Getting Started

### Prerequisites

* `go` is required, see [here](https://golang.org/).
* `dep` is required, see [here](https://github.com/golang/dep/).

```bash
$ go get https://github.com/stpabhi/tfctl
$ cd $GOPATH/src/github.com/stpabhi/tfctl
$ make deps && make all
```

### Downloading vendor dependencies

```bash
make deps
```

### Running tfctl

```bash
make run
```

### Example commands

##### Submit TFJob
```bash
bin/tfctl submit mycnnjob.yaml -n kubeflow

```

##### List TFJob
```bash
bin/tfctl list

```

### TODO

* Humanize command output to tables instead of logging to console.
* and more

## Contributing

If you are interested in adding to this project, see the [contributing guide](CONTRIBUTING.md) for information on how you can get involved.

repository: stpabhi/tfctl

repo_name: stpabhi/tfctl


text:
# Logging

Django uses Python's builtin logging module to perform system logging.

A Python logging configuration consists of four parts:

- Loggers

A logger is the entry point into the logging system. Each logger is a named bucket to which messages can be written for processing.

- DEBUG: Low level system information for debugging purposes
- INFO: General system information
- WARNING: Information describing a minor problem that has occurred.
- ERROR: Information describing a major problem that has occurred.
- CRITICAL: Information describing a critical problem that has occurred.

Each message that is written to the logger is aLog Record. Each log record also has alog levelindicating the severity of that specific message. A log record can also contain useful metadata that describes the event that is being logged. This can include details such as a stack trace or an error code.

When a message is given to the logger, the log level of the message is compared to the log level of the logger. If the log level of the message meets or exceeds the log level of the logger itself, the message will undergo further processing. If it doesn't, the message will be ignored.

Once a logger has determined that a message needs to be processed, it is passed to aHandler.

- Handlers

The handler is the engine that determines what happens to each message in a logger. It describes a particular logging behavior, such as writing a message to the screen, to a file, or to a network socket.

- Filters

A filter is used to provide additional control over which log records are passed from logger to handler.

- Formatters

Ultimately, a log record needs to be rendered as text. Formatters describe the exact format of that text.

"format": "[%(asctime)s] [%(levelname)s in %(module)s - %(funcName)s():%(lineno)s]: %(message)s",

## Logging database queries in django

```python
import logging

l = logging.getLogger('django.db.backends')

l.setLevel(logging.DEBUG)

l.addHandler(logging.StreamHandler())

## Setting Logging the right way in Python

import logging

handler = logging.StreamHandler()

formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')

handler.setFormatter(formatter)

log = logging.getLogger('kademlia')

log.addHandler(handler)

log.setLevel(logging.DEBUG)
```

## Logging in settings.py

```python
LOGGING = {

'version': 1,

'disable_existing_loggers': False,

'filters': {

'require_debug_false': {

'()': 'django.utils.log.RequireDebugFalse'

}

},

'handlers': {

'mail_admins': {

'level': 'ERROR',

'filters': ['require_debug_false'],

'class': 'django.utils.log.AdminEmailHandler',

'include_html': True,

},

'console': {

'class': 'logging.StreamHandler',

},

},

'loggers': {

'django.request': {

'handlers': ['console', 'mail_admins'],

'level': 'INFO',

'propagate': False,

},

'django': {

'handlers': ['console', 'mail_admins'],

'level': 'INFO',

},

}

}

## Turning on db hits logging for django queries

import logging

l = logging.getLogger('django.db.backends')

l.setLevel(logging.DEBUG)

l.addHandler(logging.StreamHandler())
```

## See Also > Python > Documentation > 16. Generic Operating System Services / Logging

## References

<https://docs.djangoproject.com/en/2.0/topics/logging>

<https://djangodeconstructed.com/2018/12/18/django-and-python-logging-in-plain-english>

gha_language: JavaScript


text:
# Endococcus Nyl. GENUS

#### Status
ACCEPTED

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

#### Published in
Mém. Soc. natn. Sci. nat. math. Cherbourg 3: 193 (1855)

#### Original name
Endococcus Nyl.

### Remarks
null


text:
---
layout: post
date:	2014-07-09 19:38:00
title:  LJ ( and SO) meet,030714
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
What better way to  observe the eve of American Independence Day than by meeting two Americans who are now independent of their country? It has been a long time in the planning, but I finally met up with <lj user="idahoswede"> and <lj user="pondhopper">. And of course, what better setting for the meet than the beautiful, 180-year-old home of <lj user="kejn">, in Staffanstorp, in southern Sweden? It was an added bonus that <lj user="prashanthchengi">, living and working in Linkoping, could also be there. Caro's SO, Ray, Donna's husband (and SO) Manolo, and Nina's SO, Fran, were there, to add to the festivity of the occasion, too!

I made dinner for everyone; it was

 bisi belE bAth

 boondi raita

and "venkAya vengAyam" (venkAya is brinjal or aubergine in Telugu, and vengayam is onion in Tamizh)...an easy recipe that my mother used to make, and which is one of my favourites.

Nina had provided a chicken dish for those who might not like the spices.

For dessert, I'd ordered "gunjA lAdu" from a lady in Bangalore, and taken them along.

I set both Nina and PC to work for a bit of help early on in the cooking!

I'm sorry, I was rather tense about whether everyone would like the food or starve politely; so I didn't take a single pic of the food, and I don't think anyone else did, either! We gathered in the porch of Nina's home, that looks on to her lush green backyard:

I certainly stopped worrying when I knew that Nina was providing an alternate dish! In the event, everyone seemed to enjoy the food, though of course Nina and Caro complained that I'd toned down the spices! Even Fran, who emphatically does not like Indian spices, said she liked the raita.

Introductions and hugs always go well when there are bottles of wine around! Manolo waxed lyrical over the wine that he'd bought (apparently one should read the labels of wine bottles like fine literature!). I'm not a wine or a liquor person, so I cannot describe all of it...I do know that there was some fine single malt whisky as well. But here are two of the bottles, for your information...don't they look beautiful?

Here we are, from L to R, Caro, Donna, Ray, Prashanth, Manolo, Fran, and Nina, all smiling for me!

Here's Manolo, wearing the Garhwali tOpi that I got him:

Fran, meanwhile, was putting PC at his ease...and they got along like the proverbial ignited dwelling, and he actually extended his stay at her earnest request!

Here we are, toasting friendship and LJ...as you can see, dinner is not yet served.

Here are India and Spain in Sweden, making friends:

PC is trying to see if he can strangle both Manolo and Fran at the same time!

Here's part of the 180-year-old house (only the cats, Houdini and Vaz, enter this room!)

We all met up the next day, too, at the stuga (cottage) which the other four had rented, and then Nina, PC and I went to visit some ancient heritage...the Torna church, the megalithic stone "ship" on the shores of the Baltic Sea at Kaseberg, and the Glimmingehus castle...but that is the next post!

Here's to the great friends that LJ has brought into my life!


text:
# References

We now come to another important and fundamental feature of C++.

Simply put, a reference is an alias of another variable. In Java, all variable of object types are references by default (you don't have a choice). In C++, you do have a choice.

First, it is necessary to explain another important concept in C++: _l-values_ and _r-values_.

An _l-value_ is a value that has a memory location. That is, it can appear on the left-hand-side of an assignment (hence the 'L'). An _r-value_ is a value that does not have a memory location. That is, it can _only_ appear on the right-hand-side of an assignment.

For example, variables are l-values, where as literals are r-values. You can take the address of an l-value with the `&` operator. You cannot do that for r-values. For example, you cannot do `&3`.

In C++, you can create a reference to any l-value:
```cpp
int x = 0;
int& y = x;     // y is a reference to x

y = 0;          // x now also is 0
y = &x;         // compile error: y is of type int, but &x is an int*

if(&y == &x) {
    std::cout << "Same" << std::endl; // This will print
}

int& z = 3;    // compile error: cannot initialize a reference from an r-value
```

`y` can never be disentangled from `x`. And it is interchangeable with `x` (assuming that `x` remains in scope). Anything done to `y` will happen also to `x`, and vice versa. Take the address of `y` results in the same value as taking the address of `x`. They are identical in every way, except possibly scope and `const`-ness, as we will see.

You may be wondering (quite naturally) why you would do this, as opposed to passing a pointer.

The answer is simply that there are a lot of places where references are more convenient for various reasons. This will become more apparent in upcoming chapters.

In particular, not that it is often useful to take parameters by value:
```cpp
void foo(int& x) {
    x++;
}

// somewhere else
int x = 0;
foo(x);
std::cout << x << std::endl; // prints '1'
```

Voila! That's about it.

----

#### Const references

Before moving on, let me address `const` references.

```cpp
void foo(const int& x) {
    x++;                 // compile error: x is const!
}

int x = 0;
foo(x);
```

Just as in the previous chapter, declaring `x` as `const` represents a promise that `foo` will not change its value, even though `x` is a reference. This is even more useful when dealing with objects.
```cpp
void foo(const Foo& my_foo) {
    my_foo.print();
}
```
Here we can use the dot-operator, rather than the arrow-operator (`->`), because `my_foo` is not a pointer. However, we cannot call any methods of `Foo` that would mutate `my_foo`; we can only call `const` methods. Thus, references in this context represent a convenient way to pass objects without dealing with pointers and with all the benefits of having immutability. We can give the `foo` method our `Foo` object and let it do whatever it wants, and we know that it will never change because `my_foo` is const. At the same time, `foo` can avoid dealing with dereferences and arrows. And since references are essentially arrows under the hood, they are fast to pass around.

Also, I lied. You can take references to r-value in some cases...

Imagine that we have the following function:
```
void foo(const int& x) {
    std::cout << x << std::endl;
}
```

Currently, you can do the following:
```
int x = 0;
foo(x);
```

However, there is really nothing intuitively wrong with doing this:
```
foo(3);
```

After all, `x` is `const`! Nothing about the definition of `foo` can possibly depend on `x` being an l-value (having a memory location).

Indeed, C++ agrees with you, and you can do that!

**`const` references can be assigned r-values.**


text:
# Installation
> `npm install --save @types/nouislider`

# Summary
This package contains type definitions for nouislider (https://github.com/leongersen/noUiSlider).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nouislider.

### Additional Details
 * Last updated: Sun, 21 Feb 2021 20:47:15 GMT
 * Dependencies: [@types/wnumb](https://npmjs.com/package/@types/wnumb)
 * Global values: `noUiSlider`

# Credits
These definitions were written by [Patrick Davies](https://github.com/bleuarg), and [Guust Nieuwenhuis](https://github.com/lagaffe).

repository: randyquaye/randyquaye

repo_name: randyquaye/randyquaye


text:
Just an experiment in generating an infinite,procedural 2d maze.

![Screenshot](https://github.com/toby1984/infinimaze/blob/master/screenshot.png)

# Requirements

- Maven 3.x
- JDK 8

# Building

```mvn clean package```

# Running

```java -jar target/infinimaze.jar```

Use WASD to move around, mouse wheel (or '+' and '-') to zoom in/out , hit CTRL-F to toggle debug rendering mode


text:
alleycat.py
================

Features
--------

  * Finds paths to a given code block inside a function
  * Finds paths between two or more functions
  * Generates interactive call graphs
  * Fully scriptable

Usage
-----

In IDA's UI, navigate to `View->Graphs->Find paths from the current function to...`; this will search for call paths from the function your cursor is currently in to one or more destination functions.

Select a function from the function chooser dialog and click `OK`.

You will be prompted again to choose another function; you may continue this process to select as many destination functions as you'd like. Once you are finished, click `Cancel` or press the `Esc` button.

The call graph is interactive; double-clicking on a graph node will jump to that location in IDA's disassembly window. You may also dynamically change which nodes are displayed at any time using the following hotkeys:

  * To only show paths that traverse a particular node: right-click the graph, select `Include node`, and then click on the node.
  * To exclude all paths that traverse a particular node: right-click the graph, select `Exclude node` and then click on the node.
  * To undo any of the above actions: right-click the graph, and select `Undo`.
  * To redo an undo: right-click the graph, and select `Redo`.
  * To reset the graph: right-click the graph, and select `Reset graph`.

For practical purposes, there is a maximum depth limit imposed on path searches. You can increase or decrease this limit in the IDAPython terminal:

```
Python> print ALLEYCAT_LIMIT
10000
Python> ALLEYCAT_LIMIT = 2500
```

Scripting
---------

To generate a list of unique paths between two functions, use the `AlleyCatFunctionPaths` class:

```
Python> print AlleyCatFunctionPaths(ScreenEA(), idc.LocByName('strcpy')).paths
```

To generate a list of unique paths from the between two code blocks inside a function, use the `AlleyCatCodePaths` class:

```
Python> print AlleyCatCodePaths(idaapi.get_func(idc.ScreenEA()).startEA, idc.ScreenEA()).paths
```

To create an interactive graph, use the `AlleyCatGraph` class:

```
Python> paths = AlleyCatFunctionPaths(ScreenEA(), idc.LocByName('strcpy')).paths
Python> graph = AlleyCatGraph(paths)
Python> graph.Show()
```

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

Just copy alleycat.py into your IDA `plugins` directory.

repository: fuzzywalls/ida

repo_name: fuzzywalls/ida


text:
### Chart Factory ###

Based on D3.JS and Dimple, ChartFactory provide the ability to build quickly D3.JS charts without coding any lines of javascript. Just define your dashboard in a JSON and voila !

As Dimple does, it expose the core d3 objects where possible so that as users gain confidence they can extend the base functionality in whatever way they wish.

repository: PereiraM/ChartFactory

repo_name: PereiraM/ChartFactory


text:
# EventHorizon

The point of no return for your events. EventHorizon is an open source [CloudEvents](https://cloudevents.io) implementation to allow handling massive number of events.

## Introduction

EventHorizon provides a uniform way for handling events ([CloudEvents](https://cloudevents.io)) in a Kubernetes native way, by implementing a Custom Resource Definition. Example: **[samples/kubernetes/EventHorizon.yml](samples/kubernetes/EventHorizon.yml)**.

## Current status

Under active development, any contributions are welcome.

## Installing

Download latest release at [GitHub releases page](https://github.com/acesso-io/eventhorizon/releases), extract content and open a terminal inside the folder.

repository: InnovativeConsulting/eventhorizon

repo_name: InnovativeConsulting/eventhorizon


text:
* run from root folder
```sh
$> ansible-playbook site.yml --tags "swag-up"
```
* to stop
```sh
$> ansible-playbook site.yml --tags "swag-down"
```

* to delete with data
```sh
$> ansible-playbook site.yml --tags "swag-teardown"
```

* to enable AWS - route53
```sh
$> ansible-galaxy collection install community.aws
```


text:
This is the sample code for the iOS recipe for persisting customized tab bar buttons.

[See the recipe at developer.xamarin.com](http://developer.xamarin.com/recipes/ios/content_controls/tab_bar/persist_customized_tab_bar_buttons/)

repository: globalhqw/recipes

repo_name: globalhqw/recipes


text:
---
layout: default
modal-id: 1
date: 2014-07-18
img: ipl.jpg
alt: image-alt
project-date: April 2014
client: Start Bootstrap
category: Web Development
title: IPL Data Set Analysis
description: In this notebook I try to analyse the performance of bowlers and batsmen based on the data from 9 seasons of the Indian Premier League(2008-2016)...Looking forward to predict their performance by building a predict model based on this data.The ipython-notebook can be accessed by clicking this button  github

---

extension: markdown


text:
---
layout: post
title: Prime.prime?
date: 2015-12-31
---

I solved [this Codewars kata](http://www.codewars.com/kata/560b8d7106ede725dd0000e2/train/ruby) tonight, yay:

```ruby
require 'prime'

def prime_bef_aft(num)
  primes = []
  Prime.each(num){ |n| primes << n }
  primes.last == num ? bef_prime = primes[-2] : bef_prime = primes.last
  aft_prime = Prime.first(primes.size + 1).last
  [bef_prime, aft_prime]
end
```

I need to examine the [top-rated solution](http://www.codewars.com/kata/reviews/560c0937fc9968244e000010/groups/562208f693699057df000019), though:

```ruby
require 'prime'

def bef_prime(num)
  num -= 1
  return num.prime? ? num : bef_prime(num)
end

def aft_prime(num)
  num += 1
  return num.prime? ? num : aft_prime(num)
end

def prime_bef_aft(num)
  [bef_prime(num), aft_prime(num)]
end
```

The title of this post is only generally relevant to the topic at hand; I just really like the idea of reading Ruby code as human language. `Prime.prime?` seems to read as some sort of existential question.


text:
# udacity-classic-arcade-game-clone
Project: Classic Arcade Game Clone

## Using

Clone this repo to your desktop, go to `udacity-classic-arcade-game-clone` its directory and run:

```bash
$ python -m SimpleHTTPServer
```

Access and test application, Navigate to

```bash
http://localhost:8000
```


text:
# Redux Callback Router

This is the Redux flavor of [Callback Router], which allows you to keep the URL
synchronized with your Redux state In addition to generic callbacks, you can map
routes to action creators so that navigation will dispatch an action.

## Install

[yarn][]:
```bash
yarn add redux-callback-router
```

[npm][]:

```bash
npm install redux-callback-router
```

## Usage

```js
import {
  ROUTE_CHANGE_INITIALIZE,
  createCallbackRouterReducer,
  registerRoutes,
} from 'redux-callback-router';

import yourReducer from './reducer';

// Map the state to paths
function mapStateToPath(state, action, prevState) {
  if (state.id) {
    if (action.type === 'CHANGE_USER') {
      // Return a string for the pushState destination
      return `/users/${id}`;
    } else {
      // Return [string, options] to customize navigation
      return [`/users/${id}`, { replaceState: true }];
    }
  }
  // Otherwise, leave path unchanged
  return null;
}

// Wrap the router to update the path on state changes
const reducer = createCallbackRouterReducer(yourReducer, mapStateToPath);

// Use the wrapped reducer to create your Redux store
const store = createStore(reducer);

// Register the routes
const {
  unregisterRoutes,
  evaluate,
} = registerRoutes({
  '/users': {
    type: 'SHOW_USERS',
  },
  '/users/:id': {
    action: (params) => ({
      type: 'SHOW_USER',
      payload: {
        userId: params.id,
      },
    }),
    last: true, // prevent '/users' route from firing
  },
}, store.dispatch, store.getState);

// Evaluate the current URI
evaluate(
  document.location.pathname,
  window.history.state,
  ROUTE_CHANGE_INITIALIZE,
);

// Unregister the routes
unregisterRoutes();
```

## API

* [`registerRoutes(routes, callback)`](#registerRoutes)
* [`evaluate(pathname, state, type, routes)`](#evaluate)
* [`navigate(path, options)`](#navigate)
* [`createCallbackRouterReducer(reducer, mapStateToPath, navigateInitialState)`](#createCallbackRouterReducer)

---

####  `registerRoutes`

Registers paths to their callbacks.

Returns functions to unregister the routes and evaluate a given path.

```js
const {
  unregisterRoutes,
  evaluate,
} = registerRoutes(routes, callback);
```

Returns `{ unregisterRoutes, evaluate }`.

##### `routes` (`Object`)

Map of paths to route definitions, actions creators, or actions.
The path may contain named `:params` or `(.*)` wildcards.

Route definitions have the following properties:

###### `action` (`Object`)

A Redux action that is dispatched when the route is matched.

###### `action(params, type, pathname, state, path, getState)`

Function that generates an action to be dispatched when the route is matched.

###### `callback(params, type, dispatch, getState, pathname, state, path)`

Function invoked when the route is matched.

This is an alternative to `action` for cases where a route needs to dispatch
multiple actions or have some other special behavior.

###### `exact` (`boolean`, defaults to `false`)

When set, this will not honor a partial match.
For example a URI `/user/123` would not match the route `/user`.

###### `last` (`boolean`, defaults to `true`)

When set, a match on this route will prevent subsequent lower-priority routes
from being evaluated.

###### `navigate` (`boolean`, defaults to `false`)

When set, this route will be evaluated for imperative navigation (`pushState`
and `replaceState`) whether or not navigation is forced.

###### `strict` (`boolean`, defaults to `false`)

When set, the trailing slash must be present or omitted exactly as the route is
defined. For example, a URI `/users` would not match the route `/users/`, or
vise-versa.

##### `callback(result)` (`Function`, optional)

Common callback invoked at the end of any matching route's callback.

---

#### `evaluate`

Determines which routes match the pathname and invokes their callbacks.

Returns the value returned from the callback of the highest-priority (first)
matching route.

```js
const result = evaluate(
  pathname,
  state,
  type,
  routes,
);
```

##### `pathname` (`string`, defaults to `document.location.pathname`)

URI to evaluate

##### `state` (`Object`, defaults to window.history.state)

Additional state data associated with the current history item.

##### `type` (`string`)

Navigation type used to differentiate between imperative navigation and browser navigation.

* `ROUTE_CHANGE_INITIALIZE`: Router was first registered
* `ROUTE_CHANGE_PUSH_STATE`: Imperative navigation (skips callback)
* `ROUTE_CHANGE_REPLACE_STATE`: Imperative navigation (skips callback)
* `ROUTE_CHANGE_POP_STATE`: Browser navigation (invokes callback)
* `ROUTE_CHANGE_FORCE_PUSH_STATE`: Imperative navigation (invokes callback)
* `ROUTE_CHANGE_FORCE_REPLACE_STATE`: Imperative navigation  (invokes callback)
* `ROUTE_CHANGE_UNKNOWN`: Unknown navigation type

##### `routes` (`Object`, defaults to all registered routes)

Map of paths to route definitions or callbacks.

---

#### `navigate`

Performs imperative navigation.

By default, this _only_ modifies history using `pushState` or `replaceState`.
Routes without `navigate` enabled are _not_ evaluated unless the `force` option
is enabled!

Returns the result of the callback if a route was evaluated.

```js
const result = navigate(path, {
  force,
  replaceState,
  state,
  title,
});
```

##### `path` (`string`)

Destination pathname.

##### `options.force` (`boolean`, defaults to `false`)

When set, this will evaluate non-`navigate` routes.

##### `options.replaceState` (`boolean`, defaults to `false`)

When set, this replaces the current history state instead of pushing an
additional state.

##### `options.state` (`Object`, defaults to `{}`)

Additional data associated with the state.

##### `options.title` (`string`, defaults to `document.title`)

Title of the history state.

---

####  `createCallbackRouterReducer`

Creates a wrapped reducer that can update the history based on the state.

```js
const wrappedReducer = createCallbackRouterReducer(
  reducer,
  mapStateToPath,
  navigateInitialState, // default: false
);
```

##### `reducer` (`Function`)

Reducer to connect to the Callback Router.

##### `mapStateToPath(state, action, prevState)`

Function that determines the URL from the state (and/or action).

The return value is used to determine whether and how `navigate` is invoked.
Return a string to push a new history state. Return an array with a string and
an object to specify the navigation `options`.

##### `navigateInitialState` (`boolean`, defaults to `false`)

The initial reducer call doesn't represent a state change, so navigation doesn't
typically make sense. Setting this will ignore that and attempt to navigate
after the initial reducer invocation.

## License

ISC © [Keith McKnight](https://github.com/kmck)

[yarn]: https://yarnpkg.com/lang/en/docs/install
[npm]: https://docs.npmjs.com/cli/install
[Callback Router]: https://github.com/kmck/callback-router/tree/master/packages/callback-router

license: ISC

repository: kmck/callback-router

repo_name: kmck/callback-router


text:
# [klaviyo-weather-app](https://www.klaviyo.com/)
Email web subscription service that makes weather based marketing emails for worldwide cities

### web application deployment directions
#### Deployed on Ubuntu 22.04 (LTS) x64 Digital Ocean droplet with git version 2.17.1, Python 3.10.6, & MySQL 5.7.41
#### subscription app service hosted [here](http://ericrxu.com:1984/klaviyo_weather_app)

- - - -

ssh into host or use Digital Ocean terminal console

Upgrade Ubuntu and packages

    sudo apt-get update
    sudo apt-get upgrade

Install mySQL ([Ubuntu 22.04 instructions here](https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-22-04))

Install git, go to home directory, and clone this repo

    sudo apt-get install git
    cd ~/
    git clone https://github.com/eric-r-xu/klaviyo-weather-app.git

Install latest python and all packages and activate virtual environment

    cd klaviyo-weather-app
    sh prepare_env.sh

**SUBSCRIPTION APPLICATION SERVICE**

Run flask web application in background (logs in /logs/subscription_service.log including standard error)

    nohup /$(whoami)/klaviyo-weather-app/env/bin/python /$(whoami)/klaviyo-weather-app/subscription_service.py 2>&1 &

**WEATHER API SERVICE** and **WEATHER EMAIL SERVICE**

Schedule cron for 8:55 am EST (5 minute buffer) to get weather data and forecasts and send async emails depending on time zone (limited support)

    export VISUAL=nano;crontab -e

    (logs in /logs/api_and_async_email.log including standard error)

    55 12 * * * /$(whoami)/klaviyo-weather-app/env/bin/python /$(whoami)/klaviyo-weather-app/api_and_async_email.py 2>&1

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

## Scalability
##### What happens if your app launches and goes viral? What bottlenecks would there be and how can you optimize the system or break through them?

>Currently this web application is deployed using a shared CPU Ubuntu 22.04 LTS Digital Ocean droplet.  To control for high volume, the subscription page limits 50 requests per hour and 200 requests per day for each remote address.  If the app reaches resource limits due to to high traffic, optimizations include (but are not limited to):

-  increasing the number of virtual CPUs (units of processing power) and RAM memory per cpu

- switching from shared CPU to dedicated CPUs to minimize hyperthread data loss

- hosting the web application on a WGSI server or a more production-ready Django web application framework to more efficiently handle concurrent requests/threads

- separating the subscription app server from the weather api and the weather email servers

- purging older subscriptions on a regular cadence to save on storage and compute (currently subscriptions older than 10 days are purged)

- using a distributed relational database architecture like hive on a hadoop distributed file system to more gracefully handle larger amounts of data

## Security
##### How does your app handle invalid or even malicious input from users?

- the email validator checks for blacklisted emails and ensures only valid emails can be subscribed
- the app limits the number of requests per remote address (50/hour and 200/day)

## Re-Usability
##### What components of your app would make sense to be their own modules or services so they can be re-used by other sections of code later?

- The weather powered email is comprised of 3 main components:

  - 1st component: SUBSCRIPTION APPLICATION SERVICE -- renders the subscription form html, validates/limits requests, and maintains MySQL subscription table tblDimEmailCity

  - 2nd component: WEATHER API SERVICE -- calls [open weather api]([https://www.weatherbit.io/api](https://openweathermap.org/api)) and maintains MySQL table tblFactCityWeather

  - 3rd component: WEATHER EMAIL SERVICE -- purges old subscriptions in MySQL table tblDimEmailCity and sends weather powered emails based on MySQL tables tblDimEmailCity and tblFactCityWeather

- With the appopriate cluster requirements, a parallelized task scheduler service like [airflow](https://airflow.apache.org/) could be useful to track and log the WEATHER API and WEATHER EMAIL services as their own operator tasks within a DAG with more flexible timezone scheduling with Celery and Redis.  The airflow webserver can then be started to log, track, and visualize task failures as well as task durations in an intuitive manner.

## Re-Inventing the Wheel?
##### We're big believers in not building what's already been built.

- I believe using mature open-source package solutions should be utilized as much as possible since it has the benefit of being thoroughly tested and furthers open-source package development.  However, building functionality yourself can be beneficial if:

  - (a) more flexibility is needed than an open-source project currently allows
  - (b) you want to test and scale out your prototype manually before committing to any existing solutions that may be costly or overkill
  - (c) time is critical & the language(s) and/or abstraction layer(s) are unfamiliar or complex

- The current weather app is built using Flask, a popular open-source microframework for creating flexible and lightweight web applications.  Instead of reinventing the wheel (or my own logic), I opted to use a popular python3 package for validating email addresses with added functionality such as domain validation and blacklist exclusion.

## Usability
##### It's important that Klaviyo be easy to use — both for our users and the people they're emailing. How could your app be easier (or maybe more fun) to use?

- I believe the app could be easier & more intuitive to use by allowing users to specify what frequency and what local time they prefer to receive the weather powered email (currently, the emails are sent once daily starting at 9 am PST).  Adding the functionality to subscribe more than one email at a time could also help with ease of use.

- I believe the weather powered email could be more fun/engaging to the subscribed users by displaying interesting factoids of weather data historically for each subscriber's city as well data on the other 99 US cities.

repository: eric-r-xu/klaviyo-weather-app

gha_language: Python

repo_name: eric-r-xu/klaviyo-weather-app


text:
---
modal-id: aa010
title: pimpMyBike
subtitle: Arduino-controlled bike lights, brake, speedometer
layout: post
date: 2013-1-1
img:
thumbnail: bike/bike-thumbnail.png
alt: D3 visualization
project-date: January 2013
tags: [Arduino, Physical Computing]
categories: [maker]
description: Arduino-controlled bike lights, brake, speedometer
---

I taught a four-part Skillshare class titled, “Introduction to Arduinos: pimpMyBike.” The course introduced electronics and Arduinos by workshopping the following bike-related projects:

* turning indicators & strobe night light
* speedometer / odometer
* brake lights
* battery pack

[GitHub Repo with visualizer](https://github.com/jdeboi/pimpMyBike)


text:
---
layout: post
title: "Startup - List of useful sites to entrepreneurs"
image: "startup"
---
When I started creating some web products and sites I always found myself with few options in terms of images, components and tools. Here, I present a list of very useful sites to help you in your work.

## HTML Frameworks
Create a website from scratch is not easy, you need to create a default css, define some css classes, components and guidelines. For this reason, I strongly recommend that you to use an html framework, this can save you a lot of time and put some order in your code.

In my case for example I don't have any great skill for chose color palettes, alignment, typography so an html framework helps me creating a minimally good presented site with low effort.

  - [getbootstrap.com](http://getbootstrap.com): Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web *(description extracted from getbootstrap website)*.
  - [foundation.zurb.com](http://foundation.zurb.com): Foundation is a family of responsive front-end frameworks that make it easy to design beautiful responsive websites, apps and emails that look amazing on any device *(description extracted from foundation website)*.

## Images

When you create a site it is dificult to find good free images with good resolution, here goes a list of some sites where you can get some photos.

  - [undraw.co](https://undraw.co)
  - [jaymantri.com](http://jaymantri.com/)
  - [snapwiresnaps.tumblr.com](http://snapwiresnaps.tumblr.com/)
  - [freeimages.com](http://www.freeimages.com/)
  - [picjumbo.com](http://picjumbo.com/)
  - [splitshire.com](http://splitshire.com/)
  - [lockandstockphotos.com](http://lockandstockphotos.com/)
  - [littlevisuals.co](http://littlevisuals.co/)
  - [stocksnap.io](https://stocksnap.io/)
  - [negativespace.co](http://negativespace.co/)
  - [picography.co](http://picography.co/)
  - [lifeofpix.com](http://www.lifeofpix.com/)
  - [unsplash.com](http://unsplash.com/)
  - [getrefe.tumblr.com](http://getrefe.tumblr.com/)
  - [gratisography.com](http://www.gratisography.com/)
  - [deathtothestockphoto.com](http://deathtothestockphoto.com/)
  - [pexels.com](https://www.pexels.com/)
  - [superfamous.com](http://superfamous.com/)
  - [publicdomainarchive.com](http://publicdomainarchive.com/)
  - [visualhunt.com](http://visualhunt.com/)

## Videos

Sometimes a video can be better to explain your ideas or products, here goes some services that you can use:

  - [animoto.com](https://animoto.com/)
  - [goanimate.com](https://goanimate.com/)
  - [studio.stupeflix.com](https://studio.stupeflix.com/)
  - [wideo.co](http://wideo.co/)

## Free icons
  - [flaticon.com](http://www.flaticon.com/)

## Free timelapses videos

  - [videos.pexels.com](https://videos.pexels.com/)
  - [pixabay.com/en/videos](https://pixabay.com/en/videos/)

## Generators
  - [favicon-generator.org](http://www.favicon-generator.org): Generate favicons and icon for Web, Android, Windows Phone and IOS.
  - [xml-sitemaps.com](https://www.xml-sitemaps.com): Generate the sitemap of your site.
  - [freefavicon.com](http://www.freefavicon.com/iconmaker/): A good favicon gallery and a favicon generator.

## Themes and templates

  - [wrapbootstrap.com](https://wrapbootstrap.com): WrapBootstrap is a marketplace for premium Bootstrap themes and templates.
  - [foundationdeck.com](https://www.foundationdeck.com): Foundation Deck is a foundation theme marketplace.
  - [startbootstrap.com](http://startbootstrap.com): Start Bootstrap is a library of free to download Bootstrap 3 themes and templates.
  - [bootstrapzero.com](http://www.bootstrapzero.com/): Curated open source themes for booststrap.
  - [bootswatch.com](https://bootswatch.com/): Free themes for bootstrap.
  - [bootstrapmade.com](https://bootstrapmade.com): Premium Bootstrap Themes & Templates.
  - [bootstrapious.com/free-templates](http://bootstrapious.com/free-templates): Free bootstrap templates.
  - [themewagon.com/themes](https://themewagon.com/themes): Bootstrap Themes & HTML5 Templates.
  - [templatemag.com/free-bootstrap-templates](https://templatemag.com/free-bootstrap-templates): Free Bootstrap HTML Templates.
  - [bootstraptaste.com](https://bootstraptaste.com): yet another free bootstrap template site.

## Community

  - [www.indiehackers.com](https://www.indiehackers.com/)

## Testing your site
  - [webpagetest.org](http://www.webpagetest.org): Test the performance of your site.
  - [seositecheckup.com](http://seositecheckup.com): SEO (Search Engine Optimization) checkup.
  - [responsivetest.net](http://responsivetest.net): Test how responsive your site is.
  - [studiopress.com](http://www.studiopress.com): Test your site in several screen sizes.
  - [gauntlet.io](http://gauntlet.io/): Test your website security againts several scanners (14 days free trial).

## Others
  - [fortawesome.github.io/Font-Awesome](https://fortawesome.github.io/Font-Awesome): Huge set of icons as fonts.
  - [www.iconfinder.com](http://www.iconfinder.com): icon database (not free).
  - [picapp.net](http://picapp.net/htc_one_m8_gunmetal_2): Generate screens of your site in several devices.
  - [lipis.github.io/bootstrap-social](http://lipis.github.io/bootstrap-social): Social Sign-In Buttons made in pure CSS based on Bootstrap and Font Awesome.

## Inspirations
  - [onepagelove.com](https://onepagelove.com)

gha_license_id: NOASSERTION


text:
---
id: communityPackages
title: Community Packages
sidebar_label: Community Packages
---

### Flipper

For projects that use Flipper, there is a Flipper plugin called [Advanced Async Storage](https://github.com/lbaldy/flipper-plugin-async-storage-advanced). The plugin provides basic CRUD operations on Async Storage.

### Non Flipper

For the projects which aren't using Flipper, you can use the [React Native Debugger](https://github.com/jhen0409/react-native-debugger) which comes with a built-in Async Storage support. The debugger allows to print the Async Storage content to the console, and clear it completely.

gha_language: TypeScript


text:
# 内容

- order: 2

带内容的用法，分别添加title，content，icon的效果。

:::lang=en-us
# Content

- order: 2

With the use of content, add the effects of title, content, and icon, respectively.

:::

---

````jsx
import { Timeline } from '@alifd/next';

const TimelineItem = Timeline.Item;
ReactDOM.render(<Timeline>
    <TimelineItem title="Sign" content="[Hangzhou] has received the sign, the signer is Alibaba Post Office, thank you for using STO, looking forward to serving you again" time={'2016-06-10 10:30:00'} state="process" />
    <TimelineItem title="Delivery" content="[Hangzhou]Express has reached Hangzhou Hangzhou Binjiang Company" time={'2016-06-10 09:30:00'} />
    <TimelineItem title="Delivery" content="[Hangzhou] Zhejiang Hangzhou Binjiang Company dispatches members for you" time={'2016-06-10 09:03:00'} />
    <TimelineItem title="Transport" content="[Hangzhou] Zhejiang Hangzhou Transshipment Center has been issued" time={'2016-06-10 06:10:00'} />
    <TimelineItem title="Transport" content="[Dongguan City] Guangdong Dongguan Transshipment Center has been issued" time={'2016-06-09 18:00:00'} />
    <TimelineItem title="Processing" content="[Dongguan City] Shentong Express Guangdong Fenggang Branch of Guangdong Province" time={'2016-06-09 16:12:00'} />
    <TimelineItem title="Processing" content="[Dongguan City] The merchant is informing the express company to insert" time={'2016-06-09 14:00:00'} />
    <TimelineItem title="Processing" content="[Dongguan City] Your order to be picked" time={'2016-06-09 10:12:19'} />
    <TimelineItem title="Processing" content="[Dongguan] Your order starts processing" time={'2016-06-09 10:01:09'} icon="atm"/>
</Timeline>, mountNode);
````

repository: alibaba-fusion/next

repo_name: alibaba-fusion/next


text:
## Multipart form data parser

### Modify

This version of multipart-parser-c is modified for llhttp PAUSE mode, the original `MPPE_OK` mode may not work (It may work but was not tested).

This version is tested by simple fuzz with honggfuzz, used in [swow](https://github.com/swow/swow) and [swoole](https://github.com/swoole/swoole-src).

### Features
* No dependencies
* Works with chunks of a data - no need to buffer the whole request
* Almost no internal buffering. Buffer size doesn't exceed the size of the boundary (~60-70 bytes)

Tested as part of [Cosmonaut](https://github.com/iafonov/cosmonaut) HTTP server.

Implementation based on [node-formidable](https://github.com/felixge/node-formidable) by [Felix Geisendörfer](https://github.com/felixge).

Inspired by [http-parser](https://github.com/joyent/http-parser) by [Ryan Dahl](https://github.com/ry).

### Usage (C)
This parser library works with several callbacks, which the user may set up at application initialization time.

```c
multipart_parser_settings callbacks;

memset(&callbacks, 0, sizeof(multipart_parser_settings));

callbacks.on_header_field = read_header_name;
callbacks.on_header_value = read_header_value;
```

These functions must match the signatures defined in the multipart-parser header file.  For this simple example, we'll just use two of the available callbacks to print all headers the library finds in multipart messages.

Returning a value other than 0 from the callbacks will abort message processing.

```c
int read_header_name(multipart_parser* p, const char *at, size_t length)
{
   printf("%.*s: ", length, at);
   return 0;
}

int read_header_value(multipart_parser* p, const char *at, size_t length)
{
   printf("%.*s\n", length, at);
   return 0;
}
```

When a message arrives, callers must parse the multipart boundary from the **Content-Type** header (see the [RFC](http://tools.ietf.org/html/rfc2387#section-5.1) for more information and examples), and then execute the parser.

```c
multipart_parser* parser = multipart_parser_init(boundary, &callbacks);
multipart_parser_execute(parser, body, length);
multipart_parser_free(parser);
```

### Usage (C++)
In C++, when the callbacks are static member functions it may be helpful to pass the instantiated multipart consumer along as context.  The following (abbreviated) class called `MultipartConsumer` shows how to pass `this` to callback functions in order to access non-static member data.

```cpp
class MultipartConsumer
{
public:
    MultipartConsumer(const std::string& boundary)
    {
        memset(&m_callbacks, 0, sizeof(multipart_parser_settings));
        m_callbacks.on_header_field = ReadHeaderName;
        m_callbacks.on_header_value = ReadHeaderValue;

        m_parser = multipart_parser_init(boundary.c_str(), &m_callbacks);
        multipart_parser_set_data(m_parser, this);
    }

    ~MultipartConsumer()
    {
        multipart_parser_free(m_parser);
    }

    int CountHeaders(const std::string& body)
    {
        multipart_parser_execute(m_parser, body.c_str(), body.size());
        return m_headers;
    }

private:
    static int ReadHeaderName(multipart_parser* p, const char *at, size_t length)
    {
        MultipartConsumer* me = (MultipartConsumer*)multipart_parser_get_data(p);
        me->m_headers++;
    }

    multipart_parser* m_parser;
    multipart_parser_settings m_callbacks;
    int m_headers;
};
```

### Contributors
* [Daniel T. Wagner](http://www.danieltwagner.de/)
* [James McLaughlin](http://udp.github.com/)
* [Jay Miller](http://www.cryptofreak.org)

© 2012 [Igor Afonov](http://iafonov.github.com)

repository: swow/swow

branch_name: refs/heads/develop

gha_language: C

repo_name: swow/swow


text:
# Paperbits demo

This repository contains an example of how using Paperbits you can enable advanced content authoring tools in your web apps.

[Live demo](https://demo.paperbits.io)

[![Join the chat at https://gitter.im/paperbits/discussions](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/paperbits/discussions)
[![Build status](https://dev.azure.com/paperbits/Paperbits/_apis/build/status/PR%20build%20-%20paperbits-demo)](https://dev.azure.com/paperbits/Paperbits/_build/latest?definitionId=4)

## Quick start
To run demo website locally, you'll need to:

1. Clone the demo project from GitHub:
```
git clone https://github.com/paperbits/paperbits-demo.git
```

2. Switch into just cloned directory:

```bash
cd paperbits-demo
```

3. Install packages required for work:

```bash
npm install
```

4. Run demo site:
```bash
npm start
```

## What's next?

[Getting started](https://paperbits.io/wiki/get-started)

[Blog](https://paperbits.io/blog)

[Contributing guide](https://paperbits.io/contributing)

## License
Use of this source code is governed by an MIT-style license that can be found in the LICENSE file and at https://paperbits.io/license/mit.

2022 (c) Copyright Paperbits. All Rights Reserved.

repository: paperbits/paperbits-demo

gha_language: SCSS

repo_name: paperbits/paperbits-demo


text:
This document describes how Terminology interacts with themes and what needs
to be handled by themes.

See `ChangeLog.theme` on changes related to themes.

Windows contain group `terminology/base`.

# `terminology/base`
Contains what is global to a window.

## Swallowed parts

### `terminology.content`
where `terminology/background`, or a split widget can be swallowed.

### `terminology.cmdbox`
To swallow a command box.
It reacts to the following signals:
* `cmdbox,show`
* `cmdbox,hide`

### `terminology.about`
It reacts to the following signals:
* `about,show`
* `about,hide`

### `terminology.optdetails`
Detailed settings panel.
It reacts to the following signals:
* `optdetails,show`
* `optdetails,hide`
It emits the following signal:
* `optdetails,hide,done`

### `terminology.options`
It reacts to the following signals:
* `options,show`
* `options,hide`

### `terminology.controls`
The controls box shown on right click.
It reacts to the following signals:
* `controls,show`
* `controls,hide`

# `terminology/background`

## Swallowed parts

### `terminology.content`
Here is swallowed an object of group `terminology.background`.

__TODO__

# `terminology/core`

## Swallowed parts

### `terminology.background`

Actual background.
It reacts to the following signals based on the media to play in background:
* `media,off`
* `media,image`
* `media,scale`
* `media,edje`
* `media,movie`

### `terminology.tabregion`
Here is swalloed a fully transparent rectangle to move down the textgrid.

### `terminology.content`
Where actual text grid goes.

## Signal received
### `tabbar,off` and `tabbar,on`
Whether to display a tab bar. Default is off.
### `tab_btn,off` and `tab_btn,on`
Whether to display a tab button to easily navigate through tabs. Default is off.

## Signal emitted
### `tab,drag` and `tab,drage,stop`
To notify that the current tab is being dragged.

# `terminology/about`
## Text parts
### `terminology.text`
The text of the __About__ message.

# `terminology.tabbar_back`
An inactive tab item
## Text parts
### `terminology.title`
Title of the tab.

## Signal emitted
### `tab,activate`
When clicked on it, to notify that the user wants to go to that tab.

## Signal received
### `bell`
To mark the tab as having missed a bell.
### `bell,off`
To unmark the tab as having missed a bell.

# `terminology/keybinding`
__TODO__

# `terminology/miniview`
__TODO__

# `terminology/fontpreview`
__TODO__

# `terminology/selection`
An object used when selecting text.
__TODO__

# `terminology/cursor`
__TODO__

# `terminology/cursor_bar`
__TODO__

# `terminology/cursor_underline`
__TODO__

# `terminology/sel/base`
__TODO__

# `terminology/sel/item`
__TODO__

# `terminology/link`
An object overlayd on text that is a link.

# `terminology/mediabusy`
__TODO__

# `terminology/mediactrl`
__TODO__


text:
# Extract and assign variables

### Sample use case

Extract variables from an XML and JSON response messages. Assign variables to HTTP response headers.

### Policies

This sample uses these policies:

* ![alt text](../../images/icon_policy_extract-variable.jpg "Extract Variables policy") Extract Variables: To pull subsets of data from the response body.
* ![alt text](../../images/icon-xml-to-json.jpg "XML to JSON policy") XML to JSON: To convert the response from XML to JSON.
* ![alt text](../../images/icon-assign-message.jpg "Assign Message policy") Assign Message: To assign extracted data to response headers.
* ![alt text](../../images/icon-policy-javascript.jpg "JavaScript policy") Reads extracted variables so they are visible in the Trace tool.

### About

1. Extract variables from the XML response sent from the target. Use XPath syntax to identify the data to extract.
2. Use JavaScript policy to read the variables. This allows them to show up in the Trace tool.
2. Convert the response payload from XML to JSON.
3. Extract more variables from the converted JSON payload. Use JSONPath syntax to identify the data to extract.
4.  Use JavaScript policy to read the variables. This allows them to show up in the Trace tool.
4. Assign the extracted variables to HTTP response headers.

### Set up, deploy, invoke

1. Edit this script with your environment details: `api-platform-samples/setup/setenv.sh`

2. `./deploy.sh`

3. `invoke.sh`

    The proxy returns these custom headers to the client:
    ```
    mock.city: San Jose
    mock.state: CA
    mock.firstName: John
    mock.lastName: Doe
    ```

See the main project [README](../../README.md) file for more detailed information about setting up, deploying, and invoking sample proxies.

### Trace

This screen shot from the [Apigee Edge trace tool](http://apigee.com/docs/api-services/content/using-trace-tool-0) shows the placement of the policies used in this sample.

![alt text](../../images/variables-trace.png)

### More information

**Related policies**

* [JSON to XML policy](http://apigee.com/docs/api-services/reference/json-xml-policy)
* [XSL transform policy](http://apigee.com/docs/api-services/reference/xsl-transform-policy)

**Related topics**

* [Variables reference](http://apigee.com/docs/api-services/reference/variables-reference)
* [Introduction to flow variables](http://apigee.com/docs/api-services/content/introduction-flow-variables)
* [Video: Using Extract Variables policy](https://www.youtube.com/watch?v=arVPRaL4qQk)
* [Video: Extracting variables from XML and JSON messages](https://www.youtube.com/watch?v=G0XnHRELeBA)

### Ask the community

[![alt text](../../images/apigee-community.png "Apigee Community is a great place to ask questions and find answers about developing API proxies. ")](https://community.apigee.com?via=github)

---

Copyright © 2016 Apigee Corporation

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

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

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

repository: neil-achieve/api-platform-samples

repo_name: neil-achieve/api-platform-samples


text:
# ByDesign GUID Seamless Authentication
This laravel package allows you to authenticate users in the ByDesign system and add them to your own user database within your own application.

## How It Works
A link is configured within revolution to go to a specific URL within your application. This URL can be customized via the config file. The package then checks if the GUID provided is legitimate and then gets information on the user account. If there is already a user in the system with that RepID, then that user will be authenticated. Otherwise, a new user account will be created.

## ENV File
```dotenv
BYDESIGN_REST_API_BASE_URL=https://webapi.securefreedom.com/{{Your Company Here}}/api
BYDESIGN_USERNAME=api
BYDESIGN_PASSWORD=password
```

## Config File
```php
return [
    // The final route would look something like this: /auth/{GUID}
    'auth_route' => '/auth',
    'base_url' => env('BYDESIGN_REST_API_BASE_URL'),

    'success_redirect_url' => '/',
    'failed_redirect_url' => '/failed-authentication',

    'username' => env('BYDESIGN_USERNAME', 'api'),
    'password' => env('BYDESIGN_PASSWORD')
];
```

## License
Copyright 2020 Data-Head Inc.

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: Data-Head/bydesign-seamless-auth

repo_name: Data-Head/bydesign-seamless-auth


text:
# Terrarium

Terrarium is a playground project to experiment with Salt management.

## Compile

```console
mvn package
```

## Running

```console
mvn exec:java -Dexec.mainClass="Main"
```

Then you can go to `http://localhost:4567/hello`

repository: Aeroglyphic/maven-application

repo_name: Aeroglyphic/maven-application


text:
# DEPRECATED
Use native [RxJava support](https://realm.io/news/realm-java-0.87.0/) in Realm

# realm-rxjava-example
Example of using Realm with RxJava on Android

Blog post: http://kboyarshinov.com/android/wrapping-realm-around-rxjava/

## LICENSE

Copyright 2015 Kirill Boyarshinov

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

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

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

repository: MayurSolanki/realm-rxjava-example

repo_name: MayurSolanki/realm-rxjava-example


text:
# dotfiles

very minimal set of dotfiles for your terminal

## installation

0. clone this repo:

   `$ git clone git@github.com:frodosamoa/dotfiles.git`

## homebrew

install homebrew in order to make use of the `Brewfile` located in this repo:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

then:

    brew tap Homebrew/bundle
    cd $DOTFILES && brew bundle

and also you can export the `Brewfile`:

    brew bundle dump --force

### nvm

nvm manages your node versions:

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

repository: frodosamoa/dotfiles

repo_name: frodosamoa/dotfiles


text:
# coffee_shop Specification

This is a very loose specification for the coffee_shop word processor.

## Functional Requirements

In the following requirements, it refers to the application, coffee_shop.

**FR1**: It must allow the user to type into the application.

 * **FR1.1**: As the user types, text will appear onto the screen.
 * **FR1.2**: Certain keyboard shortcuts will cause the system to act in a predictable way. Such as CTRL+s will force the program to save the current working document.

**FR2**: It must be able to save and open the users work.

**FR3**: The work environment must be customisable.

 * **FR3.1**: the user should be able to select a background color.
 * **FR3.2**: the user should be able to select a font color.
 * **FR3.3**: the user should be able to select a font, from a limited selection of fonts.
 * **FR3.4**: these setting should be saved between sessions

**FR4**: It must support find and replace.

**FR5**: It must be able to display a word count.

**FR6**: When the user clicks the print menu item, the dialog to print must be displayed.

## Non-Functional Requirements

**NFR1**: It must be Open Source

 * Suggested license is either [GPLv3](http://www.gnu.org/licenses/gpl.html) or [MIT](http://en.wikipedia.org/wiki/MIT_License). Basically it seems that the GPL requires if anyone is to ever use my code, they need to keep the code open source. The MIT license does not seem to require this. GPLv3 also requires that I provide a link to the code in the documentation if I distribute the code as a pre-compiled binary. Both licenses require that I distribute the license itself with the code and any pre-complied binaries.

**NFR2**: The language it is written in must be Open Source

 * Currently I am planning on using [Ruby](http://www.ruby-lang.org/en/) and [Shoes](http://github.com/shoes/shoes).

**NFR3**: It must run on Linux

 * It will not support all versions of Linux. I'm currently considering a build environment similar to Ubuntu 10.04.

**NFR4**: It must run full-screen.

**NFR5**: It should promote a distraction free work environment.

**NFR6**: It should be usable by people who work in various lighting environments (writing in a coffee shop, dark room, corporate environment)

**NFR7**: The format the work is saved in must be standards compliant format.

 * Suggestions would be either Markdown, plain-text, or both.


text:
### Benchmarks

All tests are performed on `int` keys and values currently.
Benchmarks are done using [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet)

* `HashMapOkasaki` is an implementation inspired by [Fast Mergeable Integer Maps](http://ittc.ku.edu/~andygill/papers/IntMap98.pdf) by *Chris Okasaki* and *Andrew Gill*
* `ImmutableDictionary` is the ImmutableDictionary from `System.Collections.Immutable`
* `FSharpX` uses `PersistentHashMap` from FSharpx.Collections
* `FSharpMap` is the standard search tree implementation from [FSharp.Core](https://github.com/dotnet/fsharp/blob/master/src/fsharp/FSharp.Core/map.fs) which is not really comparable but gives us a clue where the implementation stands
* `HAMT` is the V5 implementation from [HAMT.NET](https://github.com/alexandrnikitin/HAMT.NET)
* `ImTools` is the `ImHashMap` implementation from [ImTools](https://github.com/dadhi/ImTools)

### Results

Judging by the current benchmarks, the `HashMapOkasaki` implementation supports the fastest modification times and also shows lookup-times comparable to the fastest implementations. The only other alternative showing similar results is the `ImTools` implementation at the moment.

Note that the `HashMapOkasaki` doesn't use `System.Runtime.Intrinsics.X86` at the moment (since I wasn't able to run the `HAMT` benchmarks on netcore3) so the lookup performance might improve a little when using these.

* [Add](https://github.com/krauthaufen/ImmutableHashCollections/wiki/Add)
* [Update](https://github.com/krauthaufen/ImmutableHashCollections/wiki/Update)
* [Remove](https://github.com/krauthaufen/ImmutableHashCollections/wiki/Remove)
* [Lookup (existing)](https://github.com/krauthaufen/ImmutableHashCollections/wiki/Lookup---existing)
* [Lookup (nonexisting)](https://github.com/krauthaufen/ImmutableHashCollections/wiki/Lookup-nonexisting)
* [OfArray](https://github.com/krauthaufen/ImmutableHashCollections/wiki/OfArray)
* [ToArray](https://github.com/krauthaufen/ImmutableHashCollections/wiki/ToArray)

license: Unlicense

repository: krauthaufen/ImmutableHashCollections

repo_name: krauthaufen/ImmutableHashCollections


text:
A proof-of-concept Fuse wrapper for SharedPreferences / NSDefaults.

Basic Android and iOS implementation done, only supports storing strings for now.

See the included example for details.

Basic usage:

	var Prefs = require("FusePrefs");
	Prefs.write("key", "value");
	var key = Prefs.read("key");

As an alternative, consider using [fuse-usersettings](https://github.com/bolav/fuse-usersettings) library by Bolav

repository: eksperts/fuse-prefs

repo_name: eksperts/fuse-prefs


text:
# Gatsby Starter
Gatsby starter app powered by [Cosmic JS](https://cosmicjs.com) 🚀 Uses the [Official Cosmic JS Source Plugin for Gatsby](https://www.npmjs.com/package/gatsby-source-cosmicjs).

## Installation
Option 1: Download code. Connects to demo Bucket.
```bash
git clone https://github.com/cosmicjs/gatsby-starter
cd gatsby-starter
npm install
npm run develop
```

Option 2: Download via the [Cosmic CLI](https://github.com/cosmicjs/cosmic-cli). Installs demo content and connects to your Cosmic JS Bucket.
```bash
npm i -g cosmic-cli

# Login to your Cosmic JS account
cosmic login

# Installs example content to a new or existing Bucket and downloads the app locally
cosmic init gatsby-starter
cd gatsby-starter
cosmic start
```
## [Gatsby CMS](https://cosmicjs.com/knowledge-base/gatsby-cms)
Cosmic JS offers a [Headless CMS](https://cosmicjs.com/headless-cms) for your Gatsby websites and apps.

repository: cosmicjs/gatsby-starter

repo_name: cosmicjs/gatsby-starter


text:
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://docs.google.com/forms/d/e/1FAIpQLSfBEe5B_zo69OBk19l3hzvBmz3cOV6ol1ufjh0ER1q3-xd2Rg/viewform)

# MAC-Address-Lookup
Tired of paying a subscription service to access an API to resolve MAC address OUI/vendor data? Just resolving locally and maintaining your own database with this project is faster, cheaper (FREE!), and more secure.

**This repo requires either the master.txt or simplified.txt lookup table to be present in the same directory to function.
Visit the following URL for more information and to download the latest lookup tables:
https://scripttiger.github.io/macs/**

To get started, download the below ZIP file and extract the contents to the same directory as either the master.txt or simplified.txt:
https://github.com/ScriptTiger/MAC-Address-Lookup/archive/master.zip

Can be used interactively or simply by using the commmand "oui_search XX-XX-XX-XX-XX-XX" for quicker scripted searches. Accepts all standard mac address formats: XX-XX-XX-XX-XX-XX, XXXX-XXXX-XXXX, XX:XX:XX:XX:XX:XX, XXXX:XXXX:XXXX, XXXXXXXXXXXX, etc.

For more ScriptTiger scripts and goodies, check out ScriptTiger's GitHub Pages website:
https://scripttiger.github.io/

[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MZ4FH4G5XHGZ4)

repository: ScriptTiger/MAC-Address-Lookup

repo_name: ScriptTiger/MAC-Address-Lookup


text:
Identifies places where string identifier argument can be replaced
by symbol identifier argument.
It prevents the redundancy of the internal string-to-symbol conversion.

This cop targets methods that take identifier (e.g. method name) argument
and the following examples are parts of it.

# Examples

```ruby

# bad
send('do_something')
attr_accessor 'do_something'
instance_variable_get('@ivar')

# good
send(:do_something)
attr_accessor :do_something
instance_variable_get(:@ivar)
```

[Source](http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Performance/StringIdentifierArgument)

repository: codacy/codacy-rubocop

gha_language: Ruby

repo_name: codacy/codacy-rubocop


text:
# github-security-jira

GitHub Action for mapping Dependabot security alerts to Jira tickets.

## Setup

You need the following pieces set up to sync alerts with Jira:

1. Two repo secrets containing a GitHub access token and a Jira API token, respectively.
2. A workflow file which runs the action on a schedule, continually creating new tickets when necessary.

### Repo secrets

The `reload/github-security-jira` action requires you to [create two encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets) in the repo:

1. A secret called `GitHubSecurityToken` which should contain a [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) for the GitHub user under which this action should be executed. The token must include the `public_repo` scope if checking only public repos, or the `repo` scope for use on private repos. Also, the user must have [access to security alerts in the repo](https://help.github.com/en/github/managing-security-vulnerabilities/managing-alerts-for-vulnerable-dependencies-in-your-organization).
2. A secret called `JiraApiToken` containing an [API Token](https://confluence.atlassian.com/cloud/api-tokens-938839638.html) for the Jira user that should be used to create tickets.

### Workflow file setup

The [GitHub workflow file](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow#creating-a-workflow-file) should reside in any repo where you want to sync security alerts with Jira.

It has some required and some optional settings, which are passed to the action as environment variables:

- `GH_SECURITY_TOKEN`: A reference to the repo secret `GitHubSecurityToken` (**REQUIRED**)
- `JIRA_TOKEN`: A reference to the repo secret `JiraApiToken` (**REQUIRED**)
- `JIRA_HOST`: The endpoint for your Jira instance, e.g. <https://foo.atlassian.net> (**REQUIRED**)
- `JIRA_USER`: The ID of the Jira user which is associated with the 'JiraApiToken' secret, eg<EMAIL_ADDRESS>(**REQUIRED**)
- `JIRA_PROJECT`: The project key for the Jira project where issues should be created, eg `TEST` or `ABC`. (**REQUIRED**)
- `JIRA_ISSUE_TYPE`: Type of issue to create, e.g. `Security`. Defaults to `Bug`. (*Optional*)
- `JIRA_WATCHERS`: Jira users to add as watchers to tickets. Separate multiple watchers with comma (no spaces).
- `JIRA_ISSUE_LABELS`: Jira labels to add to tickets. Separate multiple labels with comma (no spaces).
- `JIRA_RESTRICTED_COMMENT_ROLE`: A comment with restricted visibility
  to this role is posted with info about who was added as watchers to
  the issue. Defaults to `Developers`. (*Optional*)

Here is an example setup which runs this action every 6 hours.

```yaml
name: GitHub Security Alerts for Jira

on:
  schedule:
    - cron: '0 */6 * * *'

jobs:
  syncSecurityAlerts:
    runs-on: ubuntu-latest
    steps:
      - name: "Sync security alerts to Jira issues"
        uses<EMAIL_ADDRESS>        env:
          GH_SECURITY_TOKEN: ${{ secrets.GitHubSecurityToken }}
          JIRA_TOKEN: ${{ secrets.JiraApiToken }}
          JIRA_HOST: https://foo.atlassian.net
          JIRA_USER<EMAIL_ADDRESS>          JIRA_PROJECT: ABC
          JIRA_ISSUE_TYPE: Security
          JIRA_WATCHERS: someuser<EMAIL_ADDRESS>```

## Local development

Copy `docker-composer.override.example.yml` to `docker-composer.override.yml` and edit according to your settings.

After that, you can execute the Symfony console app like so:

```
docker-compose run --rm ghsec-jira --verbose --dry-run
```

Remove the `--dry-run` option to actually create issues in Jira.

repository: reload/github-security-jira

gha_language: PHP

repo_name: reload/github-security-jira