Skip to content

Instantly share code, notes, and snippets.

View endtwist's full-sized avatar

Joshua Gross endtwist

View GitHub Profile
#!/bin/bash
# allows you to send pull requests from the command line
# usage: git req username [comparetobranch]
# or: git req username -m 'message'
# put somewhere in your PATH as git-req and make executable
usage()
{
cat << EOF
usage: $0 options
@endtwist
endtwist / -letter.js
Created September 15, 2011 02:56
-letter.js 0.1
/*global jQuery */
/*!
* -letter.js
* Version: 0.1
* Copyright (c) 2011 Joshua Gross
* MIT license
*
* Usage:
* Include this file anywhere in your HTML
* <script src="-letter.js"></script>
@endtwist
endtwist / Compass Watch
Created October 4, 2011 23:10 — forked from techyak/Compass Watch
the alias that I'm using to watch node.js/coffeescript/compass at the same time
function nodewatch() {
find . | grep coffee$ | xargs coffee -cwl &
if [ $1 ]
then
nodemon $1.js &
else
nodemon app.js &
fi
@endtwist
endtwist / gist:1292731
Created October 17, 2011 14:36 — forked from tvandervossen/gist:1231476
Mobile Safari viewport sizes on iOS 4.3 and 5
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3
@endtwist
endtwist / .gitconfig
Created November 4, 2011 20:05
.gitconfig
[user]
name =
email =
[core]
editor = /usr/bin/nano
excludesfile = /Users/username/.gitignore
[merge]
conflictstyle = diff3
[color]
branch = auto
@endtwist
endtwist / .bashrc
Created November 4, 2011 20:07
Bash config
PS1="\[\e[0:32m\]\w \[\e[0;39m\]\$ "
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
PS1="\[\e[0:32m\]\w"'$(__git_ps1 " \[\e[1;30m\](%s)")'"\[\e[0;39m\]\$ "
fi
export CLICOLOR=1
export ll='ls -al'
@endtwist
endtwist / lazy.js
Created November 17, 2011 19:22
Javascript asset lazy loading
/**
* Lazy load assets, call callback fn after all assets have loaded.
*
* Requires: jQuery or Zepto
*
* Usage:
* Lazy.load({"js": ["js/file.js"],
* "tpl": [{"src": "tpl/event.tpl", "id": "event-view"}],
* "css": ["css/file.css"]
* });
#!/bin/bash
# <UDF name="ssh_key" Label="Paste in your public SSH key" default="" example="" optional="false" />
# root ssh keys
mkdir /root/.ssh
echo $SSH_KEY >> /root/.ssh/authorized_keys
chmod 0700 /root/.ssh
# update to latest
@endtwist
endtwist / gist:1630834
Created January 18, 2012 03:57
Paste event in Google Chrome
$( 'body' ).bind( 'paste', function( evt ) {
var items = evt.originalEvent.clipboardData.items
, paste;
// Items have a "kind" (string, file) and a MIME type
console.log( 'First item "kind":', items[0].kind );
console.log( 'First item MIME type:', items[0].type );
// If a user pastes image data, there are 2 items: the file name (at index 0) and the file (at index 1)
// but if the user pastes plain text or HTML, index 0 is the data with markup and index 1 is the plain, unadorned text.
@endtwist
endtwist / firefox_paste.html
Created January 18, 2012 04:04
Paste event in Firefox
<textarea id="pasteField"></textarea>