Skip to content

Instantly share code, notes, and snippets.

View e0da's full-sized avatar

Justin Force e0da

View GitHub Profile
@e0da
e0da / README.md
Last active August 29, 2015 14:07
Audio notification of success or failure after a command finishes. Useful for long-running commands.

ding

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

Usage

ding rake db:migrate
@e0da
e0da / lctl.sh
Last active August 29, 2015 14:09
#!/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
#!/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
#!/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"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@e0da
e0da / Fireworks!.markdown
Last active August 29, 2015 14:26
Fireworks!

Fireworks!

You can click and drag then release to fling them, or press F for a fireworks show. Pressing any key will detonate all currently visible fireworks. There's a commented bit that activates the game when the Konami code is entered on the keyboard.

A Pen by Justin Force on CodePen.

License.

require 'benchmark/ips'
STRINGS = %w[
There's no beginning to this story. A bookshelf sinks into the sand. And a
language learned, a forgotten term, is studied once again. It's a shocking
bit of footage viewed from a shitty TV screen. Just squint at it, just snowy
static to make out the meaning. And keep on stretching the antenna hoping that
it will come clear. We need some reception, a higher message. Just tell us
what to fear 'cause I don't know what tomorrow brings. It's alive with such
possibility. All I know is I feel better when I sing.
@e0da
e0da / ascii_only.rb
Created January 29, 2016 00:58
Report non-ASCII characters in a file
#!/usr/bin/env ruby
# x starts at 0 because we increment x BEFORE checking the character.
# y starts at 1 because we only increment it when we hit a newline.
x, y = 0, 1
puts 'Positions are 1-indexed, NOT 0-indexed.'
puts 'i.e. The first character in the file is at position 1:1'
puts
// ==UserScript==
// @name Hide Hangouts in Inbox
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Justin Force
// @match https://inbox.google.com/*
// @grant none
// ==/UserScript==
@e0da
e0da / iptorrents.css
Last active August 7, 2017 03:25
Custom styles for IPTorrents
/* https://gist.github.com/justinforce/4b15ff14b225f5b4d500be4ee49a8757 */
#iptStart .topRow {
padding-bottom: 0 !important;
}
#iptStart .banner {
background-image: none !important;
height: 57px !important;
}