Goal is given a text T
and pattern P
(where the strings exist over ∑
), find some or all the occurences of P
in T
as a substring.
- GitHub Staff
- https://josh.black
- @josh.black
- @__joshblack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scoped = { | |
foo: () => 'foo', | |
bar: () => 'bar', | |
baz: { a: 'b' }, | |
arr: [0] | |
}; | |
const evalify = (code, scope) => { | |
const variables = Object.keys(scope) | |
.map((name) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extends Tom Hanks co-actors, to find co-co-actors who haven't worked with Tom Hanks... | |
MATCH (tom:Person {name:"Tom Hanks"})-[:ACTED_IN]->(m)<-[:ACTED_IN]-(coActors), | |
(coActors)-[:ACTED_IN]->(m2)<-[:ACTED_IN]-(cocoActors) | |
WHERE NOT (tom)-[:ACTED_IN]->(m2) | |
RETURN cocoActors.name AS Recommended, count(*) AS Strength ORDER BY Strength DESC | |
// Find someone to introduce Tom Hanks to Tom Cruise | |
MATCH (tom:Person {name:"Tom Hanks"})-[:ACTED_IN]->(m)<-[:ACTED_IN]-(coActors), | |
(coActors)-[:ACTED_IN]->(m2)<-[:ACTED_IN]-(cruise:Person {name:"Tom Cruise"}) | |
RETURN tom, m, coActors, m2, cruise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Given two item objects with the following shape: | |
* | |
* { | |
* x: number, | |
* y: number, | |
* width: number, | |
* height: number | |
* } | |
* |
- https://github.com/happypoulp/redux-tutorial
- https://github.com/leoasis/redux-immutable-state-invariant
- https://github.com/eknuth/redux-devtools-bubbles-monitor
- https://github.com/buunguyen/redux-freeze
- https://medium.com/@gblache/managing-request-state-with-reactjs-and-redux-76ac745a19ef#.bawie54ip
- https://github.com/zalmoxisus/redux-devtools-filter-actions
- daeomon: A computer program that runs as a background process, rather than being under the direct control of an interactive user
- broker: In distributed computing, an object request broker (ORB) is a middleware which allows program calls to be made from one computer to another via a computer network.
- partition: a division of a logical database into distinct, independent parts.
- Normally done for performance, availability, or management reasons
- Horizontal partitioning: putting different rows into different tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Collection of utility functions used for querying React-specific Nodes | |
*/ | |
const utils = (j) => { | |
const findComponentClassExportDefault = (path) => | |
path.find(j.ExportDefaultDeclaration, { | |
declaration: { | |
type: 'ClassDeclaration', | |
superClass: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { check, gen, property } from 'testcheck'; | |
import generate from 'babel-generator' | |
import babel from 'babel-core'; | |
const genTrue = gen.suchThat((v) => v, gen.boolean); | |
const genFalse = gen.suchThat((v) => !v, gen.boolean); | |
const letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', | |
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.styles = []; | |
window.formatStyles = function () { | |
return styles.map(({ className, properties }) => { | |
const props = properties.map( | |
(prop) => `${prop.key.name}: ${prop.value.value};`).join('\n'); | |
return '.' + className + ' {' + '\n' + props + '\n}\n'; | |
}).join('\n'); | |
}; |