Skip to content

Instantly share code, notes, and snippets.

View keithamus's full-sized avatar
:fishsticks:

Keith Cirkel keithamus

:fishsticks:
View GitHub Profile
// context: https://twitter.com/codepo8/status/572863924887945216
function fuzzysearch(query, text) {
// Build a regex, then test text against it:
return RegExp(
query
// Escape any special regex characters:
.replace(/[.*+?^${}()|[\]\/\\]/g, '\\$&')
// Any escaped or non-escaped character can be followed by
// any number of other characters (.*):
@coliver
coliver / jameswhitemanifesto.txt
Created May 22, 2014 14:58
James White Manifesto
== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
/**package
* { "name": "npm-test-single-file"
* , "main": "index.js"
* , "version": "1.2.3"
* , "description":"No package.json in sight!"
* , "dependencies": { "minimatch": "*" }
* }
**/
module.exports = "I'm just a lonely index, naked as the day I was born."