This function is pulled from the "Are you a workaholic?" Test/Calculator on cnn.com. This code is horrific. http://edition.cnn.com/interactive/2011/05/living/workaholic.test/
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
#!/usr/bin/env bash | |
set -euo pipefail | |
FILENAME=${1?"Must specify filename"} | |
OUTPUT=${2?"Must specify output file"} | |
TYPE=$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "${FILENAME}") | |
if [ "${TYPE}" == "vc1" ]; then |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
FILENAME=${1?"Must specify filename as first arg"} | |
if od -A x -t x1 -v "$FILENAME" | grep -Eqe " 0[1-8bcef]| 1[0-9a-f]"; then | |
echo "$FILENAME: data" | |
fi |
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
+-------------------------+ | |
| | +-------------------+ | |
| | +---^+ HAWT | | |
| http://asciiflow.com/ | | | | | |
| | | +-------------------+ | |
| +----+ | |
+-------------------------+ |
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
var insert = "INSERT OR IGNORE INTO searchIndex(name, type, path) VALUES "; | |
var docs = "polymaps.org/docs/"; | |
var type='Method' | |
var sections = [] | |
$('a', $('ul', $('.sidebar'))).each(function(index, link) { | |
atag = $(link) | |
var path=docs+atag.attr('href') | |
var name=atag.text() | |
sections.push("('"+name+"', 'Section', '"+path+"')"); |
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
myFunc = -> | |
console.log "No one knows how to call me, this makes me sad" | |
@myFunc2 = -> | |
console.log "I'm on the window scope" | |
window.myFunc3 = -> | |
console.log "I'm on the window scope, as well." |
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
cmoultrie@Sauron~/G/jasmine-node (master) $ jasmine-node --coffee --nocolor spec/ > output.txt | |
FF...FF.....F....................F.............................. | |
Failures: | |
1) async should be timed out | |
Message: | |
timeout: timed out after 500 msec waiting for MIRACLE | |
Stacktrace: |
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
describe "Query Builder", -> | |
beforeEach module 'EG.QueryBuilder', ($provide) -> | |
$provide.value 'rawSourcesApi', [] | |
it "Checks the provider", inject (rawSourcesApi) -> | |
expect(rawSourcesApi).toEqual [] |
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
request = require 'request' | |
_ = require 'underscore' | |
regx = require 'xregexp' | |
Array::unique = -> | |
output = {} | |
output[@[key]] = @[key] for key in [0...@length] | |
value for key, value of output | |
class Anagram2 |
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
var request = require('http'), | |
url = 'http://localhost:1337/'; | |
describe('webservice', function() { | |
it('should respond to /ping', function(done) { | |
request.get(url + 'ping', function(res) { | |
expect(res.statusCode).toBe(200); | |
res.on('data', function(body) { | |
var json = JSON.parse(body); |
NewerOlder