Skip to content

Instantly share code, notes, and snippets.

View gaving's full-sized avatar
🎯
Focusing

Gavin Gilmour gaving

🎯
Focusing
View GitHub Profile
node_modules
mbp:~/Sandbox/test% npm version
{ npm: '2.6.0',
http_parser: '2.3',
modules: '14',
node: '0.12.0',
openssl: '1.0.1l',
uv: '1.0.2',
v8: '3.28.73',
zlib: '1.2.8' }
mbp:~/Sandbox/test% gulp watchify
source ~/Sandbox/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/Sandbox/zsh-history-substring-search/zsh-history-substring-search.zsh
source ~/Sandbox/zsh-autosuggestions/autosuggestions.zsh
fpath=(~/Sandbox/zsh-completions/src $fpath)
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
zle-line-init() {
// fix for deprecated method in Chrome 37
if (!window.showModalDialog) {
window.showModalDialog = function (arg1, arg2, arg3) {
var w;
var h;
var resizable = "no";
var scroll = "no";
var status = "no";
q() {
/bin/mysql --unbuffered --skip-column-names --raw -A -B -e "$@"
}
images() {
(
for i in {1..$(q "select MAX(photoid) from photos")}; \
echo -n $i && q "select photo from photos where photoid=${i}" | magick - info:-
) | sort -h -k 7 | tail -n 10
}
switch-site() {
if [[ $HOST == *gon* ]] then
SWITCH=${HOST/gon/gye}
else
SWITCH=${HOST/gye/gon}
fi
LBUFFER="ssh $SWITCH"
zle accept-line
}
zle -N switch-site
require 'coffee-script/register'
gulp = require 'gulp'
coffee = require 'gulp-coffee'
gutil = require 'gulp-util'
jasmine = require 'gulp-jasmine'
watch = require 'gulp-watch'
gulp.task 'build', ->
gulp.src('./src/*.coffee')
#!/usr/bin/env bash
[[ ! -f 'config.sh' ]] && echo "'config.sh' not found. Create from config.sh.example." && exit
source config.sh
CURRENT_PATH=$(dirname $0)
SCHEMA_DIR=$CURRENT_PATH/structure
MIGRATION_DIR=$CURRENT_PATH/migrations
LOG_DIR=$CURRENT_PATH/logs
@gaving
gaving / mcp.zsh
Created October 22, 2014 10:36
copy mysql data less painfully
mcp() {
for i in mysqldump xargs pv; do
[[ ! -x `which $i 2>/dev/null` ]] && echo "$i is required to run." && return 1
done
_usage() {
echo "Usage: [--f/--n] user:pass@serverA/databaseA user:pass@serverB/databaseB [table]";
}
if [ $1 ]; then
class Dashing.Alert extends Dashing.Widget
ready: ->
onData: (data) ->
@accessor 'isHigh', ->
@get('level') in ['SEVERE', 'CRITICAL']