This file contains 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
// 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 (.*): |
This file contains 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
== 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. |
This file contains 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
/**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." |