Skip to content

Instantly share code, notes, and snippets.

View madbook's full-sized avatar

Matthew Lee madbook

  • Missouri, USA
  • 11:32 (UTC -05:00)
  • LinkedIn in/mdleemd
View GitHub Profile
@madbook
madbook / new-markdown.css
Created November 25, 2014 01:18
old and new markdown styles
.md
{
max-width:60em
}
.md .-headers,
.md h1,
.md h2,
.md h3,
.md h4,
@madbook
madbook / snippet.js
Created December 17, 2014 19:52
clean up github notifications page
$('.octicon-issue-closed, .octicon.type-icon-state-closed, .octicon-git-pull-request.type-icon-state-merged').parent().parent().find('button.delete-note').click();
@madbook
madbook / hack.js
Created May 26, 2015 20:38
js multiline string function hack
function _multiline(fnc) {
return fnc.toString().replace(/^function *\(\) *\{ *\/\* */, '').replace(/ *\*\/ *\} *$/, '');
}
// example
var template = _multiline(function(){/*
<div id="some_id">
<h1>Multiline strings without all the bullshit</h1>
<p>This is a pretty terrible hack, probably don't actually do this ever.</p>
@madbook
madbook / keybase.md
Created February 6, 2016 04:40
keybase.md

Keybase proof

I hereby claim:

  • I am madbook on github.
  • I am madlee (https://keybase.io/madlee) on keybase.
  • I have a public key ASAgcSuEBTjxAx8TdD68uTgzgvvWpM3KkXM6uUEHTgTBTQo

To claim this, I am signing this object:

@madbook
madbook / test-live-comments.py
Created November 11, 2016 21:11
test-live-comments.py
import random
import time
from r2.lib import websockets
def spew_comments_on_link(link_id36, num_comments=10, delay=.1, start_at_id=1):
"""
Generate a series of fake websocket messages to test live comments
link_id36: id36 of a link, used to namespace the websocket messages
num_comments: how many comments to broadcast