Skip to content

Instantly share code, notes, and snippets.

@matthewfranglen
matthewfranglen / Git Reverse
Last active December 2, 2015 20:58
Reverse time with this script!
#!/bin/bash
function main () {
local original_hash=$(get_current_commit_hash)
go_to_project_root || exit 1
create_new_branch || exit 1
commit_with_copied_metadata ${original_hash} || exit 1
for commit_hash in $(list_commit_hashes ${original_hash} | delete_last_line)
@matthewfranglen
matthewfranglen / gist:a41b7b1248e3dabd41d8
Created May 13, 2015 18:37
Remove slack-redir.net from slack links
javascript:void($('a[href][onmouseover][onmousedown]').each(function(){$(this).removeAttr('onmouseover').removeAttr('onmousedown');href=$(this).attr('href');$(this).attr('href',decodeURIComponent(href.replace('https://slack-redir.net/link?url=','')));}))
@matthewfranglen
matthewfranglen / gist:b840e509ab6f60114e86
Created April 17, 2015 19:56
Why Vim is the best text editor
The core idea of Vim is the very essence of the Unix Philosophy:
> Even though the UNIX system introduces a number of innovative programs and
> techniques, no single program or idea makes it work well. Instead, what makes
> it effective is the approach to programming, a philosophy of using the
> computer. Although that philosophy can't be written down in a single sentence,
> at its heart is the idea that the power of a system comes more from the
> relationships among programs than from the programs themselves. Many UNIX
> programs do quite trivial things in isolation, but, combined with other
> programs, become general and useful tools.
@matthewfranglen
matthewfranglen / gist:64e417598355f811d900
Created January 15, 2015 14:15
Example use of Trie to find substring matches
#!/usr/bin/env python
# pylint: disable=C0111, R0903
class Trie(object):
def __init__(self):
self.children = {}
def add_child(self, letter):
if letter in self.children:
@matthewfranglen
matthewfranglen / gist:5a743f956c05978916c1
Created July 18, 2014 19:20
Imgur images without cookies
$('img').each(function (i, e) { $(e).attr("src", $(e).attr("data-src")); });