Skip to content

Instantly share code, notes, and snippets.

View e0da's full-sized avatar

Justin Force e0da

View GitHub Profile
@e0da
e0da / xterm-256color-italic.terminfo
Created May 9, 2018 18:35 — forked from sos4nt/xterm-256color-italic.terminfo
A xterm-256color based TERMINFO that adds the escape sequences for italic
# A xterm-256color based TERMINFO that adds the escape sequences for italic.
#
# Install:
#
# tic xterm-256color-italic.terminfo
#
# Usage:
#
# export TERM=xterm-256color-italic
#
@e0da
e0da / simcity_2000_mouse_scroll_bindings.ahk
Last active July 12, 2021 06:11
Use the vertical scrolling for zoom and horizontal scrolling for rotation when playing SimCity 2000 (SIMCITY.EXE)
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; https://gist.github.com/e0da/40d551e1302738d931d0c61c163acb22
#IfWinActive ahk_exe SIMCITY.EXE
WheelUp::Send {Home}
WheelDown::Send {End}
@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;
}
// ==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 / 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
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 / 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.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

#!/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"
#!/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