Skip to content
View gist:7d822839a0ea95c8d9b4
# copy text in the shell input. Precede the text with 'copy'
echo "$@" | pbcopy
# hide/show desktop
state=$(defaults read CreateDesktop)
if $state; then
defaults write CreateDesktop false
View gist:460056be4527ef98db74
# update all submodules
git config --global alias.subupdate 'submodule update --init --recursive'
# checkout a branch in each submodule and update it
git config --global alias.subpull = submodule foreach git pull origin production
# show aliases
git config --global alias.alias '!git config -l | grep alias | cut -c 7-'
View gist:bfe457b0eecefaff5d8d
# Hide
defaults write CreateDesktop false && killall Finder
# Show
defaults write CreateDesktop true && killall Finder
View gist:1489bbd1a8e47e86db38
# Run changed javascript files through jshint before commiting and prevent bad
# code from being committed.
# If you need to prevent newly added js from being checked because its in a
# library like bower_components, add a .jshintignore file and list the directory
# INSTALL: Add as a file in your repo as .git/hooks/pre-commit
FILES=$(git diff --cached --name-only --diff-filter=ACM| grep ".js$")
if [ "$FILES" = "" ]; then
exit 0
View gist:5c8867fa72fa4275ae44
@-webkit-keyframes blink {
90% { opacity: 1; }
100% { opacity: 0; }
@-moz-keyframes blink {
90% { opacity: 1; }
100% { opacity: 0; }
@-o-keyframes blink {
  • readability
  • maintainability
  • consistency
  • exception handling
  • simplicity
  • test coverage
  • side effect
  • reuse of existing code
  • performance
View base32decode.js
"use strict";
//Generate dictionary
var arr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'.split(''),
dict = {};
for(var i=0, len=arr.length; i<arr.length; i++){
dict[arr[i]] = i;
View clever.html
<script src=""></script>
window.clever = function(user, pass){
View remote-typeahead.js
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
var autocomplete = $('#searchinput').typeahead()
.on('keyup', function(ev){
View json.js
var parse = JSON.parse;
JSON = {
stringify: JSON.stringify,
validate: function(str){
Something went wrong with that request. Please try again.