Skip to content

Instantly share code, notes, and snippets.

View kingbin's full-sized avatar
🎯
Focusing

Chris Blazek kingbin

🎯
Focusing
View GitHub Profile
@kingbin
kingbin / vcvarsall.bat
Created April 17, 2013 19:16
vcvarsall.bat
@echo off
if "%1" == "" goto x86
if not "%2" == "" goto usage
@set IE_BIN=%ProgramFiles%\Internet Explorer\iexplore.exe
@set PHANTOMJS_BIN=%APPDATA%\npm\node_modules\phantomjs\lib\phantom\phantomjs.exe
@doskey subl="C:\Program Files\Sublime Text 2\sublime_text.exe" $*
if /i %1 == x86 goto x86
vendor/
.bundle/
node_modules/
Gemfile.lock

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@kingbin
kingbin / jsbin.eqokiw.js
Last active December 20, 2015 21:09
Dynamic parameters by converting all the parameters passed to fxn into an array using Array.prototype.slice.call(arguments, 0) and then applying the array to the function.
var numberEval = function(value){ return (typeof value === 'number') ? value : parseInt(value,10); };
var p = [
{"paramName":"reinYear","val":numberEval},
{"paramName":"stateCode","val":numberEval},
{"paramName":"countyCode","val":numberEval},
{"paramName":"commodityCode","val":numberEval},
{"paramName":"insurancePlanCode","val":numberEval},
{"paramName":"practiceCode","val":numberEval},
{"paramName":"typeCode","val":numberEval}
@kingbin
kingbin / gist:7440442
Created November 12, 2013 23:04
Attach to tmux session named the same as current directory. thanks thoughtbot!
#!/bin/sh
#
# Attach to tmux session named the same as current directory.
#
tmux attach -t `basename $PWD`

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@kingbin
kingbin / gist:8363055
Last active January 2, 2016 21:19
git commit detective work between 2 hashesResult will have
git checkout <hash A>
git diff –patch <hash A> <hash B> > patch.patch
patch –p1 –N < patch.patch
// Remove any rej files generated from patch
for i in $(git status | awk '/**.rej/{print $2}'); do rm $i; done
@kingbin
kingbin / gist:9435292
Last active August 19, 2024 19:53
Manually Start/Stop PostgresSQL on Mac
# Stop PostgreSQL from auto starting
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Enable PostgreSQL to auto start
sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Start postgres
$ sudo su postgres
Password:
bash-3.2$ pg_ctl -D /Library/PostgreSQL/9.3/data/ start
@kingbin
kingbin / .gemrc
Created March 11, 2014 16:48 — forked from jch/.gemrc
# http://docs.rubygems.org/read/chapter/11
---
gem: --no-ri --no-rdoc
benchmark: false
verbose: true
update_sources: true
sources:
- http://gems.rubyforge.org/
- http://rubygems.org/
backtrace: true
@kingbin
kingbin / gist:9538133
Created March 13, 2014 22:11
Download resources from Vegas VS live 2014
// Resources available from
// http://www.redmondevents.com/virtual/vslive/2014/live360/Default.aspx
// Javascript in javascript console
//$(".zip a").each(function( index ) {
// console.log( this.href);
//});
//
//$(".pdf a").each(function( index ) {
// console.log( this.href);