text:
## 🚀 Overview

Neutron is a CLI developed to help developers create new react projects with [Redux](https://redux.js.org/) + [Redux Saga](https://redux-saga.js.org/) and offers well-structured code standardization.

#### Templates and Scaffolding

- [x] React JS
- [x] React Native

## 👨🏽💻 Quick Start

To install Neutron JS, execute into your terminal:

```shell
# yarn
$ yarn global add @neutronjs/cli

# npm
$ npm i @neutronjs/cli -g
```

Command list:

```shell
Starts With:
  neutron create           Create new project with React

Commands:
  neutron add:component    Add new component files
  neutron add:duck         Add new duck file
  neutron add:page         Add new page files
  neutron add:saga         Add new saga and duck files

Utils:
  neutron -h               Show help information
  neutron -v               Output the version number
```

## 🚘 What's under the hood?

- ⭐ [exec-sh](https://github.com/tsertkov/exec-sh) - wrapper for `child_process.spawn` with some improvements;
- ⭐ [gluegun](https://github.com/infinitered/gluegun) - toolkit for building node-based command-line interfaces;
- ⭐ [hyperquest](https://github.com/substack/hyperquest) - treat http requests as a streaming transport;
- ⭐ [tar-pack](https://github.com/ForbesLindesay/tar-pack) - package and un-package modules of some sort (in tar/gz bundles);

## 📃 Contributing

Thanks for your interest on our project. Take a moment to read our guidelines:

- [Contributing](https://www.neutronjs.com/docs/community/contributing)
- [Code of Conduct](https://www.neutronjs.com/docs/community/code-of-conduct)

## 📮 Contact

We have a few channels for contact:

- Email: [team<EMAIL_ADDRESS>- [GitHub Issues](https://github.com/neutronjs/neutron/issues)

<hr/>

## 📃 License

MIT © [Neutron JS](http://www.neutronjs.com/)

repository: neutronjs/neutron

repo_name: neutronjs/neutron


text:
# Offline Queries

Offline queries in Confluo are evaluated during runtime, i.e., they are executed
_on-the-fly_ on already written data in response to user requests. The execution
of these queries rely on the raw data and attribute indexes. The guide on
[Data Storage](loading_data.md) describes how attribute indexes can be
added to Atomic MultiLogs. In this guide, we will focus on how we can query
this data.

## Embedded Mode

We start with Confluo's embedded mode of operation. We work with the assumption that
the Atomic MultiLog has already been created, and filters, aggregates and triggers
have been added to it as outlined in [Data Storage](loading_data.md).

To start with, we have a reference to the Atomic MultiLog as follows:

```cpp
confluo::atomic_multilog* mlog = store.get_atomic_multilog("perf_log");
```

### Retrieving Records

It is straightforward to retrieve records given their offsets:

```cpp
auto record1 = mlog->read(off1);
auto record2 = mlog->read(off2);
auto record3 = mlog->read(off3);
```

Each of `record1`, `record2`, and `record3` are vectors of strings.

### Evaluating Ad-hoc Filter Expressions

We can query indexed attributes as follows:

```cpp
auto record_stream = mlog->execute_filter("cpu_util>0.5 || mem_avail<0.5");
for (auto s = record_stream; !s.empty(); s = s.tail()) {
  std::cout << s.head().to_string();
}
```

The query takes as its argument a filter expression; see the guide on [Data Storage](loading_data.md)
for details on the elements of the filter expression. The operation returns a lazily evaluated stream,
which supports functional style operations like map, filter, etc. See
[Stream API](https://github.com/ucbrise/confluo/blob/single-machine/libconfluo/confluo/container/lazy/stream.h)
for more details.

## Stand-alone Mode

The API for Stand-alone mode of operation is quite similar to the embedded mode.
We only focus on the C++ Client API, since Python and Java Client APIs are
almost identical to the C++ Client API.

As with the embedded mode, we work with the assumption that the client is connected to the server,
has already created the Atomic MultiLog, and added all relevant filters, aggregates and triggers.
Also, the current Atomic MultiLog for the client has been set to `perf_log` as follows:

```cpp tab="C++"
client.set_current_atomic_multilog("perf_log");
```

```python tab="Python"
client.set_current_atomic_multilog("perf_log")
```

### Retrieving Records

It is straightforward to retrieve records given their offsets:

```cpp tab="C++"
auto record1 = client.read(off1);
auto record2 = client.read(off2);
auto record3 = client.read(off3);
```

```python tab="Python"
record1 = client.read(off1)
record2 = client.read(off2)
record3 = client.read(off3)
```

### Evaluating Ad-hoc Filter Expressions

We can query indexed attributes as follows:

```cpp tab="C++"
auto record_stream = client.execute_filter("cpu_util>0.5 || mem_avail<0.5");
for (auto s = record_stream; !s.empty(); ++s) {
  std::cout << s.get().to_string();
}
```

```python
record_stream = client.execute_filter("cpu_util>0.5 || mem_avail<0.5")
for r in record_stream:
  print r
```

This operation returns a lazy stream of records, which automatically fetches
more data from the server as the clients consumes them.

repository: ucbrise/confluo

branch_name: refs/heads/single-machine

extension: md

license_type: permissive

repo_name: ucbrise/confluo


text:
# ProPublica Recidivism/COMPAS

## Source:
<https://github.com/propublica/compas-analysis>

This dataset is used to assess the likelihood that a criminal defendant will re-offend. The dataset used consisted of

## Download instructions

Download the following file and place it as-is in the current folder

1. [compas-scores-two-years.csv](https://github.com/propublica/compas-analysis/blob/master/compas-scores-two-years.csv)

## Relevant Papers

* J. Angwin, J. Larson, S. Mattu, L. Kirchner, [“Machine bias: There’s software used across the country to predict future criminals. And it’s biased against blacks,”](https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing) ProPublica, 23 May 2016

branch_name: refs/heads/master

gha_language: Python


text:
This Add-In is used for marking up Excel files with revisions. There are two common methods of indicating where a revision has changed a drawing that contains a system diagram. The first is the cloud method, were each change is enclosed by a cloud shape.  The second method involves placing a triangle with the revision number next to each effected portion of the drawing.  The cloud method indicates changes from the most recent revision only, whereas the second method indicates all revisions to the drawing because all of the previous revision circles remain on the drawing. It is written in 3 different versions as a VSTO Add-In in C# and VB.NET as well as a VBA Add-In.

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE "MIT License Copyright © Anthony Duguid")
[![Latest Release](https://img.shields.io/github/release/Excel-projects/Excel-Markup.svg?label=latest%20release)](https://github.com/Excel-projects/Excel-Markup/releases)
[![Github commits (since latest release)](https://img.shields.io/github/commits-since/Excel-projects/Excel-Markup/latest.svg)](https://github.com/Excel-projects/Excel-Markup/commits/master)
[![GitHub issues](https://img.shields.io/github/issues/Excel-projects/Excel-Markup.svg)](https://github.com/Excel-projects/Excel-Markup/issues)

## Table of Contents
- Install
- Dependencies
- Glossary of Terms
- Functionality
    - Select Markup Color
    - Insert Revision
    - Insert Markup
    - Insert Cloud Part
    - Edit Markup
    - Help
    - About

## Install
Instructions for installation of VBA and VSTO versions.

### VBA
How to install the VBA version
1. Download the VBA Add-In file [![download VBA](https://img.shields.io/badge/download-VBA-brightgreen.svg)](https://github.com/Excel-projects/Excel-Markup/raw/master/VBA/Markup.xlam?raw=true "Download the VBA Add-In").
2. Copy the file to the XLSTART folder on your computer. ```%AppData%\Microsoft\Excel\XLSTART\```
3. Close all open instances of Excel and then launch Excel. The new ribbon should appear.

### VSTO
How to install the VSTO version
1. Download AnthonyDuguid.pfx And Install At Root Level [![download Key](https://img.shields.io/badge/download-Key-brightgreen.svg)](https://github.com/Excel-projects/Excel-Markup/blob/master/CS/AnthonyDuguid.pfx?raw=true "Download AnthonyDuguid.pfx And Install At Root Level For VSTO")
2. Download and run the setup.exe file. [![download VSTO](https://img.shields.io/badge/download-VSTO-brightgreen.svg)](https://github.com/Excel-projects/Excel-Markup/blob/master/CS/publish/setup.exe?raw=true "Download Setup.exe Install File")

## Dependencies
|Software                                   |Dependency                 |Project                    |
|:------------------------------------------|:--------------------------|:--------------------------|
|[Microsoft Visual Studio Community](https://www.visualstudio.com/vs/whatsnew/)|Solution|VSTO|
|[Microsoft Office Developer Tools](https://visualstudio.microsoft.com/vs/features/office-tools/)|Solution|VSTO|
|[Microsoft Excel 2010 (or later)](https://www.microsoft.com/en-au/software-download/office)|Project|VBA, VSTO|
|[Visual Basic for Applications](https://msdn.microsoft.com/en-us/vba/vba-language-reference)|Code|VBA|
|[Extensible Markup Language (XML)](https://www.rondebruin.nl/win/s2/win001.htm)|Ribbon|VBA, VSTO|
|[Log4Net](https://www.nuget.org/packages/log4net/) |Error Logging |VSTO|
|[Google Icons](https://github.com/google/material-design-icons) |Ribbon Icons |VBA, VSTO|
|[ScreenToGif](http://www.screentogif.com/)|Read Me|VBA, VSTO|
|[Snagit](http://discover.techsmith.com/snagit-non-brand-desktop/?gclid=CNzQiOTO09UCFVoFKgod9EIB3g)|Read Me|VBA, VSTO|
|Badges ([Library](https://shields.io/), [Custom](https://rozaxe.github.io/factory/), [Star/Fork](http://githubbadges.com))|Read Me|VBA, VSTO|

## Glossary of Terms

| Term                      | Meaning                                                                                |
|:--------------------------|:-----------------------------------------------------------------------------------------|
| COM |Component Object Model (COM) is a binary-interface standard for software components introduced by Microsoft in 1993. It is used to enable inter-process communication and dynamic object creation in a large range of programming languages. COM is the basis for several other Microsoft technologies and frameworks, including OLE, OLE Automation, ActiveX, COM+, DCOM, the Windows shell, DirectX, UMDF and Windows Runtime.  |
| Cloud |Refers to the joined arcs that make up a shape|
| Hatch |The use of fine, parallel lines drawn closely together, often rapidly drawn, to create the illusion of shade or texture|
| VBA |Visual Basic for Applications (VBA) is an implementation of Microsoft's event-driven programming language Visual Basic 6 and uses the Visual Basic Runtime Library. However, VBA code normally can only run within a host application, rather than as a standalone program. VBA can, however, control one application from another using OLE Automation. VBA can use, but not create, ActiveX/COM DLLs, and later versions add support for class modules.|
| VSTO |Visual Studio Tools for Office (VSTO) is a set of development tools available in the form of a Visual Studio add-in (project templates) and a runtime that allows Microsoft Office 2003 and later versions of Office applications to host the .NET Framework Common Language Runtime (CLR) to expose their functionality via .NET.|
| XML|Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.The design goals of XML emphasize simplicity, generality, and usability across the Internet. It is a textual data format with strong support via Unicode for different human languages. Although the design of XML focuses on documents, the language is widely used for the representation of arbitrary data structures such as those used in web services.|

## Functionality
This Excel ribbon is inserted after the “Home” tab when Excel opens. Listed below is the detailed functionality of this application and its components.

###	Select Markup Color (Group)

#### Color Palette (Button)
* Select a color for the Markup shapes

#### Standard Colors (Dropdown)
* Select a standard color for the Markup shapes from the list

#### Update (Button)
* Update the color for the selected shapes

###	Insert Revision (Group)

#### Character (Textbox)
* This character will appear in the middle of the triangle

#### Triangle (Button)
* Insert a revision triangle in the area of the selected cell(s)

###	Insert Markup (Group)

#### Cloud (Button)
* Insert a cloud in the area of the selected cell(s)

#### Cloud Inverted (Button)
* Insert an inverted cloud in the area of the selected cell(s)

#### Cloud & Hatch (Button)
* Insert a cloud with hatching in the area of the selected cell(s)

#### Hatch (Button)
* Insert hatching in the area of the selected cell(s)

###	Insert Cloud Part (Group)

#### Left (Button)
* Insert a cloud part on the Left of the selected cell(s)

#### Right (Button)
* Insert a cloud part on the Right of the selected cell(s)

#### Top (Button)
* Insert a cloud part on the Top of the selected cell(s)

#### Bottom (Button)
* Insert a cloud part on the Bottom of the selected cell(s)

###	Edit Markup (Group)

#### Group (Menu)
* Join objects together to move and format them as if they were a single object

#### Remove Last (Button)
* Remove the last shape created

#### Remove All (Button)
* Remove all Markup shapes from the active worksheet

###	Help (Group)

#### How To… (Button)
* Opens a webpage of the read me documentation

#### Report Issue (Button)
* Opens a page to create a new issue for the product

#### Add-In Settings (Button)

VSTO

- Types of VSTO Settings
  - Application Settings
    - These settings can only be changed in the project and need to be redeployed
    - They will appear disabled in the form
  - User Settings
    - These settings can be changed by the end-user
    - They will appear enabled in the form

VBA

- VBA Settings
  - To add a new setting
    ```vbnet
    ThisWorkbook.CustomDocumentProperties.Add _
    Name:="App_ReleaseDate" _
    , LinkToContent:=False _
    , Type:=msoPropertyTypeDate _
    , Value:="31-Jul-2017 1:05pm"
    ```
  - To update a setting
    ```vbnet
    ThisWorkbook.CustomDocumentProperties.Item("App_ReleaseDate").Value = "31-Jul-2017 1:05pm"
    ```
  - To delete a setting
    ```vbnet
    ThisWorkbook.CustomDocumentProperties.Item("App_ReleaseDate").Delete
    ```

###	About (Group)

#### Add-in Name (Label)
* The application name with the version

#### Release Date (Label)
* The release date of the application

#### Copyright (Label)
* The author’s name

license: MIT

repository: ajrielrahayu/Excel-Markup

repo_name: ajrielrahayu/Excel-Markup


text:
# MudBlazor Templates

These are some project templates for Blazor Server & WebAssembly wired up with MudBlazor.

[MudBlazor](https://github.com/Garderoben/MudBlazor) is an ambitious Material Design component framework for Blazor

repository: fiyazbinhasan/MudBlazorTemplates

branch_name: refs/heads/main

repo_name: fiyazbinhasan/MudBlazorTemplates


text:
---
name: Xamarin.Android - Direct Replay Sample
description: "Demonstrates DirectReply feature for Android 7.0 (Android Nougat)"
page_type: sample
languages:
- csharp
products:
- xamarin
extensions:
    tags:
    - androidnougat
urlFragment: android-n-directreply
---
# DirectReply in Xamarin.Android

Demonstrates DirectReply feature for Android 7.0

![Direct Reply Sample application screenshot](Screenshots/reply_message.png)

repository: xamarin/monodroid-samples

gha_language: C#

repo_name: xamarin/monodroid-samples


text:
JSQL
======

## License
[MIT licensed](https://github.com/icuter/jsql/blob/master/LICENSE.md).

## Abstract

Welcome to JSQL. It's a lightweight JDBC DSL framework, JSQL means `Just SQL` and without ORM configuration.
It is a framework which is convenience and easy to use, just like sql syntax that you feel free to write SQL as usual and
makes Java SQL development more easier.

If you are a Java developer searching for the jdbc framework satisfy functions as connection pool, super lightweight orm
and want to write sql like java code programing, then I suggest you could try to use JSQL framework for jdbc operation.

JSQL for Reasons:
- No SQL string and keep your code graceful
- No ORM bean code generation mass your git control
- Provide ExecutorPool/ConnectionPool for jdbc connection pooling without DBCP dependencies

## Requirements

- JDK6 or higher

## Features
1. Connection/JdbcExecutor pool
2. SQL syntax like builder
3. Transaction
4. Support customizing dialects
5. Pagination
6. Jdbc executor for query, update or batch update
7. Super lightweight ORM
8. Against SQL inject
9. Logging ability

## Support Databases
1. Cubrid
2. SQLite
3. DB2
4. Derby (EmbeddedDerby/NetworkDerby)
5. H2
6. MariaDB
7. MySQL
8. Oracle
9. PostgreSQL
10. SQLServer2012(version >= 2012)

## Quick Start

### Maven dependency
```xml
<!-- for jdk1.8+ -->
<dependency>
  <groupId>cn.icuter</groupId>
  <artifactId>jsql</artifactId>
  <version>1.1.2</version>
</dependency>

<!-- for jdk1.6+ -->
<dependency>
  <groupId>cn.icuter</groupId>
  <artifactId>jsql-jdk1.6</artifactId>
  <version>1.1.2</version>
</dependency>
````

### Examples

### Auto Commit

```java
JSQLDataSource dataSource = JSQLDataSource.newDataSourceBuilder()
                            .url("jdbcUrl").user("jsql").password("pass").build();
List<Map<String, Object>> list = dataSource.select()
                                           .from("table")
                                           .where().eq("name", "jsql")
                                           .execQuery();
```

```text
SQL: select * from table where name = ?
Value: [jsql]
```

### Transaction

```java
JSQLDataSource dataSource = JSQLDataSource.newDataSourceBuilder()
                            .url("jdbcUrl").user("jsql").password("pass").build();
dataSource.transaction(tx -> {
    tx.insert("table")
      .values(Cond.eq("col1", "val1"), Cond.eq("col2", 102),Cond.eq("col3", "val3"))
      .execUpdate();
    // if exception thrown will call tx.rollback()
    // tx.commit(); // auto commit if transaction ended
});
```

```text
SQL: insert into table(col1,col2,col3) values(?,?,?)

VALUE: ["val1", 102, "val3"]
```

**NOTE**
> Above examples are using JSQLDataSource inner Connection pool to execute SQL generated by JSQL.

## Documents
Find more documentation [here](https://github.com/icuter/jsql-docs).

1. [DataSource](https://github.com/icuter/jsql-docs/blob/master/datasource.md)
2. [JDBC Connection Pool](https://github.com/icuter/jsql-docs/blob/master/pool.md)
3. [Transaction](https://github.com/icuter/jsql-docs/blob/master/transaction.md)
4. [SQL Builder](https://github.com/icuter/jsql-docs/blob/master/builder.md)
5. [Condition](https://github.com/icuter/jsql-docs/blob/master/condition.md)
6. [DB Dialect](https://github.com/icuter/jsql-docs/blob/master/dialect.md)
7. [ORM](https://github.com/icuter/jsql-docs/blob/master/orm.md)
8. [SQL Executor](https://github.com/icuter/jsql-docs/blob/master/executor.md)
9. [Logging Customization](https://github.com/icuter/jsql-docs/blob/master/logging.md)

## Release Notes
### 1.1.2
performance
- remove Injection's read lock and add snapshot root node for improvement

features
- use builder patterns to create `JSQLDatasource` more easier

others
- update checkstyle version
- simplify Test Unit Exception checking with Lamda

### 1.1.1
bug fixes
- fix ReentrantLock.lock() prior to try-finally block
- fix bugs which have been detected by FindBugs tools

performance
- optimize scheduled task checking and invalidation

### 1.1.0
bug fixes
- fix fields injection

performance
- optimize injection checking
- avoid inflating schedule tasks

### 1.0.9
bug fixes
- fix idle object schedule thread can't shutdown immediately

### 1.0.8
features
- support validating field name and table name injection

### 1.0.7
bug fixes
- fix NPE while checking idle object

### 1.0.6
bug fixes
- fix top-select in `SelectBuilder.select`

features
- support transaction in JSQLDataSource
- support `insert... select...` syntax
- support Driver properties when getting Connection from Driver

### 1.0.4
bug fixes
- fix pool configuration

features
- execute builder directly in JSQLDataSource
- refactor Connection object idle timeout validation

> jsql-jdk1.6 missing this version

### 1.0.3
breaks
- Remove `Builder.union` and `Builder.unionAll` operation

bug fixes
- fix `OracleDialect` invalid table alias name format
- fix `DB2Dialect` invalid table alias name format

features
- Add builder as Condition value
- Add `UnionSelectBuilder` for union/unionAll operation

> jsql-jdk1.6 missing this version

repository: icuter/jsql

gha_language: Java

gha_license_id: MIT

repo_name: icuter/jsql


text:
# Note Taker

# [Live site deployed on heroku](https://noterator.herokuapp.com/)

## Description

---

This is a website where you can save and delete your daily notes, so you can organize your toughts and keep track of tasks to be completed.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [Tests](#tests)
- [License](#license)

## Installation

_To install this application, make sure you clone the repo to your device. Install node and express. Run npm init. Run npm install. Run npm install express. Run npm install uniqid._

## npm install

## Usage

_open website [https://noterator.herokuapp.com](https://noterator.herokuapp.com) and click on Get Started. When main page opens you will be presented with your saved notes and you can add and delete notes_

## Tests

_Tests for application and how to run them:_

## No tests available

## License

## [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Questions?

For any questions, please contact me with the information below:

## Contact me:  [<img src="https://image.flaticon.com/icons/png/512/726/726623.png" width="40"<EMAIL_ADDRESS> [](https://github.com/zoneam)

![Screen Capture](./public/assets/capture/screen_capture.png)

repository: Zoneam/Note-Taker

repo_name: Zoneam/Note-Taker


text:
# resize-base64-promise

Functions that resize a Base64 image. Pass a Base64 string of an image, the maximum width, and the maximum height.

| Function | Description |
| ------ | ----------- |
| resizeBase64ForMaxWidth | resizes an image to the maximum width, the aspect ratio of the image is maintained |
| resizeBase64ForMaxHeight | resizes an image to the maximum height, the aspect ratio of the image is maintained |
| resizeBase64ForMaxWidthAndMaxHeight | resizes an image to the maximum width and maximum height, the aspect ratio of the image is not maintained |

Every function takes the parameters listed below.

| Parameter | Description |
| ------ | ----------- |
| base64String | the image to resize as a Base64 string |
| maxWidth | the maximum width that the image should be resized to |
| maxHeight | the maximum height that the image should be resized to |

## Restrictions

* The function can only be used in frontend code.
* Since enlarging images is not desirable due to the loss of quality, the functions resizeBase64ForMaxWidth and resizeBase64ForMaxHeight do not support it. Use the function resizeBase64ForMaxWidthAndMaxHeight for free resizing (shrinking and enlarging).
* Since Internet Explorer does not support promises, this library is not the right choice. Consider using https://github.com/hendrik-scholz/resize-base64 instead. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise.

## Installation

```
npm i --save https://github.com/hendrik-scholz/resize-base64-promise/#master
```

## Test

1. Run 'npm test' from the directory where the package.json is located.
2. Open http://localhost:3000/ in your browser.
3. Click on a link in the list of test cases and check the results of that test case.

## Example

```
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script type="module">
	import { resizeBase64ForMaxHeight } from '../index.js';

	let base64Image_320x240 = 'data:image/jpeg;base64,/9j/4AAQSk...';
	let maxWidth = 2;
	let maxHeight = 120;

	resizeBase64ForMaxHeight(base64Image_320x240, maxWidth, maxHeight)
		.then((resizedImage) => {
			document.getElementById('originalImage').src = base64Image_320x240;
			document.getElementById('resizedImage').src = resizedImage;
		})
		.catch(errorMessage => alert(errorMessage));
</script>
</head>
<body>
	<img id="originalImage">

	<img id="resizedImage">
</body>
</html>
```

See test/resizeBase64ImageFrom320x240ToMaxHeight120.html for details.

![Resize Example](screenshots/resize.png "Resize Example")

gha_language: HTML


text:
# Twitter Image saver v0.5.4

Userscript to make it easy to save images from twitter.
Way too many artists use twitter as a platform to post their art unfortunately. Have these people never heard of artstation or deviantArt?

## Usage
* You can configure the hotkeys via config.json.
* The default hotkeys are:
`q` and `Numpad .`: Download an image
`e`: Open image in new tab.

Both hotkeys work in magnified view. You can tell you're on the right page if the URL has `photo` in it.
Only the download hotkey works in image pages (i.e. when open in a new tab)

When saving files the following naming convention is used:

Tweet URLs

```
https://twitter.com/nomaismar/status/1054235177914839041/photo/2
                    ^Handle          ^TweetId                  ^Number in sequence
```

Naming convention
`<TwitterHandle>-tw-<ISODate>-<TweetId>-<Number>[-<Name>].<ext>`

TwitterHandle = The thing after the @
ISODate = yyyymmdd
TweetId = The internal/url ID of the tweet (see above), monotonically increasing
Number = Number in sequence, I think up to 4 max?
Name = [Optional] A free-text name, with "_" as spaces

**Note:** Sometimes the script can't get the date - this can happen when you load a magnified view directly. To fix, just click on the image from the feed or from the individual tweet.
(The script relies on the underlying page to get the date. If you load the magnified view directly that data may not have loaded yet, or may not load at all. The script will try, and succeed often, but not always.)

## Installation

1. Clone repo, run "yarn/npm install"
2. Do your config (see config.json.dist).
3. Run "yarn/npm run build".
4. The next steps depend on the type of installation: Local or remote.

#### Local
**IMPORTANT!** Keep in mind that a local installation is only possible for chrome, because only chrome currently has a setting that allows extensions access to local file URLs. To enable access, go to the menu -> More tools -> Extensions and find your userscript manager (e.g. Tampermonkey. Are there any others even?), click on Details and toggle the setting "Allow access to file URLs".
With that out of the way:

5. Go to dist/ and open `local.user.js`. Copy its contents into a new userscript and save.
This is a one-time step, unless you change something about the build or somehow cause the file path of the script to change(e.g. renaming the project folder or whatever)
6. You are good to go. Script is now working.

#### Remote
5. Go to dist/. Copy the file `main.js` to some location available on the web.
6. Go to dist/ and open `local.user.js`. Change the last require line to the location you hosted the script on. Copy these contents into a new userscript and save.
7. You are good to go. Script is now working.

#### The old fashioned way
5. Go to dist/. Open both files there. Take everything from `main.js` and copy over to `local.user.js` (below everything there). Optional: You can delete or not the last require from the userscript metadata. Tampermonkey doesn't care.
6. Take your thusly smushed file and import into userscript manager via method of preference (i.e. copy-paste everything like it's 2006).
7. You are good to go. Script is now working.

#### The unnecessarily manual way
1. Make your own metadata. Good luck. (Take a look at `package.json`)
2. Copy the code from `dist/main.js` below that.
3. Put that in your script mannager.

## Development

Local development is the easiest option. However, there is one caveat - if you develop while webpack is watching the files, you will run into a problem where your script will refuse to run.
Technical explanation:
* Twitter has very strict CSP, disallowing `unsave-eval` which is what webpack uses when watching files.
* Tampermonkey can usually deal with this, modifying the page's CSP to allow your scripts to run.
* But twitter has a service worker.
* Service worker responses can't be modified by extensions (i.e. the `webRequest.onHeadersReceived` callback doesn't even fire).

Workaround:
When in dev/watch mode with webpack, open devtools, go to Application>Service Workers - check `Bypass for network`. Keep devtools open - the setting only works then.

repository: martixy/twitterMedia

gha_language: JavaScript

repo_name: martixy/twitterMedia


text:
# Container Affinity and Anti-Affinity

## Introduction

Some policies allow the user to give hints about how particular containers
should be *co-located* within a node. In particular these hints express whether
containers should be located *'close'* to each other or *'far away'* from each
other, in a hardware topology sense.

Since these hints are interpreted always by a particular *policy implementation*,
the exact definitions of 'close' and 'far' are also somewhat *policy-specific*.
However as a general rule of thumb containers running

  - on CPUs within the *same NUMA nodes* are considered *'close'* to each other,
  - on CPUs within *different NUMA nodes* in the *same socket* are *'farther'*, and
  - on CPUs within *different sockets* are *'far'* from each other

These hints are expressed by `container affinity annotations` on the Pod.
There are two types of affinities:

  - `affinity` (or `positive affinty`): cause affected containers to *pull* each other closer
  - `anti-affinity` (or `negative affinity`): cause affected containers to *push* each other further away

Policies try to place a container
  - close to those the container has affinity towards
  - far from those the container has anti-affinity towards.

## Affinity Annotation Syntax

*Affinities* are defined as the `cri-resource-manager.intel.com/affinity` annotation.
*Anti-affinities* are defined as the `cri-resource-manager.intel.com/anti-affinity`
annotation. They are specified in the `metadata` section of the `Pod YAML`, under
`annotations` as a dictionary, with each dictionary key being the name of the
*container* within the Pod to which the annotation belongs to.

```yaml
metadata:
  anotations:
    cri-resource-manager.intel.com/affinity: |
      container1:
        - scope:
            key: key-ref
            operator: op
            values:
            - value1
            ...
            - valueN
          match:
            key: key-ref
            operator: op
            values:
            - value1
            ...
            - valueN
          weight: w
```

An anti-affinity is defined similarly but using `cri-resource-manager.intel.com/anti-affinity`
as the annotation key.

```yaml
metadata:
  anotations:
    cri-resource-manager.intel.com/anti-affinity: |
      container1:
        - scope:
            key: key-ref
            operator: op
            values:
            - value1
            ...
            - valueN
          match:
            key: key-ref
            operator: op
            values:
            - value1
            ...
            - valueN
          weight: w
```

## Affinity Semantics

An affinity consists of three parts:

  - `scope expression`: defines which containers this affinity is evaluated against
  - `match expression`: defines for which containers (within the scope) the affinity applies to
  - `weight`: defines how *strong* a pull or a push the affinity causes

*Affinities* are also sometimes referred to as *positive affinities* while
*anti-affinities* are referred to as *negative affinities*. The reason for this is
that the only difference between these are that affinities have a *positive weight*
while anti-affinities have a *negative weight*.

The *scope* of an affinity defines the *bounding set of containers* the affinity can
apply to. The affinity *expression* is evaluated against the containers *in scope* and
it *selects the containers* the affinity really has an effect on. The *weight* specifies
whether the effect is a *pull* or a *push*. *Positive* weights cause a *pull* while
*negative* weights cause a *push*. Additionally, the *weight* specifies *how strong* the
push or the pull is. This is useful in situations where the policy needs to make some
compromises because an optimal placement is not possible. The weight then also acts as
a way to specify preferences of priorities between the various compromises: the heavier
the weight the stronger the pull or push and the larger the propbability that it will be
honored, if this is possible at all.

The scope can be omitted from an affinity in which case it implies *Pod scope*, in other
words the scope of all containers that belong to the same Pod as the container for which
which the affinity is defined.

The weight can also be omitted in which case it defaults to -1 for anti-affinities
and +1 for affinities. Weights are currently limited to the range [-1000,1000].

Both the affinity scope and the expression select containers, therefore they are identical.
Both of them are *expressions*. An expression consists of three parts:

  - key: specifies what *metadata* to pick from a container for evaluation
  - operation (op): specifies what *logical operation* the expression evaluates
  - values: a set of *strings* to evaluate the the value of the key against

The supported keys are:

  - for pods:
    - `name`
    - `namespace`
    - `qosclass`
    - `labels/<label-key>`
    - `id`
    - `uid`
  - for containers:
    - `pod/<pod-key>`
    - `name`
    - `namespace`
    - `qosclass`
    - `labels/<label-key>`
    - `tags/<tag-key>`
    - `id`

Essentially an expression defines a logical operation of the form (key op values).
Evaluating this logical expression will take the value of the key in  which
either evaluates to true or false.
a boolean true/false result. Currently the following operations are supported:

  - `Equals`: equality, true if the *value of key* equals the single item in *values*
  - `NotEqual`: inequality, true if the *value of key* is not equal to the single item in *values*
  - `In`: membership, true if *value of key* equals to any among *values*
  - `NotIn`: negated membership, true if the *value of key* is not equal to any among *values*
  - `Exists`: true if the given *key* exists with any value
  - `NotExists`: true if the given *key* does not exist
  - `AlwaysTrue`: always evaluates to true, can be used to denote node-global scope (all containers)
  - `Matches`: true if the *value of key* matches the globbing pattern in values
  - `MatchesNot`: true if the *value of key* does not match the globbing pattern in values
  - `MatchesAny`: true if the *value of key* matches any of the globbing patterns in values
  - `MatchesNone`: true if the *value of key* does not match any of the globbing patterns in values

The effective affinity between containers C_1 and C_2, A(C_1, C_2) is the sum of the
weights of all pairwise in-scope matching affinities W(C_1, C_2). To put it another way,
evaluating an affinity for a container C_1 is done by first using the scope (expression)
to determine which containers are in the scope of the affinity. Then, for each in-scope
container C_2 for which the match expression evaluates to true, taking the weight of the
affinity and adding it to the effective affinity A(C_1, C_2).

Note that currently (for the topology-aware policy) this evaluation is asymmetric:
A(C_1, C_2) and A(C_2, C_1) can and will be different unless the affinity annotations are
crafted to prevent this (by making them fully symmetric). Moreover, A(C_1, C_2) is calculated
and taken into consideration during resource allocation for C_1, while A(C_2, C_1)
is calculated and taken into account during resource allocation for C_2. This might be
changed in a future version.

Currently affinity expressions lack support for boolean operators (and, or, not).
Sometimes this limitation can be overcome by using joint keys, especially with
matching operators. The joint key syntax allows joining the value of several keys
with a separator into a single value. A joint key can be specified in a simple or
full format:

  - simple: `<colon-separated-subkeys>`, this is equivalent to `:::<colon-separated-subkeys>`
  - full:   `<ksep><vsep><ksep-separated-keylist>`

A joint key evaluates to the values of all the `<ksep>`-separated subkeys joined by `<vsep>`.
A non-existent subkey evaluates to the empty string. For instance the joint key

  `:pod/qosclass:pod/name:name`

evaluates to

  `<qosclass>:<pod name>:<container name>`

For existence operators, a joint key is considered to exist if any of its subkeys exists.

## Examples

Put the container `peter` close to the container `sheep` but far away from the
container `wolf`.

```yaml
metadata:
  annotations:
    cri-resource-manager.intel.com/affinity: |
      peter:
      - match:
          key: name
          operator: Equals
          values:
          - sheep
        weight: 5
    cri-resource-manager.intel.com/anti-affinity: |
      peter:
      - match:
          key: name
          operator: Equals
          values:
          - wolf
        weight: 5
```

## Shorthand Notation

There is an alternative shorthand syntax for what is considered to be the most common
case: defining affinities between containers within the same pod. With this notation
one needs to give just the names of the containers, like in the example below.

```yaml
  annotations:
    cri-resource-manager.intel.com/affinity: |
      container3: [ container1 ]
    cri-resource-manager.intel.com/anti-affinity: |
      container3: [ container2 ]
      container4: [ container2, container3 ]
```

This shorthand notation defines:
  - `container3` having
    - affinity (weight 1) to `container1`
    - `anti-affinity` (weight -1) to `container2`
  - `container4` having
    - `anti-affinity` (weight -1) to `container2`, and `container3`

The equivalent annotation in full syntax would be

```yaml
metadata:
  annotations:
    cri-resource-manager.intel.com/affinity: |+
      container3:
      - match:
          key: labels/io.kubernetes.container.name
          operator: In
          values:
          - container1
    cri-resource-manager.intel.com/anti-affinity: |+
      container3:
      - match:
          key: labels/io.kubernetes.container.name
          operator: In
          values:
          - container2
      container4:
      - match:
          key: labels/io.kubernetes.container.name
          operator: In
          values:
          - container2
          - container3
```

repository: intel/cri-resource-manager

gha_language: Go

repo_name: intel/cri-resource-manager


text:
# ahackyplace
A hacky scalable implementation of the [r/place](https://en.wikipedia.org/wiki/Place_%28Reddit%29) concept. Implemented in a weekend, guided by both this [keynote from redislabs](https://www.youtube.com/watch?v=3-Xqghoki70) and this [reddit blogpost](https://redditblog.com/2017/04/13/how-we-built-rplace/).

![screenshot](screenshot.png)

## Tech Used
- NodeJS (web app)
- WebSockets (streaming newly placed pixels to browser)
- Redis (Storing canvas state and pub/sub messaging between instances)

## Running it for Development
1. Download  and install Redis Server and Redis CLI on your local machine
2. Using Redis CLI, login to the Redis Server and run the following commands:
 - `SET canvas ""`
 - `SET canvas_width 24` (substitute any value)
 - `SET canvas_height 24` (substitute any value)
 - `SET canvas_bitdepth 4` (only bitdepth of 4 is supported by current front-end)
3. Clone this repository and change directory into it
4. Run `npm install` and `npm run start`

## Adapting for production
The majority of the above applies for production deployment, except your Redis Server will likely not be hosted on the same machine. Ensure that following environment variables are set:
- `NODE_ENV=production`
- `PORT=<your http port here>`
- `REDIS_HOST=<your redis host here>`
- `REDIS_PORT=<your redis port here>`

If you are using the included Docker configuration note that, `NODE_ENV` and `PORT` are already set in the Dockerfile.

## Attributions
**ahackyplace Code**
© 2019 Lucas Towers
Licensed under MIT

repository: luctowers/ahackyplace

repo_name: luctowers/ahackyplace


text:
# BONSAI-ontology-RDF-framework
Recommendations and discussions on ontology and RDF framework development

Discussions and tools regarding the development of a minimal ontology for BONSAI.

This repo has been created to create a common platform for all of the discussions (moving away from a chain of messages/ emails).

The repo currently contains:

1. The current RDF schema proposed
2. Summary of the discussions leading to ontology development

The actual ontology is updated in the sister repository: (ontology)[https://github.com/BONSAMURAIS/ontology]

Current work is in the `core` ontology.

## Structure

```bash
    .
    │   #  This directory
    ├── README.md
    │
    ├── examples
    │   └── # example in TTL or RDF/XML format of data following the schema
    ├── material
    │   └── # Powerpoints, diagrams, figures ...
    └── minutes
        └── # minutes from meetings and calls
```


text:
# CreateActiveRequestEntity

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ProcessGroupId** | Pointer to **string** | The Process Group ID that this active request will update | [optional]
**DisconnectedNodeAcknowledged** | Pointer to **bool** | Acknowledges that this node is disconnected to allow for mutable requests to proceed. | [optional]

## Methods

### NewCreateActiveRequestEntity

`func NewCreateActiveRequestEntity() *CreateActiveRequestEntity`

NewCreateActiveRequestEntity instantiates a new CreateActiveRequestEntity object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewCreateActiveRequestEntityWithDefaults

`func NewCreateActiveRequestEntityWithDefaults() *CreateActiveRequestEntity`

NewCreateActiveRequestEntityWithDefaults instantiates a new CreateActiveRequestEntity object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetProcessGroupId

`func (o *CreateActiveRequestEntity) GetProcessGroupId() string`

GetProcessGroupId returns the ProcessGroupId field if non-nil, zero value otherwise.

### GetProcessGroupIdOk

`func (o *CreateActiveRequestEntity) GetProcessGroupIdOk() (*string, bool)`

GetProcessGroupIdOk returns a tuple with the ProcessGroupId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetProcessGroupId

`func (o *CreateActiveRequestEntity) SetProcessGroupId(v string)`

SetProcessGroupId sets ProcessGroupId field to given value.

### HasProcessGroupId

`func (o *CreateActiveRequestEntity) HasProcessGroupId() bool`

HasProcessGroupId returns a boolean if a field has been set.

### GetDisconnectedNodeAcknowledged

`func (o *CreateActiveRequestEntity) GetDisconnectedNodeAcknowledged() bool`

GetDisconnectedNodeAcknowledged returns the DisconnectedNodeAcknowledged field if non-nil, zero value otherwise.

### GetDisconnectedNodeAcknowledgedOk

`func (o *CreateActiveRequestEntity) GetDisconnectedNodeAcknowledgedOk() (*bool, bool)`

GetDisconnectedNodeAcknowledgedOk returns a tuple with the DisconnectedNodeAcknowledged field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetDisconnectedNodeAcknowledged

`func (o *CreateActiveRequestEntity) SetDisconnectedNodeAcknowledged(v bool)`

SetDisconnectedNodeAcknowledged sets DisconnectedNodeAcknowledged field to given value.

### HasDisconnectedNodeAcknowledged

`func (o *CreateActiveRequestEntity) HasDisconnectedNodeAcknowledged() bool`

HasDisconnectedNodeAcknowledged returns a boolean if a field has been set.

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

repository: simingweng/nifi-go-client

gha_language: Shell

repo_name: simingweng/nifi-go-client


text:
# Twilio Resume

A simple Twilio Voice app created with TwiML that allows a user to call a number and listen and interact through my resume.

Currently, I am only using a trial account so you'll get a nag message when you call in.  Feel free to call at<PHONE_NUMBER> and try it out.

## Set up

Once you clone or unzip your files you'll need to set up your variables.php file.

1. Copy the variables-sample.php in the _include folder to variables.php
2. [Create an account on Twilio](https://www.twilio.com/try-twilio)
3. Update the variables.php with your own AccountID, Token and ApplicationID
4. Within your Twilio User Account set up your new number to point to the Request Url at http://yourdomain.com/answer.php

## Testing on localhost

To be able to call your number and be able to test locally you need to set up [ngrok](https://ngrok.com/) to tunnel into your machine and make your localhost site available externally.

  Since I am only using the demo account this page only works for my phone number.  The full upgrade will work with any number.

## License
The source code is licensed under MIT.  The MP3 files and the personal content is copyrighted to me.

repository: RedWolves/twilio-resume

repo_name: RedWolves/twilio-resume


text:
# Ember-bootstrap-table
[![Build Status](http://api.screwdriver.corp.yahoo.com:4080/badge/40272/component/icon)](http://api.screwdriver.corp.yahoo.com:4080/badge/40272/component/target)

An ember table component to help create dynamic bootstrap tables in ember.

## EOL
This repo has reached the end of its life. Should no longer be used.

## Usage:

#### Parameters:
* columns: [] *// *REQUIRED (array of column configs)*
* rows: [] *// (array of rows)*
* showHeader: (true || false) *// (Shows/hides the table header)*
* hoverable: (true || false) *// (Adds hover states to row background)*
* striped: (true || false) *// (Stripes the table)*
* condensed: (true || false) *// (Condenses table rows)*
* responsive: (true || false) *// (Makes table horizontally scrollable)*
* bordered: (true || false) *// (Adds borders to the table)*
* customSortAction: "[Action Name]" *// (The action that will fire when a user has clicked a sortable column header.  Set this parameter to override the default sorting behavior of the table.  The action will be fired with two parameters:  'columnIndex', and 'isAscending'  When specified, this will make the .sort property on your column configs inactive.)*
* sortIndex: "[Property to Sort On]" *// (only active if customSortAction is null)*
* sortAscending: (true || false) *// (only active if customSortAction is null)*
* infiniteScrollEnabled: (true || false) *// (whether or not infinite scroll should be enabled)*
* isLoadingRows: (true || false) *// (a flag to bind to for showing/hiding the table's loading indicator - only used when infiniteScrollEnabled is true)*
* loadMoreAction: "[Action Name]" *// (the action that should be fired when user scrolls to bottom of page - only used when infiniteScrollEnabled is true, and isLoadingRows is false)*
* noContentView: [Instance of Em.View] *// (this view will be rendered instead of the table if there are no rows.)*
* disableSortDirection: (true || false) *// (False by default.) When true, the sortAscending property will not change when the user clicks a column header (The sortAscending property will remain unchanged)*
* stickyHeaders: (true || false) *//(False by default). When true, the headers will be rendered into their own table, which will become sticky when the window scrolls to the position specified by "stickyHeaderActivatePosition".*
* stickyHeaderActivatePosition: int value *//(90 by defualt). stickyHeaders will become active when the user scrolls to this y position.  disabled when stickyHeaders is false.*

#### Column Configurations:
Here are the options for configuring columns:
* headerCellName: "[Cell Header Text]" *// (only used if headerCellCustomViewClass is null)*
* headerCellClassName: "classname1 classname2" *// (only used if headerCellCustomViewClass is null)*
* headerCellInfo: "this info will be shown in a tooltip." *// (only used if headerCellCustomViewClass is null)*
* headerCellCustomViewClass: (null || [Instance of Ember.View]) *// (Defines a custom view for header cell)*
* cellValuePath: (null || "Path to value") *// (Defines the property of row where value is -- Only used if customCellViewClass and getCellContent are both null)*
* cellClassName: "classname1 classname2" *// (only used if cellCustomViewClass is null)*
* cellCustomViewClass: (null || [Instance of Ember.View]) *// (Defines a custom view for the cell)*
* getCellContent: (null || function) *// (Defines a function to return value for cell - Only used if customCellViewClass is null)*
* columnWidth: (null || int) *// (Defines a fixed width for the column)*
* sort: function(column, rows, isAscending){  } *// (The function used to sort this column.  Only active when the customSortAction is null.)*
* sortOn: 'cellValuePath' || 'getCellContent' // (This will tell the default sorting function to sort on the cellValuePath or getCellContent function if both are specified in your column config.  Inactive when customSortAction is provided.)*

*(All column configs must have cellCustomViewClass, cellValuePath, or getCellContent defined)*

**Example Column Configs:**
```javascript
import CustomHeaderCell from 'app/views/custom-header-view';
import CustomCell from 'app/views/custom-cell-view';

export default Ember.Controller.extend({
  columns: function(){
    return [
      Ember.Object.create({
        headerCellName: 'Col 1',
        getCellContent: function(row){
          return row.get('someValue') + '%';
        },
        columnWidth: 50
      }),
      Ember.Object.create({
        headerCellCustomViewClass: CustomHeaderCell,
        cellValuePath: 'someOtherValue', // will return row.get('someOtherValue');
      }),
      Ember.Object.create({
        headerCellName: 'Col 3',
        cellCustomViewClass: CustomCell // will create an instance of CustomCell and pass 'row' property to it
      })
    ];
  }.property(),
  rows: function(){
    return this.get('model') || [];
  }.property('model.[]'),
  isLoadingData: false,
  actions: {
    loadMore: function(){
      var self = this;
      this.set('isLoadingData', true);
      this.store.find('somemodel').then(function(result){
        self.set('model', result);
        self.set('isLoadingData', false);
      });
    },
    sortTheTable: function(columnIndex, isAscending){

    }
  }
});
```

#### Example:
```javascript
{{table-component
  rows=rows
  columns=columns
  showHeader=true
  sortable=false
  hoverable=true
  condensed=false
  responsive=true
  bordered=false
  striped=true
  infiniteScrollEnabled=true
  isLoadingRows=isLoadingData
  loadMoreAction='loadMore'
  customSortAction='sortTheTable'
  sortAscending=false
  disableSortDirection=false
  stickyHeaders=true
  stickyHeaderActivatePosition=100
}}
```

## Installation (Development)

* `git clone` this repository
* `npm install`
* `bower install`

## Running  (Development)

* `ember server`
* Visit your app at http://localhost:4200.

## Running Tests  (Development)

* `ember test`
* `ember test --server`

## Building  (Development)

* `ember build`

## Dist
Before submitting a PR for this repo, please run the following grunt command to ensure that your changes will also
be available for those who are using the globals version of this project.
* `grunt dist`

For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).

repository: grese/ember-bootstrap-table

repo_name: grese/ember-bootstrap-table


text:
# CodeIgniter Simple and Secure Twig

[![Latest Stable Version](https://poser.pugx.org/kenjis/codeigniter-ss-twig/v/stable)](https://packagist.org/packages/kenjis/codeigniter-ss-twig) [![Total Downloads](https://poser.pugx.org/kenjis/codeigniter-ss-twig/downloads)](https://packagist.org/packages/kenjis/codeigniter-ss-twig) [![Latest Unstable Version](https://poser.pugx.org/kenjis/codeigniter-ss-twig/v/unstable)](https://packagist.org/packages/kenjis/codeigniter-ss-twig) [![License](https://poser.pugx.org/kenjis/codeigniter-ss-twig/license)](https://packagist.org/packages/kenjis/codeigniter-ss-twig)

This package provides simple Twig integration for [CodeIgniter](https://github.com/codeigniter4/CodeIgniter4) 4.x.

If you use CodeIgniter3, check [master](https://github.com/kenjis/codeigniter-ss-twig/tree/master) branch.

## Requirements

* PHP 7.4 or later
* CodeIgniter 4.2.11 or later
* Twig 3.4.3 or later

## Installation

### With Composer

~~~
$ cd /path/to/codeigniter/
$ composer require kenjis/codeigniter-ss-twig
~~~

## Usage

### Loading Twig Library

~~~php
$this->twig = new \Kenjis\CI4Twig\Twig();
~~~

You can override the default configuration:

~~~php
$config = [
    'paths' => ['/path/to/twig/templates', VIEWPATH],
    'cache' => '/path/to/twig/cache',
];
$this->twig = new \Kenjis\CI4Twig\Twig($config);
~~~

### Rendering Templates

Render Twig template and output to browser:

~~~php
$this->twig->display('welcome', $data);
~~~

The above code renders `Views/welcome.twig`.

Render Twig template:

~~~php
$output = $this->twig->render('welcome', $data);
~~~

The above code renders `Views/welcome.twig`.

### Adding a Global Variable

~~~php
$this->twig->addGlobal('sitename', 'My Awesome Site');
~~~

### Getting Twig\Environment Instance

~~~php
$twig = $this->twig->getTwig();
~~~

### Supported CodeIgniter Helpers

* `base_url()`
* `site_url()`
* `anchor()`
* `form_open()`
* `form_close()`
* `form_error()`
* `form_hidden()`
* `set_value()`
* `csrf_field()`
* `validation_list_errors()`

Some helpers are added the functionality of auto-escaping for security.

> **Warning**
> `validation_list_errors()` shows Validation Errors by `Services::validation()->listErrors()`,
> and if you use user input for Validation Error messages, attackers may do XSS.
> In such a case, validate user input and escape it by yourself.

### Adding Your Functions & Filters

You can add your functions and filters with configuration:

~~~php
$config = [
    'functions'      => ['my_helper'],
    'functions_safe' => ['my_safe_helper'],
    'filters'        => ['my_filter'],
];
$this->twig = new \Kenjis\CI4Twig\Twig($config);
~~~

If your function explicitly outputs HTML code, you want the raw output to be printed.
In such a case, use `functions_safe`, and **you have to make sure the output of
the function is XSS free**.

### References

#### Documentation

* https://twig.symfony.com/doc/3.x/

#### Samples

* https://github.com/kenjis/ci4-tettei-apps (Japanese)

@TODO

* https://github.com/kenjis/codeigniter-twig-samples

## How to Run Tests

~~~
$ cd codeigniter-ss-twig
$ composer install
$ vendor/bin/phpunit
~~~

## Related Projects for CodeIgniter 4.x

### Libraries

- [CodeIgniter 3 to 4 Upgrade Helper](https://github.com/kenjis/ci3-to-4-upgrade-helper)
- [CodeIgniter3-like Captcha](https://github.com/kenjis/ci3-like-captcha)
- [PHPUnit Helper](https://github.com/kenjis/phpunit-helper)
- [CodeIgniter4 Attribute Routes](https://github.com/kenjis/ci4-attribute-routes)
- [CodeIgniter Simple and Secure Twig](https://github.com/kenjis/codeigniter-ss-twig)
- [CodeIgniter4 Viewi Demo](https://github.com/kenjis/ci4-viewi-demo)

### Tutorials

- [CodeIgniter 4 News Tutorial](https://github.com/kenjis/ci4-news)
- [CodeIgniter 4 Validation Tutorial](https://github.com/kenjis/ci4-validation-tutorial)
- [CodeIgniter4 Code Modules Test](https://github.com/kenjis/ci4-modules-test)
- [CodeIgniter 4 File Upload](https://github.com/kenjis/ci4-file-upload)

### Building Development Environment

- [CodeIgniter4 Application Template](https://github.com/kenjis/ci4-app-template)
- [CodeIgniter4 Composer Installer](https://github.com/kenjis/ci4-composer-installer)
- [docker-codeigniter-apache](https://github.com/kenjis/docker-codeigniter-apache)

repository: kenjis/codeigniter-ss-twig

gha_language: PHP

repo_name: kenjis/codeigniter-ss-twig


text:
Storing the build configuration (bitrise.yml) in your repository can be a great idea.
It has its own PROs and CONs of course, so you have to decide it yourself
whether this solution is a good fit for your project or not.

Things to keep in mind!

You can find a discussion about what are the advantages and
disadvantages of this approach on GitHub.
To highlight a few things to keep in mind if you'd want to store and use
the bitrise.yml from your repository:

Trigger Map is better to be managed on bitrise.io

You can of course store the trigger_map (or Triggers on the web UI)
in your repository (in bitrise.yml), but if you do that you'll lose
the ability to ignore patterns. This is because bitrise.io
have to evaluate the Trigger map before the repository would be cloned
in order to be able to avoid starting a build based on the Trigger map.

The source code is never stored on bitrise.io,
(see Code Security - Source code for more information),
so if you store the trigger map in your repository, the only way to check it
is to clone it first. Even if you prepare your trigger_map in your repository to ignore
patterns, bitrise.io will start a build to clone
the repository, before it could abort it.

In contrast, if you specify the Trigger Map on bitrise.io,
you can ignore patterns in a way that it won't even start a build.

You can't change the build configuration of a commit

If you use the bitrise.yml from the repository, that means that when you
rebuild a specific commit, it will use the same bitrise.yml every time,
the one stored in the repository for that git commit.

The only way to change the configuration is to checkout the related
branch, change the bitrise.yml, commit the changes,
push and start a new build (rebuild of a commit won't work,
that will always get the same bitrise.yml, the one stored at the commit).

If you store your build configuration on bitrise.io
you can always rebuild any commit with a new build configuration,
the configuration is not tied to the commit / state of the repository.
You can simply change a parameter and hit "rebuild", the new build
will use the latest configuration from bitrise.io.

You can't edit the configuration in the Workflow Editor on bitrise.io

The Workflow Editor on bitrise.io can only be used
to visualize and edit the configuration stored on bitrise.io.

The offline workflow editor
of course can be used, so this is probably not a huge issue - and we're
working on it to make it as streamlined as possible - but might
make it harder to get started (as you have to install the Bitrise CLI
locally).

Pull Requests can run builds with any custom configuration

When someone sends a Pull Request they can modify the bitrise.yml
in your repository any way they like it. A recent trend for example
is to send pull requests which run a bitcoin miner, as long as
that's possible. This can make your builds to queue, until you
abort the related build or it hits the build time limit.

Example to use bitrise.yml from the repository

There are quite a few ways to accomplish this, as all you need is:

Define a "wrapper" build config on bitrise.io,
which defines how and from where your bitrise.yml will be retrieved.
E.g. you could store the bitrise.yml in a GitHub Gist
too, not just in your repository. In this example we'll use the configuration
from the repository, so the "wrapper" configuration on bitrise.io
will define how the repository should be retrieved. Note: this also allows
more customization, for example if the repository have to be accessed through
a VPN, you can configure that in the "wrapper" config and it will work.

Run the build configuration (bitrise.yml) with the Bitrise CLI.
This is the same runner which runs any other build on the bitrise.io
build virtual machines, so it's always preinstalled and ready to be used.

The example here is really simple to setup, should work in most cases (unless
you need a VPN for cloning the repository for example), but it also requires
you to maintain the Trigger Map on bitrise.io instead
of in the repository, as that is the recommended solution.

Step by step:

Create an app on bitrise.io, or if you already have it registered
open it.

Go to the Workflow tab to open the Workflow Editor.

In the Workflow Editor switch to bitrise.yml mode

In the bitrise.yml mode:

If you already have a configuration which you want to use, download the bitrise.yml first,
and save it into the root of your repository.
There's a button to quickly download the current bitrise.yml.

Once you're ready to replace your configuration on bitrise.io,
copy the bitrise.yml content for bitrise.io from below and paste
it into the editor on bitrise.io (in bitrise.yml mode of the editor)

Save the changes.

!!! note "After downloading the original bitrise.yml from bitrise.io"
The original bitrise.yml you downloaded from bitrise.io
most likely includes the steps to retrieve your repository.
These steps will be redundant, as you will define how the repository should be accessed
in the "wrapper" config on bitrise.io,
so go ahead and remove the activate-ssh-key and git-clone
steps from it before you would commit it into your repository.

bitrise.yml content for bitrise.io

---
format_version: 1.4.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

trigger_map:
- push_branch: "*"
  workflow: ci
- pull_request_target_branch: "*"
  workflow: ci

workflows:
  _run_from_repo:
    steps:
    - activate-ssh-key:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone: {}
    - script:
        title: continue from repo
        inputs:
        - content: |-
            #!/bin/bash
            set -ex
            bitrise run "${BITRISE_TRIGGERED_WORKFLOW_ID}"
  ci:
    after_run:
    - _run_from_repo

  another-workflow:
    after_run:
    - _run_from_repo

How this works:

This setup splits the build configuration into two parts:

The "wrapper" config on bitrise.io which
defines how the repository have to be retrieved (e.g. through a Git Clone),
which workflows are exposed for bitrise.io builds,
and defines the automatic Trigger mapping.

Your build configuration (bitrise.yml), stored in your repository,
which defines what should happen during the builds.

This "wrapper" configuration
defines a common workflow _run_from_repo,
which will activate an SSH key (if specified), Git Clone the repository,
and then switch to use the bitrise.yml from the repository
by running bitrise run "${BITRISE_TRIGGERED_WORKFLOW_ID}".

This common workflow (_run_from_repo) is then used through other workflows, like
ci and another-workflow, using the after_run
workflow chaining
mechanism. Those workflows do not have any steps, the only thing
the ci and another-workflow workflows do is running the
common _run_from_repo workflow.

The trick is bitrise run "${BITRISE_TRIGGERED_WORKFLOW_ID}".
The BITRISE_TRIGGERED_WORKFLOW_ID environment variable is set to the
"entry" workflow, the one which started the build.
So, by running the ci workflow, the bitrise run "${BITRISE_TRIGGERED_WORKFLOW_ID}"
command will be the same as bitrise run "ci".

This makes it super simple and quick to expose workflows from your bitrise.yml (stored in your
repository) to bitrise.io, all you have to do is:

Define the workflow in your bitrise.yml (in your repository).

Clone the ci workflow (or the another-workflow) with a name matching the workflow
in your bitrise.yml (in your repository), or create a new empty workflow
with a matching name and add the _run_from_repo as an after_run workflow.
Note: in the Workflow Editor UI you can quickly clone a workflow by
selecting the workflow, then clicking the "add new workflow" (+) button.

Step by step usage guide of the wrapper config:

For example, to add a new deploy workflow and to expose it for bitrise.io builds,
once you prepared your wrapper config on bitrise.io:

Create a deploy workflow in your bitrise.yml (in your repository, and don't forget to commit and push
the bitrise.yml changes!)

Then create a new workflow with the same name (deploy) on bitrise.io

Make sure that the deploy workflow on bitrise.io has
the _run_from_repo as an after_run workflow.

Define Triggers for the deploy workflow on bitrise.io
if you want to automate the triggering of that workflow.

Following the steps above, for example to run deploy for every code push on master you should
have a configuration like this on bitrise.io:

---
format_version: 1.4.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

trigger_map:
- push_branch: "master"
  workflow: deploy
- push_branch: "*"
  workflow: ci
- pull_request_target_branch: "*"
  workflow: ci

workflows:
  _run_from_repo:
    steps:
    - activate-ssh-key:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone: {}
    - script:
        title: continue from repo
        inputs:
        - content: |-
            #!/bin/bash
            set -ex
            bitrise run "${BITRISE_TRIGGERED_WORKFLOW_ID}"
  deploy:
    after_run:
    - _run_from_repo

  ci:
    after_run:
    - _run_from_repo

  another-workflow:
    after_run:
    - _run_from_repo

This configuration will run the deploy workflow from your repository for every
code push on the master branch, the ci workflow from your repository for
every code push on other branches as well as for Pull Requests,
and it will never run another-workflow automatically, but you will be able
to start manual builds with another-workflow, which will invoke
the another-workflow workflow from the bitrise.yml in your repository.

repository: dbreuer/devcenter

repo_name: dbreuer/devcenter


text:
# Todo list

_\( managed using [todo-md](https://github.com/Hypercubed/todo-md) \)_

- [x] Put webpack to work
- [x] Integrate Angular client with backend api
- [ ] Add some plugin so we can run backend directly from Gradle wrapper
- [ ] Add Gradle tasks to control front-end build process (generate dist)
- [ ] Add Gradle tasks to remove CORS config when generating the war file
- [x] Add Jest configuration
- [ ] Add Spock unit/integration tests for back-end code
- [ ] Add Hibernate/H2 database conifguration
- [ ] Add JavaEE 7 CDI
- [ ] Add Authorization & Authentication using JWT and Java Annotations - http://howtodoinjava.com/jersey/jersey-rest-security/
- [ ] Add front-end login/logout mechanism
- [ ] Add internationalization at API level
- [ ] Add internationalization at front-end
- [ ] Add default error message at API level
- [ ] Protect the web application against XSRF, CSRF, XSS, etc
- [ ] Make readme.md to instruct developers regarding how to run the code and how to play with it
- [ ] Add .travis.yml

repository: danielpsf/java-ee-rest-and-angular

repo_name: danielpsf/java-ee-rest-and-angular


text:
---
layout: post
title: My First "Hello, World!"
date: 2018-06-07 09:40:45 -0300
image: assets/img/my-first-hello-world/qbasic.png
---

The other day, I ran across [Windows 95 In Your Browser](https://win95.ajf.me/), which uses [Emscripten](https://github.com/kripken/emscripten) and [DOSBox](https://www.dosbox.com/download.php?main=1) to run a full-fledged operating system in a browser. What a time to be alive.

This got me thinking... if Windows 95 could run on this Frankenstein-ed stack, what other nostalgic tech could I resurrect from my childhood?

My mind immediately jumped to something that consumed hours and _hours_ of my childhood. It wasn't a game, it wasn't a chat app, it was [QBasic](https://en.wikipedia.org/wiki/QBasic).

If you grew up on QBasic, this screenshot will induce an immediate wave of nostalgia.

QBasic was a fantastic first language. Getting started was a breeze - a first-time QBasic user could fire up the all-in-one IDE/runtime environment, write something like this:

```sh
PRINT "Hello, world!"
```

... hit Shift+F5, and immediately see the greeting written to the screen!

It also came with a _great_ integrated help system that included lots of code snippets that I endless copy-and-pasted:

Recreating a QBasic environment in the browser was easier than expected, thanks to a project called [js-dos](http://js-dos.com/). After about an hour of work, I had a working QBasic editor running in all its glowing blue glory!

After digging around on my backup drives, I found my old QBasic .BAS files and took a trip down memory lane as I ran each of my ancient programs one-by-one. Most of them required a bit of tweaking before they would behave correctly - my 13-year-old self had a bad habit of saving files to directories without checking if they existed first, and he _really_ liked controlling program timing with empty loops:

```sh
FOR i = 0 TO 100000
NEXT i
```

... which unfortunately is entirely dependent on the speed of the host's CPU. I had to cut most of these loops by a factor of 100 since the browser runs the programs so much slower than the original hardware.

So, without further ado, here are the most interesting programs, delivered to you through time using the magic JavaScript. Click on any of the screenshots below to launch the program in a new tab:

## SPIRO.BAS

A precursor to my more modern project [Inspiral Web](https://nathanfriend.io/inspiral-web), this program creates Spirograph designs based on a few simple configurations.

Hint: Here's an example configuration to get you started:

- Inner wheel size: 52
- Outer wheel size: 100
- Hole number: 25
- Color: 12

SPIRO.BAS

## ADVNTUR1.BAS

An adventure game with ASCII graphics.

I gave it a few tries, and man, it is _hard_.

ADVNTUR1.BAS

## ALNATTCK.BAS

A super short animation of a little man being sucked up by alien invaders.

ALNATTCK.BAS

## CELOHLP2.BAS

A flash-card game for cello students that quizzes their knowledge of bass clef, tenor clef, and treble clef, complete with a high-scores list.

CELOHLP2.BAS

## COOL.BAS

Another drawing program that creates intricate designs with customizable color palettes. I used to draw these shapes with color pencils as a child which inspired this QBasic version.

COOL.BAS

## GIGA.BAS

QBasic had a fun pitch generation API which I used to recreate piano and cello pieces I was learning at the time. Here's Bach's _Giga_ from the _Partita in B Flat_:

GIGA.BAS

## GORILLA.BAS

Okay, you got me - this one isn't mine. It's one of the example programs that shipped with QBasic. My siblings and I had loads of fun lobbing explosive bananas at each other.

GORILLA.BAS

## NEWTETRS.BAS

A Tetris clone.

NEWTETRS.BAS

## PATIENCE.BAS

Test your patience! How long can you hold down Q?

PATIENCE.BAS

## STRESS.BAS

Feeling stressed?

There's _lots_ more where the above came from. Here's a little GUI that can launch and run any of the programs I wrote as a child:

nathanfriend.io/origins

## Source

If you're interested in how this little project works, [check it out on GitHub here](https://github.com/nfriend/origins-host).

gha_language: SCSS

gha_license_id: NOASSERTION


text:
---
title: Time Management
author: Jeremy
tags: [PhD]
imagelink: TimeManagement
permalink: /630
date: 2022-08-12
---

![Two friends walk together. The first one says, "I really learned a lot about time management during my PhD." The friend says, "Oh yeah? So you're more efficient now?" The first one replies, "Not at all, but I now keep expectations super low."](https://res.cloudinary.com/dh3hm8pb7/image/upload/q_auto:best/v1535842782/Handwaving/Published/{{ page.imagelink }}.png){: .centre-image }

"I also learned that research is super-duper hard. Maybe I should have realized that going in."


text:
---
title: Work with basic data types
seotitle: Work with basic Flux data types
list_title: Basic types
description: >
  All Flux data types are constructed from **basic types**: boolean, bytes,
  duration, string, time, float, integer, uintegers, and null.
menu:
  flux_0_x:
    name: Basic types
    parent: Work with Flux types
weight: 101
---

All Flux data types are constructed from the following **basic types**:

{{< children type="anchored-list" >}}

{{< children readmore=true >}}


text:
# React Greenfield Project

## Getting Started

```
git clone git@github.com:sanlouise/react-greenfield.git

cd react-greenfield

npm install

npm start
```

## Requirements

* Use webpack, babel, and ES6/7.
* Use mocha/chai to test **at least** all components, actions, and reducers.
* Call an external API (ie. NASA data, homeless pets data, etc.).
* Use d3 for data visualization from the external API's data, and optionally Highcharts for less complex visualizations.
* Use Redux, React Router, and Immutable.js.

## Credits

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

## License
[MIT](LICENSE) License.

repository: sanlouise/react-greenfield

repo_name: sanlouise/react-greenfield


text:
# data-oasis-prc-cd-rtm-flowgate-rtm

Fill in the requested data below. Of course delete the instruction lines as that would be silly to leave them in.

## About

Fill in a description of the data source.

## Source

Fill in where the data was retrieved from.

## Process

Fill in how the data was collected and processed.

## Comments

Fill in any extra comments.

## Maintainer
* OWNER		: Todd Greenwood-Geer
* COMPANY	: Enviro Software Solutions, LLC
* EMAIL<EMAIL_ADDRESS>
## Notes

See companion project for details:

    https://github.com/energy-analytics-project/energy-dashboard


text:
wiring-timer-c
===================

Universal Timer with 1 millisecond resolution, originally based on Arduino millis() function, C implementation (single instance only).

# Features

* configurable to be either recurring (timer automatically restarts after the interval) or non-recurring (timer stops after timeout period is over)
* timer interval/timeout time configurable
* originally based on Arduino millis() function (number of milliseconds since the Arduino board began running the current program), the source of the uptime info [ms] can be overridden by injecting a platform specific implementation when working with other frameworks than with Arduino
* handles unsigned long int overflows correctly

# Integration

Here the integration of a Timer is shown with a simple Arduino Sketch toggling the Arduino board's built-in LED (blink):

* include the library

  ```C
  #include <SpinTimer.h>
  ```

* timer interval constant definition

  ```C
  const unsigned int BLINK_TIME_MILLIS = 200;
  ```

* specific `SpinTimerAdapter` implementation, periodically toggling the Arduino built-in LED

  ```C
  void BlinkTimerAdapter_timeExpired()
  {
    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
  }
  ```

* setup: set LED pin to output; create recurring Timer, inject specific TimerAdapter

  ```C
  // The setup function is called once at startup of the sketch
  void setup()
  {
    pinMode(LED_BUILTIN, OUTPUT);

    SpinTimer_create(SpinTimer_IS_RECURRING);
    SpinTimer_assignTimeExpiredCallback(&BlinkTimerAdapter_timeExpired);
    SpinTimer_start(BLINK_TIME_MILLIS);
  }
  ```

* loop: call `SpinTimer_tick()` function

  ```C
  // The loop function is called in an endless loop
  void loop()
  {
    SpinTimer_tick();
  }
  ```

## Platform specific Uptime Info Adapter injection

When using the Timer library with an Arduino Framework environment the uptime milliseconds counter info default implementation is automatically engaged and nothing has to be done.

If you are using other environments (i.e. when running in an STM32Cube system), a specific `UptimeInfoAdapter` implementation has to be used and injected. The following example shows the specific `STM32UptimeInfoAdapter`implementation of `UptimeInfoAdapter`as to be found in the Examples folder:

```C
/*
 * STM32UptimeInfoAdapter.h
 */

#ifndef STM32UPTIMEINFOADAPTER_H_
#define STM32UPTIMEINFOADAPTER_H_

#include "stm32l4xx_hal.h"
#include "UptimeInfo.h"

unsigned long STM32UptimeInfoAdapter_tMillis()
{
  unsigned long ms = HAL_GetTick();
  return ms;
}

#endif /* STM32UPTIMEINFOADAPTER_H_ */

```

Here is how the `STM32UptimeInfoAdapter` implementation is injected into the `SpinTimer` instance:

```C
// ..
#include "STM32UptimeInfoAdapter.h"

int main(void)
{
  HAL_Init();
  SystemClock_Config();

  // ..

  SpinTimer_assignUptimeInfoCallout(&STM32UptimeInfoAdapter_tMillis);

  // ..

  while (1)
  {
    SpinTimer_tick();
  }
}
```

# API

This section describes the Timer library Application Programming Interface.
## SpinTimer
* *Constructor*: `SpinTimer_create(bool isRecurring)`
  * Parameter `isRecurring`: Operation mode, true: recurring, false: non-recurring
* Assign specific `timeExpired` callback function, acts as dependency injection. `void SpinTimer_assignTimeExpiredCallback(void (*timeExpired)())`
  * Parameter `void (*timeExpired)()`: Function Pointer to specific `timeExpired` function implementation
* Assign specific `tMillis` callout function, acts as dependency injection. `void SpinTimer_assignUptimeInfoCallout(unsigned long (*tMillis)())`
  * Parameter `unsigned long (*tMillis)()`: Function Pointer to specific `tMillis` function implementation

* *Start or restart the timer* with a specific time out or interval time. `void SpinTimer_start(unsigned long timeMillis)`
   * Parameter `timeMillis`: Time out or interval time to be set for the timer [ms]; 0 will make the timer expire as soon as possible.
* *Cancel the timer and stop*. `void SpinTimer_cancel()`
  * No time expired event will be sent out after the specified time would have been elapsed.
  * Subsequent `SpinTimer_isExpired()` queries will return false.

* Poll method to *get the timer expired status*, recalculates whether the timer has expired before. `bool SpinTimer_isExpired()`
  * This method could be used in a pure polling mode, where `SpinTimer_tick()` has not to get called by the `SpinTimer_tick()` function, but also a mixed operation in combination with calling `SpinTimer_tick()` periodically is possible.
  * Subsequent `isTimerExpired()` queries will return false after the first one returned true, as long as the time did not expire again in case of a recurring timer.
  * Returns `true` if the timer has expired, `false` otherwise.

* Indicates whether the timer is currently *running*. `bool SpinTimer_isRunning()`
  * Returns `true` if timer is running, `false` otherwise.

* Kick the Timer. `void SpinTimer_tick()`
   * Recalculates whether the timer has expired.

* Constant for `isRecurring` parameter of the constructor to create a one shot timer.
  `static const bool SpinTimer_IS_NON_RECURRING = false`

* Constant for `isRecurring` parameter of the constructor to create a recurring timer.
  `static const bool SpinTimer_IS_RECURRING = true`

## SpinTimerAdapter
* Adapter Interface, contains `void (*timeExpired)()` function pointer prototype declaration.
* *Time expired event*. To be implemented by specific call back function with the same signature as `void (*timeExpired)()`.

## UptimeInfo
* Uptime Info Adapter Interface, contains `unsigned long (*tMillis)()` function pointer prototype declaration.
* Call out to get current milliseconds. To be implemented by specific call back function with the same signature as `unsigned long (*tMillis)()`.

# Notes
This repository is a C language adaptation of https://github.com/dniklaus/wiring-timer.

repository: dniklaus/wiring-timer-c

gha_language: C

repo_name: dniklaus/wiring-timer-c


text:
# Exit Intent Pop-up 2

![Screenshot](https://github.com/optimizely/extension-library/blob/master/Extensions/Editor%20Extensions/Timed%20Modal/screenshot.png)

## Description

When a user moves the mouse off screen a pop-up will appear.

## Fields

* Headline text
* Secondary text
* CTA text
* CTA link
* Image URl
* Injection point (entry/exit)

url: https://raw.githubusercontent.com/pcolombo/library/09d4d32cd54089669bac348aaf36439595f90642/Extensions/Editor Extensions/Exit Intent Pop-up 2/README.md

repository: pcolombo/library

repo_name: pcolombo/library


text:
## DesktopToastANE

[![paypal](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=6WW2HJLAQUBXU)

Adobe Air Native Extension written in ActionScript 3 and C++ for displaying adaptive and interactive toast notifications in Windows 8.1, Windows 10 and UserNotificiations on OSX 10.12.1.
Sample client included

![alt tag](https://raw.githubusercontent.com/tuarua/DesktopToastANE/master/screenshots/screenshot1.png)

![alt tag](https://raw.githubusercontent.com/tuarua/DesktopToastANE/master/screenshots/screenshot2.jpg)

### Features
 - Windows 32 and 64 bit.
 - Adaptive and interactive toast notifications are new features added in Version 1607 of Windows 10.
 - Interactive toasts for Windows 8.1.
 - User notifications on OSX.

##### Dependencies
From the command line cd into /example and run:
- OSX
````shell
bash get_dependencies.sh
`````
- Windows Powershell
````shell
PS get_dependencies.ps1
`````

### Windows Installation - Important!

* This ANE was built with MS Visual Studio 2015. As such your machine (and user's machines) will need to have Microsoft Visual C++ 2015 Redistributable (x86) runtime installed.
https://www.microsoft.com/en-us/download/details.aspx?id=48145

### Tech

DesktopToastANE uses the following libraries:
C++
* [https://github.com/nlohmann/json/] - JSON for Modern C++

### Prerequisites

You will need

 - Flash Builder 4.7 or IntelliJ IDEA
 - AIR 29
 - MS Visual Studio 2017 if you wish to modify the ANE code on Windows
 - Xcode 9.3 if you wish to modify the ANE code on OSX

### Known Issues
You should use a different appName when debugging. The required .lnk file created in \AppData\Roaming\Microsoft\Windows\Start Menu\Programs will point to adl initially.

### References
https://blogs.msdn.microsoft.com/tiles_and_toasts/2015/07/02/adaptive-and-interactive-toast-notifications-for-windows-10/
https://blogs.msdn.microsoft.com/tiles_and_toasts/2015/10/16/quickstart-handling-toast-activations-from-win32-apps-in-windows-10/
https://github.com/WindowsNotifications/desktop-toasts

repository: MitchellAJ/DesktopToastANE

repo_name: MitchellAJ/DesktopToastANE


text:
# IO.Swagger.Api.LiquidationApi

All URIs are relative to *https://localhost/api/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**LiquidationGet**](LiquidationApi.md#liquidationget) | **GET** /liquidation | Get liquidation orders.

# **LiquidationGet**
> List<Liquidation> LiquidationGet (string symbol = null, string filter = null, string columns = null, decimal? count = null, decimal? start = null, bool? reverse = null, DateTime? startTime = null, DateTime? endTime = null)

Get liquidation orders.

### Example
```csharp
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class LiquidationGetExample
    {
        public void main()
        {

            var apiInstance = new LiquidationApi();
            var symbol = symbol_example;  // string | Instrument symbol. Send a bare series (e.g. XBU) to get data for the nearest expiring contract in that series.  You can also send a timeframe, e.g. `XBU:monthly`. Timeframes are `daily`, `weekly`, `monthly`, `quarterly`, and `biquarterly`. (optional)
            var filter = filter_example;  // string | Generic table filter. Send JSON key/value pairs, such as `{\"key\": \"value\"}`. You can key on individual fields, and do more advanced querying on timestamps. See the [Timestamp Docs](https://www.bitmex.com/app/restAPI#timestamp-filters) for more details. (optional)
            var columns = columns_example;  // string | Array of column names to fetch. If omitted, will return all columns.  Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. (optional)
            var count = 3.4;  // decimal? | Number of results to fetch. (optional)  (default to 100)
            var start = 3.4;  // decimal? | Starting point for results. (optional)  (default to 0)
            var reverse = true;  // bool? | If true, will sort results newest first. (optional)  (default to false)
            var startTime = 2013-10-20;  // DateTime? | Starting date filter for results. (optional)
            var endTime = 2013-10-20;  // DateTime? | Ending date filter for results. (optional)

            try
            {
                // Get liquidation orders.
                List<Liquidation> result = apiInstance.LiquidationGet(symbol, filter, columns, count, start, reverse, startTime, endTime);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LiquidationApi.LiquidationGet: " + e.Message );
            }
        }
    }
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **symbol** | **string**| Instrument symbol. Send a bare series (e.g. XBU) to get data for the nearest expiring contract in that series.  You can also send a timeframe, e.g. `XBU:monthly`. Timeframes are `daily`, `weekly`, `monthly`, `quarterly`, and `biquarterly`. | [optional]
 **filter** | **string**| Generic table filter. Send JSON key/value pairs, such as `{\"key\": \"value\"}`. You can key on individual fields, and do more advanced querying on timestamps. See the [Timestamp Docs](https://www.bitmex.com/app/restAPI#timestamp-filters) for more details. | [optional]
 **columns** | **string**| Array of column names to fetch. If omitted, will return all columns.  Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. | [optional]
 **count** | **decimal?**| Number of results to fetch. | [optional] [default to 100]
 **start** | **decimal?**| Starting point for results. | [optional] [default to 0]
 **reverse** | **bool?**| If true, will sort results newest first. | [optional] [default to false]
 **startTime** | **DateTime?**| Starting date filter for results. | [optional]
 **endTime** | **DateTime?**| Ending date filter for results. | [optional]

### Return type

[**List<Liquidation>**](Liquidation.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json, application/x-www-form-urlencoded
 - **Accept**: application/json, application/xml, text/xml, application/javascript, text/javascript

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

repository: wildbunny/api-connectors

repo_name: wildbunny/api-connectors


text:
The Master Boot Record is the same for pretty much all Operating Systems.  It is located on the first Sector of the Hard Drive, at Cylinder 0, Head 0, Sector 1.  It is the first piece of code that your computer runs after it has checked all of your hardware (POST) and turned control of loading software over the hard drive.

  It also contains the partition table, which defines the different sections of your hard drive.

Offset				Description								   Size
000h				Executable Code (Boots Computer)			446 Bytes
1BEh				1st Partition Entry (See Next Table)		16  Bytes
1CEh				2nd Partition Entry						16  Bytes
1DEh				3rd Partition Entry						16  Bytes
1EEh				4th Partition Entry						16  Bytes
1FEh				Boot Record Signature (55h AAh)			2   Bytes

repository: nopsys/SmalltalkNOS

gha_language: Smalltalk

repo_name: nopsys/SmalltalkNOS


text:
# excelgooglemaps

Simple Excel functions written in VBA to call the [Google Maps API](https://developers.google.com/maps/documentation) easily.
* Returns the driving distance between two addresses
* Cleans up addresses to a Google Maps compliant format
* Returns the postal code of an address

## Setup
First, clone this repository onto your system.

Then, in an Excel spreadsheet, type Alt+F11 to open the VBA development environment.

In the VBA development environment, click on File > Import File... and navigate to the location of the `DistanceFunctions.bas` file from this repo.

Close the VBA development environment, and you will be able to to use the Google Maps functions in your spreadsheet.

## Usage
### GetDistance
Function that returns the driving distance in meters between two addresses
#### Parameters
* Source address: The Google Maps compliant address of the source location
* Destination address: The Google Maps compliant address of the destination location
### GetAddress
Function returns a Google Maps compliant address based on minimal information
#### Parameters
* Address fragment: String of minimal address information
### GetPostalCode
Function returns the zip code of a Google Maps compliant address
#### Parameters
* Address: A Google Maps compliant address string

## Maintainer
Santiago Delgado  ([@santiagodc](https://twitter.com/santiagodc))

## License
MIT

## Disclaimer
This repo has no affiliation with Microsoft or Google


text:
# Building docs #
To build docs, run `make` in this directory. `make help` lists all targets.

## Requirements ##
Sphinx and Latex is needed to build doc.

**Spinx:**
```sh
pip install sphinx
```

**Latex Ubuntu:**
```sh
sudo apt-get install -qq texlive texlive-latex-extra dvipng
```

**Latex Mac:**

Install the full [MacTex](http://www.tug.org/mactex/) installation or install the smaller [BasicTex](http://www.tug.org/mactex/morepackages.html) and add *ucs* and *dvipng* packages:
```sh
sudo tlmgr install ucs dvipng
```

## Fixing Warnings ##

- "citation not found: R###"
  $ cd doc/build; grep -rin R### .
  There is probably an underscore after a reference
  in the first line of a docstring (e.g. [1]_)

- "Duplicate citation R###, other instance in...""
  There is probably a [2] without a [1] in one of
  the docstrings

- Make sure to use pre-sphinxification paths to images
  (not the _images directory)

repository: statlab/permute

repo_name: statlab/permute


text:
# ArduinoTimeLapse
Use Arduino as a camera remote to create time lapses. <br>
This code is for Nikon cameras only.

## Usage
You can set the time between photos changing the `LapseTime` value which is expressed in milliseconds.
Default is set to 5 seconds.

## Arduino Setup

The final setup looks like this:

![ArduinoSetup](./images/Nikon_Time_Lapse.png)

Arduino has a normal LED connected to pin 5 (you can change it throug `LEDPin`) with a small resistance, and an IR LED connected to pin 3 (you can change it throug `IRPin`) also with a small resistance.

The IR LED should be directed to the IR sensor of the camera.
The colored LED signals to the user the moment the IR signal is sent.

This is the setup:

![Final Setup](./images/photo.jpg)

repository: LucaAngioloni/ArduinoTimeLapse

repo_name: LucaAngioloni/ArduinoTimeLapse


text:
bash-utils
==========

A lightweight bash script organization system.

This is for those sysadmins and other bash power-users who find their **.bash_profile** cluttered by the aliases and functions they've collected over the years.

bash-utils also provides a handy way of organizing bash **aliases** (shortcut commands) and collections of related functions/aliases ("**plugins**").

# Installation

1. Clone this repo to wherever you want on your machine. Recommended path: your $HOME folder.

	`git clone https://github.com/ftsanjuan/bash-utils.git /path/to/bash-utils`

2.  If you cloned the repo to somewhere other than your $HOME folder, edit the BU_ROOT variable in bash-utils.sh to update to the path your bash-utils installation.

	`export BU_ROOT="/path/to/bash-utils`

3.  Add this line to the end of your **.bash-profile** (typically found in **~/.bash_profile**):

	`source /path/to/bash-utils/bash-utils.sh`

4. Reload your **.bash_profile** running:

	`. ~/.bash_profile` or `bashrl` (if you have the **quick-edit.aliases.sh** file included in your bash-utils installation)

5. Done.

# Customization

## Adding a new aliases file

bash-utils looks for and loads all files ending with **.aliases.sh** in **bash-utils/aliases**.  To add a new aliases file

1.  Create a new file ending with `.alias.sh` (ex. `my-new-aliases.aliases.sh`)

2.  Save it to the **bash-utils/aliases** folder

3.  Reload your **.bash_profile** running:

	`. ~/.bash_profile` or `bashrl`

4.  Done.

## Adding a new plugin file

bash-utils looks for and loads all files ending with **.plugin.sh** in **bash-utils/plugins**.  To add a new plugins file

1.  Create a new folder for your plugin in **bash-utils/plugins** folder.

	**NOTE: Although this is not strictly required, it is highly recommended for the sake of avoiding the clutter that got you here in the first place!**

2.  Create a new file ending with `.plugin.sh`

	(ex. `my-new-plugin.plugin.sh`)

3.  Save it to the **bash-utils/plugins** folder (or the folder within **bash-utils/plugins** which you created in Step 1)

4.  Reload your **.bash_profile** running:

	`. ~/.bash_profile` or `bashrl`

5.  Done.

repository: ftsanjuan/bash-utils

repo_name: ftsanjuan/bash-utils


text:
---
layout: post
title: "Investigate the 3 occurrence of panic among 30m request"
description: ""
category:
tags: []
---
{% include JB/setup %}
First, let me introduce the *background*. We have one endpoint (http service build with [golang](https://golang.org)) are searching data from the database and return to the client. Recently we would like to switch this part of searching behavior to [elasticsearch](https://www.elastic.co/products/elasticsearch). And after about one weeks' 30% production traffic testing, we switched 100% traffic to elasticsearch.

At first, everything goes well. But after one hour, it happened 2 **panic** which *never* happen before. After half hour, 1 more panic **happened** again. For stability consideration, we switch back to the database. And then start our investigating.

The first step is trying to understand what happened exactly. Luckily, we have the full stack. The error message said that :

`fatal error: concurrent map read and map write.
`

And it happened at this line of code:

`logging.Error(logTag, "context=%v,err=%v", ctx, err)
`

'logging' is our internal log package.

So here is *two* question:

One is what happened at that time which caused error make out program go to log error?

The other one is why the pure log action would cause panic?

With the help of DevOps team, it is clear that one of the nodes in elasticsearch is down at the time of first two panic. And the second time panic happened when there is a network issue on that machine. Both leads that the machine could not access the elasticsearch cluster successfully which lead to log fail action. So the first question is **answered**. The remaining is question two: why log would panic?

After searching the log, we could see that only 3 panics happened. All the others log *successfully*. And with the help of stack, we could know that some concurrent read and map write happened. Because we are trying to log the context so I am thinking maybe I could reproduce it. So I have a try.

```
package main
// go run -race main.go
import (
    "context"
    "fmt"
    "time"
)
func log(input interface{}) {
    fmt.Sprintf("%v", input)
    // fmt.Println(time.Now())
}
func main() {
    a := make(chan bool)
    ctx := context.WithValue(context.Background(), "key", "value")
    mapStruc := map[time.Time]time.Time{
        time.Now(): time.Now(),
    }
    fmt.Println(mapStruc)
    fmt.Println(ctx)
    go func() {
        for {
            // map example
            // log(mapStruc)
            // context example
            log(ctx)
        }
    }()
    go func() {
        for {
            // map example
            // mapStruc[time.Now()] = time.Now()
            // context example
            // ctx = context.WithValue(ctx, "key", time.Now())
        }
    }()
    <-a
    return
}
```

Unfortunately, I could reproduce with the map but not context. Context example would panic but not because of concurrent read but **over stack limit**. At this point, I am thinking maybe some of the middleware in our service do some magic of context. So I add the middleware of test code, still could not reproduce the panic.

After a second thought, I am thinking since it is so clear that it is due to map structure. I could also set a map in context as value. The test result proves my guess.

```
 m := map[bool]bool{
        true: false,
    }
 ctx := context.WithValue(context.Background(), "map", m)
```

After reproducing the possibility of panic, the question remaining is which part of data in context is written while logging?

So I print all the map structure in context.

```
listeners:map[net.Listener]struct {}{(*net.TCPListener)(0xc420406008):struct {}{}}
TLSNextProto:map[string]func(*http.Server, *tls.Conn, http.Handler){“h2”:(func(*http.Server, *tls.Conn, http.Handler))(0x42a0c70)}
“http.url.parameters”:map[string]string{}
activeConn:map[*http.conn]struct {}{(*http.conn)(0xc4207080a0):struct {}{}}
```

Before diving into detail, I would like to know how this structure is inserted in context?  It is clear after checking with the golang [source code](https://github.com/golang/go/blob/master/src/net/http/server.go#L2721).

```
baseCtx := context.Background() // base is always background, per Issue 16220
 ctx := context.WithValue(baseCtx, ServerContextKey, srv)
```

So let me back to the context detail. My doubt is that it is due to **activeConn**. It will change while connection status change of a service. The remaining thing is to prove it. So I write the code.

```
package main

import (
 "fmt"
 "net/http"
)

func handler(w http.ResponseWriter, r *http.Request) {
 fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
 // below would cause panic
 fmt.Println(r.Context())
}

func main() {
 http.HandleFunc("/", handler)
 http.ListenAndServe(":8080", nil)
}
```

It works well when I visit the test endpoint by the web browser. With the help of [ab](https://httpd.apache.org/docs/2.4/programs/ab.html) load testing tool, I could create the heavy load and so the connection status would change which reproduce the panic finally.

The factor is clear now. The **root cause** of panic is due to concurrent map read and map write. It happened when the connection on server open or close while do logging context.

The lesson learned: Only play with context if you do understand what you are doing.