Skip to content

Instantly share code, notes, and snippets.

View joshthewhite's full-sized avatar

Josh White joshthewhite

View GitHub Profile
@joshthewhite
joshthewhite / AutoHotKey.ahk
Last active September 26, 2017 18:27
AutoHotKey Run/Show/Hide Cygwin
EnvGet, userProfile, USERPROFILE
SetNumLockState, AlwaysOn
SetCapsLockState, AlwaysOff
SetWorkingDir, c:\
ToggleWinHideRun(WindowTitle, RunCommand, MaximizeOnRun)
{
SetTitleMatchMode,2
@joshthewhite
joshthewhite / syntax.rb
Created October 12, 2012 14:06
Git Syntax Check pre-commit Hook
# .git/hooks/pre-commit
git stash -q --keep-index
.git/hooks/syntax.rb
RESULT=$?
git stash pop -q
[ $RESULT -ne 0 ] && exit 1
exit 0
@joshthewhite
joshthewhite / entity_maker.rb
Created May 14, 2012 15:29 — forked from JonTheWhite/entity_maker.rb
Generate Entity Getters/Setters
require 'ruble'
command 'Generate Entity Getter/Setters' do |cmd|
cmd.key_binding = 'M1+M2+G'
cmd.scope = 'source.php'
cmd.output = :replace_document
cmd.input = :document
cmd.invoke do |context|
file = context.TM_SELECTED_FILES.match(/([a-zA-Z0-9]+)\.php/)[1]
line = STDIN.read
columns = line.scan(/@Column\(name="([^"]+)", type="([^"]+)"/)
@joshthewhite
joshthewhite / deploy.rb
Created March 19, 2012 15:49
Capistrano Deploy Script
default_run_options[:pty] = true # Must be set for the password prompt from git to work
set :application, "my-awesome-app"
set :repository, "[email protected]:username/projectname.git"
set :scm, "git"
ssh_options[:forward_agent] = true
set :branch, "master"
set :deploy_via, :remote_cache
@joshthewhite
joshthewhite / jquery.timedbind.js
Created December 5, 2011 19:23
Timed Bind Plugin for JQuery
/**
* Attaches a handler to an event the fires after a given time interval.
*
* Usage:
* $('input[type="text"]').timedBind('keyup', function (e) {
* var $el = $(e.target);
* alert($el.val());
* });
*/
(function($) {