Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am kmorey on github.
* I am kmorey (https://keybase.io/kmorey) on keybase.
* I have a public key whose fingerprint is 9800 D043 5B00 3D1A 24A3 8A93 C945 C28F D5BE 0622
To claim this, I am signing this object:
@kmorey
kmorey / bf.py
Created January 31, 2016 23:37
Battlefront Stats Dumper
# using network monitor on the battlefront stats page and grab the response of
# https://api.battlefront.dice.se/jsonrpc/whiteshark/pc/api?UserStats.getUserStats
# for the user you want and paste it to a json file
# Usage: python bf.py <stats.json>
import json
import sys
filename = sys.argv[1]
var real_docwrite = document.write,
body = $('body');
(function insertGists(a_tags) {
if (a_tags.length > 0) {
a_tag = a_tags.shift()
document.write = function(stylesheet) {
$('head').append(stylesheet);
# -*- coding: utf-8 -*-
from datetime import datetime
import time
import sublime_plugin
class TimestampCommand(sublime_plugin.EventListener):
"""Expand `isoD`, `now`, `datetime`, `utcnow`, `utcdatetime`,
`date` and `time`
@kmorey
kmorey / Default (OSX).sublime-keymap
Last active August 29, 2015 13:57
Goto Find Results
[
{
"keys": [
"enter"
],
"command": "find_in_files_goto",
"context": [
{
"key": "selector",
"operator": "equal",
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.13 (Darwin)
Comment: GPGTools - http://gpgtools.org
mQENBE3HZzEBCADGc/haz+UJZjNSjW266m5zwdcYchfY6IfL9SE1oOIdOgF8Uz8q
sQV40pwYIhF4BpTPWPjvX8ogxRLvPbDjQPnQtso/dtkm7ecAO1xlyHBPGDstfQpO
bqbxb1eq9YFiWolcX2QS6bVajHS9cjFvr9zo0AY5T4WWSurBGXW9hGZNVkZXWDnl
/FqgNVrsaxqU7T6t3H0DotRoZgWxQP4r05OH+yRJlqM4XN92beoUXFUOBlbaelTv
7Z7wv8bxNgX6oT/q2ukRC2C2yrPgp41VsmNqvKcpMpQZSfuKRBW+aKDBWMsJIxRp
63CcXKV480D6FdTrg04HOS7RJbxyrygr9zfZABEBAAG0I0tldmluIE1vcmV5IDxr
# TODO: Explain what some of this does..
bindkey -e
bindkey '\ew' kill-region
bindkey -s '\el' "ls\n"
bindkey '^r' history-incremental-search-backward
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
# make search up and down work, so partially type and hit up/down to find relevant stuff
:command! -complete=customlist,ListTypes -nargs=1 LP !playbook/playbook.sh <args>
:fun! ListTypes(A,L,P)
python << endpython
import vim
arg = vim.eval("a:A")
result = [x for x in ["debug", "release"] if x.startswith(arg)]
vim.command("return " + str(result))
endpython
:endfun
@kmorey
kmorey / nba_score.js
Last active October 5, 2015 06:48
Update NBA title with score
function update_title() {
var score = [];
jQuery('.jumbo_digit').each(function() {
score.push(this.className.replace(/\s*jumbo_digit\s*/g, '').replace(/none|digit/g, ''));
});
var qtr = jQuery("#quarter_indicator").text();
var time = jQuery("#time_indicator").text();
document.title=score.slice(0, 3).reverse().join('') + '-' + score.slice(3, 6).reverse().join('') +
' ' + qtr + ' (' + time + ')';
update table_name set field_name = replace(field_name, '\\/', '/') where field_name ~ '\\\/';