Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Force e0da

View GitHub Profile
View autoreload.js
(function () {
var script=document.createElement('script');
script.src='http://code.jquery.com/jquery-1.11.1.min.js';
script.onload = function () {
setInterval(function () {
jQuery('body').load(location.href, 'body');
}, 60000);
};
document.body.appendChild(script);
}());
View terminal_color_scheme
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Solarized theme for pantheon-terminal
see http://ethanschoonover.com/solarized
"""
import posixpath
import sys
from gi.repository import Gio
View kill_Terminal.sh
function kill_Terminal() {
osascript -e "
try -- I don't care if everything fails
try -- So we can ignore when the timeout fails
with timeout of 0.1 seconds -- So we don't block on the modal
tell application \"Terminal\" to quit
end timeout
end try
tell application \"System Events\" to click UI element \"Close\" of sheet 1 of window 1 of application process \"Terminal\"
View cookie_clicker_autopilot.js
@e0da
e0da / fast-rm.sh
Last active Aug 29, 2015
rsync-ing an empty directory is waaayyyy faster than rm or find -exec or find -delete
View fast-rm.sh
#!/bin/sh
readonly empty_dir=$(mktemp -d)
readonly target="$1"
rm -rf $empty_dir
mkdir $empty_dir
rsync --recursive --delete $empty_dir/ "$target"/
rmdir $empty_dir "$target"
@e0da
e0da / README.md
Last active Aug 29, 2015
Audio notification of success or failure after a command finishes. Useful for long-running commands.
View README.md

ding

Audio notification of success or failure after a command finishes. Useful for long-running commands.

Usage

ding rake db:migrate
View lctl.sh
#!/bin/sh
# Example usage:
# lctl stop mysql
# lctl start solr
# lctl restart rabbitmq
# lctl rabbitmq <- no action argument is equivalent to a restart argument
set -ex
View delete_merged_branches.sh
#!/bin/sh
# Attempt to delete every branch except master and the currently checked out
# branch. If the branch isn't merged, it won't delete, and it will be noted on
# STDERR.
git branch | grep -v '\bmaster\b\|^\*' | while read branch; do
git branch -d $branch
done
View fast-rm
#!/bin/sh
readonly empty_dir=$(mktemp -d)
readonly target="$1"
rm -rf "$empty_dir"
mkdir "$empty_dir"
rsync --recursive --delete "$empty_dir"/ "$target"/
rmdir "$empty_dir" "$target"
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

You can’t perform that action at this time.