Skip to content

Instantly share code, notes, and snippets.

View dvrensk's full-sized avatar

David Vrensk dvrensk

View GitHub Profile
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 28, 2025 00:02
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jnicklas
jnicklas / roman.rb
Created November 24, 2011 19:01
This is an implementation of the Roman numeral Kata, inspired by the novel Gadsby by Ernest Vincent Wright. It does not use the letter E.
MAP = [['M', 1000], ['D', 500], ['C', 100], ['L', 50], ['X', 10], ['V',5], ['I',1]]
prv = proc { |i|
t = MAP.map(&:first)
t.zip(t.drop(1)).rassoc(i).first
}
sub = proc { |string|
string.gsub(/(.)?(.)(\2){3}/) { |_|
output = nil
@filipsalo
filipsalo / .bashrc
Created July 14, 2010 21:30
If you ever forget to give grep some filenames and end up waiting while it waits for input, stuff this into your .bashrc.
# Call grep, with stdin closed if it is a terminal.
#
# Avoids the "eternal wait" problem when you've forgotten
# to specify a filename.
function grep { (tty -s && exec <&-; exec $(which grep) "$@"); }