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 / gist:7bdccbc7562e8242362e
Created March 17, 2015 22:01
Run command as another user
sudo -H -u thebauce bash -c 'echo "I am $USER, with uid $UID"'
@kingbin
kingbin / gist:af836ccea1100cd89cc9
Last active August 29, 2015 14:17
NPM install script for deploying
#!/bin/bash
red='\033[0;31m'
green='\033[0;32m'
NC='\033[0m' # No Color
set -o errexit # Exit on error
command -v pdftk >/dev/null 2>&1 || { echo -e >&2 "${red}I require pdftk but it's not installed. Aborting.${NC}"; exit 1; }
#DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
@kingbin
kingbin / Invert Mouse
Created February 26, 2015 17:15
invert mouse for natural scroll
PowerShell (admin):
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
rvm list known - list most recent / imporant releases rvm supports with source
rvm list remote [rubies|rbx|jruby] - list available binaries for your platforms
rvm install 2.1 --latest-binary - install latest available 2.1 binary (before I have time to compile from latest source)
rvm install rbx-weekly --binary - detect latest available weekly build of rbx
update those gems dude
gem update `gem list | cut -d ' ' -f 1`
@kingbin
kingbin / gist:10283683
Created April 9, 2014 15:33
tmuxinator window # fix on Ubuntu 12.04
sudo apt-get install python-software-properties software-properties-common
sudo add-apt-repository ppa:pi-rho/dev
sudo apt-get update
sudo apt-cache show tmux
sudo apt-get install tmux
tmux -V
mux iPadServices
@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);
@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: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 / 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