Skip to content

Instantly share code, notes, and snippets.

View nmccready's full-sized avatar

nmccready nmccready

View GitHub Profile
@nmccready
nmccready / gist:fd853479d373954138f5
Created September 10, 2014 16:42
Code fixes to make chrome keyboard tab ordering shortcuts work on OSX.
if (navigator.appVersion.indexOf("Linux") < 0) {
document.addEventListener("keydown", function(e) {
// return if no modifiers.
// if (!e.shiftKey || !e.ctrlKey) {
// return;
// }
if (!e.metaKey || !e.shiftKey) {
return;
}
// Only send if we are interested.
sumTry match {
case SqlError(error) => {
Console.println("Handled Sql Failure: " + error)
}
case Error(s) => {
Console.println("BasicError" + s)
}
}
#!/bin/bash
set -e
set -x
ignorePid=$BASHPID
echo my pid: $ignorePid
pids=`findProcs $1 | grep -v "$ignorePid"`
set +x
@nmccready
nmccready / arguments
Created September 25, 2014 15:44
checking arguments shell
#!/bin/sh
mandatory=${1?missing arg1}
optionalWDefault=${2:-somecrap}
@nmccready
nmccready / convertNumToDatePsql.sql
Created September 26, 2014 14:48
working select case
select prior_sale_date,
CASE
WHEN prior_sale_date != '0'
then
to_date(prior_sale_date:: text,'YYYYMMDD')
ELSE
NULL
END AS date_formatted
from flc12021
@nmccready
nmccready / gist:dda72c0e5b192e441b89
Created October 10, 2014 17:22
sublime text 3 user prefs
{
"caret_extra_width": 2,
"draw_white_space": "all",
"findreplace_small": false,
"font_size": 20.0,
"ignored_packages":
[
"Vintage"
],
@nmccready
nmccready / readme.md
Last active August 29, 2015 14:07
markdown test on gratipay

Support via Gratipay

@nmccready
nmccready / .zshrc_nvm
Created October 28, 2014 16:03
nvm settins
#NVM
source $(brew --prefix nvm)/nvm.sh
#Node installs will be lost upon upgrading nvm. Add the following above
#the source line to move install location and prevent this:
export NVM_DIR=~/.nvm
def run_seq(cmd):
"""Run `cmd` and yield its output lazily"""
p = subprocess.Popen(
cmd, shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
# make STDIN and STDOUT non-blocking
fcntl.fcntl(p.stdin, fcntl.F_SETFL, os.O_NONBLOCK)
#shamelessly copied from
#http://tech.small-improvements.com/2013/09/10/angularjs-performance-with-large-lists/
#https://gist.github.com/rkgarg/7232175
app = require '../../app.coffee'
directiveName = 'postRepeat'
app.directive directiveName, [ '$log',
($log) ->
postRepeat = {}
scope: