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
#!/bin/bash | |
# command line args | |
ID="$1"; | |
OUT="$2"; | |
# defaults | |
[ "$ID" ] || ID="$RANDOM" | |
[ "$OUT" ] || OUT="rnd_img_$(printf %08d "$ID").jpg" |
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
#!/bin/bash | |
################################################################################ | |
# | |
# USAGE: | |
# ./convert_to_gif.sh MOVIE_FILE [MOVIE_FILE_2] | |
# | |
# ARGS: | |
# MOVIE_FILE - the name of the movie file | |
# | |
# ENV VAR SETTINGS: |
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
#!/bin/bash -e | |
################################################################################ | |
# Links a local Node.js package directory into the current node_modules/ folder. | |
# This is simpler and more isolated than `npm link` so it's better for quick one-off testing. | |
# | |
# USAGE: | |
# ~/bin/ln-pkg.sh LOCAL_PKG_DIR [LOCAL_PKG_DIR_2] | |
# | |
################################################################################ | |
[ -d "node_modules" ] || { echo "missing node_modules/"; exit 1; } |
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
#!/bin/sh | |
# Description: | |
# Automated backup script designed to support multiple backup servers. | |
# | |
# ChangeLog: | |
# 20130822 kdavis - Updated to use fully qualified hostname | |
# 20120125 kdavis - Minor updates for mysqldump over ssh so it can use the same security model as rsync, setting env vars from command line, and logging | |
# 20080610 kdavis - Added missing rsync error code handling to one of the backup methods that uses rsync internally | |
# 20080123 kdavis - Added more debugging; and... | |
# 20080119 kdavis - Added lock files/PID checks to ensure only one instance |
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
# Increased file and proc limits for Mac OS X based on http://superuser.com/a/514049 | |
limit maxfiles 8192 20480 | |
limit maxproc 1000 2000 |
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
// Karma one-liner to make these tests self-hosted (needs karma.conf.js support for TEST_FILE env var) | |
if(typeof require!=='undefined' && require.main===module) global.describe=function(){}, process.env.TEST_FILE=__filename, require("karma").server.start({configFile:__dirname+'/../karma.conf.js'}); | |
describe('app.module.thing', function(){ | |
// module deps | |
beforeEach(module('app.module')); | |
// vars injected | |
var $rootScope; |
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
#!/bin/bash | |
# A simple script to get the given URL with cURL and output stats. | |
# | |
# USAGE: | |
# get_url_stats.sh <URL> | |
# | |
############################################################################### | |
out() { echo "`date +%Y%m%dT%H%M%SZ`: $*"; } | |
err() { out "$*" 1>&2; } |
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
#!/bin/bash | |
# Template bash script using given script file as source for variable values | |
if [ -f "$1" ]; then source "$1" || echo "#! ERROR: Unable to read variables from script: $1!" 1>&2 && exit 1; fi | |
(awk '/TMPL$/,/^TMPL/{print}' "$0" | grep -Eio '(^|[^\])\${?[A-Z][A-Z0-9_]*}?' | cut -c3- | tr -d '{}' | sort -u) | grep -v -w -F "$(env | cut -f1 -d= | sort)" | sed 's/^/ERROR: need tmpl var: /' | grep . && exit 123 || true | |
############################################################################### | |
cat<<TMPL | |
# Config generated on $(date) | |
HOST=$SOME_HOST | |
FILES="$(ls -1 | paste -sd,)" | |
TMPL |
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
"use strict"; | |
// Mocha one-liner to make these tests self-hosted | |
if (!module.parent) return require.cache[__filename] = 0, (new(require("mocha"))()).addFile(__filename).ui("exports").run(process.exit); | |
// requires | |
var assert = require("assert"), | |
MyClass = require("../../lib/MyClass"); |
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
var util = require("util"); | |
var o = { | |
p1: { | |
c1:[{l1:"a"}, {l2:"b"}], | |
c2:{l3:3, l4:4} | |
}, | |
p2: {foo:"bar"} | |
}; | |
process.stdout.write("// Original object:\n"); |
NewerOlder