Skip to content

Instantly share code, notes, and snippets.

@jccovey
jccovey / git-aliases.sh
Created September 28, 2012 19:54
Git aliases
# Show files with conflicting changes
git config --global alias.conflicts '!git ls-files -u | cut -f 2 | sort -u'
@jccovey
jccovey / index.html
Last active December 10, 2015 09:59
Top bar for F2K layout?
<div class="grad"></div>
function json($data)
{
$this->output->set_header('Content-type:application/json');
$this->output->set_output(json_encode($data));
}
function separateWords(stringVal) /* returns string */ {
return stringVal.split(/(?=[A-Z])/).join(' ');
}
@jccovey
jccovey / Bookmarklets.js
Created February 2, 2017 06:51
General purpose JavaScript snippets that fit in 2048 characters or less.
// Arrow key nav for videos
// - Left: -5s
// - Right: +5s
// - Up: +30s
// - Down: -30s
javascript:var timeAdj = {'37': -5, '39': 5, '38': 30, '40': -30 }; document.addEventListener("keyup", function(e) { if (e.which > 36 || e.which < 41) { e.preventDefault(); document.querySelectorAll("video").forEach(function(vid) { vid.currentTime += timeAdj[e.which]; vid.play();});}});