NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
- Each line is a valid JSON value
- Line separator is ‘\n’
cat test.json | jq -c '.[]' > testNDJSON.json
NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
cat test.json | jq -c '.[]' > testNDJSON.json
| /** | |
| * New Tabia/Components JS-pattern. | |
| */ | |
| // Loose augmentation pattern. Creates top-level namespace variable if it | |
| // doesn't already exist. | |
| var Tabia = Tabia || {}; | |
| // Create a base for this module's data and functions. | |
| Tabia.myBehavior = {}; |
| foo = false; | |
| (function () { | |
| foo = true; | |
| })(); | |
| setTimeout(function () { | |
| foo = false; | |
| }, 0); |
| /** | |
| * Fancy ID generator that creates 20-character string identifiers with the following properties: | |
| * | |
| * 1. They're based on timestamp so that they sort *after* any existing ids. | |
| * 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
| * 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
| * 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
| * latter ones will sort after the former ones. We do this by using the previous random bits | |
| * but "incrementing" them by 1 (only in the case of a timestamp collision). | |
| */ |
| """Simple HTTP Server. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| """ | |
| __version__ = "0.6" |
| /* Proportionately resize iframes. Add class to a wrapper around the iframe */ | |
| .iframe-4-3, | |
| .iframe-16-9 { | |
| position: relative; | |
| padding-bottom: 75%; /* 4:3 */ | |
| height: 0; | |
| } | |
| .iframe-4-3 iframe, | |
| .iframe-16-9 iframe { | |
| position: absolute; |
| (function () { | |
| ////////////////////////////// | |
| // Add event (cross browser) | |
| // From http://stackoverflow.com/a/10150042 | |
| ////////////////////////////// | |
| function addEvent(elem, event, fn) { | |
| if (elem.addEventListener) { | |
| elem.addEventListener(event, fn, false); | |
| } else { | |
| elem.attachEvent('on' + event, function() { |
| #!/bin/bash | |
| # | |
| # Useful for switching between PHP versions (CLI and NGINX PHP-FPM) on OS X. Assumes | |
| # you've installed PHP via brew, maybe like so: | |
| # - brew install php56 && cp /path/to/cellar/php56/5.6.*/*.plist ~/Library/LaunchAgents/ | |
| # | |
| # Installation: | |
| # - curl https://gist.githubusercontent.com/iamEAP/c7464c7b42583baba98b/raw/.usephp > ~/.usephp | |
| # - echo "[[ -s \"\$HOME/.usephp\" ]] && source \"\$HOME/.usephp\" # Load usephp as a function" >> ~/.bash_profile |
| { | |
| "alignment_chars": | |
| [ | |
| "=", | |
| ":" | |
| ], | |
| "alignment_space_chars": | |
| [ | |
| "=", | |
| ":" |
| #! /usr/bin/env bash | |
| PROBLEM="$(cat /etc/hosts | grep tableausoftware.com | grep -v '^#' | wc -w)" | |
| if [ "$PROBLEM" -gt 0 ]; then | |
| say omg fix yer hosts | |
| fi |