Skip to content

Instantly share code, notes, and snippets.

View mythmon's full-sized avatar

Michael Cooper mythmon

View GitHub Profile
@mythmon
mythmon / git-url
Last active December 15, 2015 03:59 — forked from rlr/git-url
I don't use a mac, and I don't have ack, and I didn't like some other things. I made it better.
#!/bin/sh
# Usage: `git url` or `git url <commitish>`
#
# * copies the commit's github url to your clipboard
# * prints out the log message
# * opens the bugzilla page if it found a bug number
#
# Assumes that the canonical remote is named upstream.
# Works on Linux
@mythmon
mythmon / callback.js
Last active August 29, 2015 14:00 — forked from nobane/callback.js
function display_obj(obj, category) {
var url = "/" + category + "/" + obj.val();
return new Promise(function(resolve, reject) {
$.get(url, function(resp) {
var rows = "";
for (var key in resp) {
console.log("Generating pairs[" + key + "]: " + resp[key]);
rows += generate_row(key, resp[key]);
}
@mythmon
mythmon / README.md
Last active August 29, 2015 14:03 — forked from willkg/README.md
Test of using input.mozilla.org and d3 and bl.ocks.org

This gist goes through the motions to see if I can get a basic block working with gists and all that.

@mythmon
mythmon / playground.rs
Last active August 29, 2015 14:26 — forked from anonymous/playground.rs
Shared via Rust Playground
fn main() {
type One = Succ<Zero>;
type Two = Succ<One>;
type Three = Succ<Two>;
type Five = <Two as Add<Three>>::Result;
type Four = <One as Sub<Five>>::Result;
println!("Zero: {}", Zero::fmt());
println!("One: {}", One::fmt());
println!("Two: {}", Two::fmt());
@mythmon
mythmon / are_two_JSON_objects_the_same.py
Last active November 5, 2019 21:34 — forked from biancadanforth/are_two_JSON_objects_the_same.py
Check if two JSON objects are the same by first ordering them
import json, os
# Put filenames here; this script assumes these files are in the same dir as the script
FILENAME_1 = "2.json"
FILENAME_2 = "3.json"
def ordered(obj):
if isinstance(obj, dict):
return sorted((k, ordered(v)) for k, v in obj.items())