Skip to content

Instantly share code, notes, and snippets.

View scottstanfield's full-sized avatar
🚀
:wq

Scott Stanfield scottstanfield

🚀
:wq
  • Relativity Space
  • California
  • 17:19 (UTC -07:00)
View GitHub Profile
@scottstanfield
scottstanfield / appendpath.sh
Created June 14, 2011 16:50
Append your path in .cshrc for tcsh
foreach dir ( /opt/local/bin "$HOME/.gem/ruby/1.8/bin" "$HOME/bin" . )
if ( $PATH !~ *$dir* && -d "$dir" ) setenv PATH "${dir}:${PATH}"
end
#!/bin/sh
# Includes current git branch in tcsh prompt.
#
# EXAMPLE
#
# Your prompt can look like this:
#
# [myhost.com ~/repos/foo (master)]
#
# USAGE:
#!/usr/bin/awk -f
# execute like:
# % git status |& git-prompt.awk
# (Inspiration from http://niczsoft.com/2010/05/my-git-prompt/)
BEGIN { branch = ""; prefix=""; suffix="" }
/# On branch/ { branch = $4; }
/untracked files present/ { prefix = prefix "*"; }
@scottstanfield
scottstanfield / gist:2581041
Created May 2, 2012 22:31
brew formula to compile vim with clipboard for Mac
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
# Get stable versions from hg repo instead of downloading an increasing
# number of separate patches.
url 'https://vim.googlecode.com/hg/', :revision => '70eff6af1158'
version '7.3.462'
head 'https://vim.googlecode.com/hg/'
#!/bin/sh
# Shell script scripts to read ip address
OS=`uname`
case $OS in
Linux)
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
WANIP=`wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'`
;;
FreeBSD|OpenBSD|Darwin)
require 'formula'
class Freetds < Formula
url 'http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/git/freetds-0.92.51.tar.gz'
homepage 'http://www.freetds.org/'
md5 '1d5f7292c9acf3209e1814e3e98664b2'
def install
system "./configure",
"--prefix=#{prefix}",
#!/bin/sh
sudo launchctl stop com.parallels.vm.prl_naptd
sudo launchctl stop com.parallels.desktop.launchdaemon
sudo launchctl stop com.parallels.vm.prl_pcproxy
sudo killall llipd
sudo kextunload -b com.parallels.kext.prl_hypervisor
sudo kextunload -b com.parallels.kext.prl_hid_hook
sudo kextunload -b com.parallels.kext.prl_usb_connect
#!/bin/tcsh
set ptail = "%";
set color_path="%{\033[0;47m%}"
set color_gray="%{\033[1;36m%}"
set color_normal="%{\033[0m%}"
set color_history="%{\033[0;35m%}"
# history path
set p1="%B%h%b $color_path%~$color_normal%b "
@scottstanfield
scottstanfield / sort.awk
Created May 30, 2013 15:56
Sort a set of multiline records separated by dashes.
# awk -f sort.awk file-to-sort.yaml
BEGIN {
RS = "-\n";
FS = "\n"
ORS = "\n-\n";
OFS = "\n";
}
{
print $6, $2, $1, $4, $3, $5
@scottstanfield
scottstanfield / cornify.js
Created September 5, 2013 14:21
cornify.js: konami code with rainbows and unicorns
// Modified to 'a a' instead of 'b a' due to vimium conflict
// ▲ ▲ ▼ ▼ ◀ ▶ ◀ ▶ a a
// example page: http://yckart.github.io/jquery.konami.js/
//
var kkeys = [], konami = "38,38,40,40,37,39,37,39,65,65";
$(document).keydown(function(e) {
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ){
$(document).unbind('keydown',arguments.callee);
$.getScript('http://www.cornify.com/js/cornify.js',function(){