This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Git related aliases | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
__define_git_completion () { | |
eval " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sound = 'woof'; | |
function bark(s) { | |
if(!s) { | |
return sound; | |
} else { | |
var sound = 'ruff'; | |
return sound + s; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coming in: | |
// | |
// weekday = 40; | |
// d = new Date(2012, 1, 1); | |
// utc = false; | |
// prefer = 1; | |
// callDateMethod with those arguments is equivalent to "d.getDay()" and will return 3; | |
// When the bug occurs, weekday will become 47, where in every other browser it should remain 40 as: | |
// callDateMethod(...) IS 3 AND 40 % 7 IS 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'open-uri' | |
if ARGV.length == 0 | |
puts <<-MESSAGE | |
GitHub Show Script | |
------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:var%20i,s,ss=['https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'];for(i=0;i!=ss.length;i++){s=document.createElement('script');s.src=ss[i];document.body.appendChild(s);}void(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var defineProperty = Object.defineProperty || function(obj, name, desc) { | |
obj[name] = desc.value; | |
}; | |
var getOwnPropertyNames = Object.getOwnPropertyNames || function(obj) { | |
var names = []; | |
for(var key in obj) { | |
if(!obj.hasOwnProperty(key)) continue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
T="$(date +%s)" | |
"$@" | |
T="$(($(date +%s)-T))" | |
#TIME=$(printf "Pretty format: %02d:%02d:%02d:%02d\n" "$((T/86400))" "$((T/3600%24))" "$((T/60%60))" "$((T%60))") | |
TIME=$(printf "%02dh%02dm%02ds\n" "$((T/3600%24))" "$((T/60%60))" "$((T%60))") | |
notify-send "Process Finished" "\"$1\" completed in $TIME." -i $HOME/Dropbox/Icons/emblem-important.svg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
abort "Need path to .zip!" if ARGV[0].nil? | |
abort "Need path to font directory!" if ARGV[1].nil? | |
full_path = ARGV[0] | |
target_path = ARGV[1] | |
filename = full_path.split('/').last.split('.').first | |
filename_no_num = filename.gsub(/\d+$/, '') | |
tmp_dir = File.directory?('tmp') ? 'tmp/' : '/tmp/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
throwAnError = function () { | |
throw new Error('Erroring!'); | |
} | |
window.windowMappedError = throwAnError; | |
try { | |
throwAnError(); | |
} catch(e) { | |
alert('Caught the global error'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var style = document.createElement('style'); | |
style.innerHTML = [ | |
'@-moz-keyframes spin {', | |
'from { -moz-transform: rotate(0deg); }', | |
'to { -moz-transform: rotate(360deg); }', | |
'}', | |
'@-webkit-keyframes spin {', | |
'from { -webkit-transform: rotate(0deg); }', | |
'to { -webkit-transform: rotate(360deg); }', | |
'}', |
OlderNewer