Skip to content

Instantly share code, notes, and snippets.

View zeke's full-sized avatar
🍊
Busy! @-message me directly if I'm slow to respond.

Zeke Sikelianos zeke

🍊
Busy! @-message me directly if I'm slow to respond.
View GitHub Profile
@zeke
zeke / gifify.sh
Created February 7, 2013 20:52 — forked from jclem/gifify.sh
if [ "$#" -lt 1 ]; then
echo 'Must supply an input file'
exit 1
else
if [ "$#" -lt 2 ]; then
output=output
else
output=$2
fi
@zeke
zeke / GIF-Screencast-OSX.md
Created November 8, 2015 01:43 — forked from dergachev/GIF-Screencast-OSX.md
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:

@zeke
zeke / a.rb
Created October 30, 2012 20:14 — forked from will/a.rb
cheat at letterpress
@words = IO.foreach('letterpresswords').map{|l| l.chomp}; nil
def go(boardstr, bonus1str='', bonus2str='', max=4)
board = boardstr.split(//)
bonus1 = bonus1str.split(//)
bonus2 = bonus2str.split(//)
boardfq = board.inject(Hash.new{0}) {|h, l| h[l]+=1;h}
@words
.select{|w| w.size > max && w.split(//).inject(Hash.new{0}) {|h, l| h[l]+=1;h}.all?{|(l,c)| boardfq[l] >= c}}
@zeke
zeke / make_touch_this.js
Created September 11, 2012 01:25
mc hammer javascript cross-compiler
#!/usr/bin/env node
// mc hammer javascript cross-compiler
// 1. youtube-dl http://www.youtube.com/watch?v=otCpCn0l4Wo -o cant_touch_this.flv
// 2. avconf -o cant_touch_this.flv cant_touch_this.wav
// 3. sox cant_touch_this.wav -t s16 -r 8k -o cant_touch_this.raw
// 4. run this file (node make_touch_this.js)
// 5. npm install -g baudio-party
// 6. baudio-party &
// 7. curl -sSNT cant_touch_this.js http://localhost:5000/0
@zeke
zeke / mystery solved.md
Created June 27, 2012 20:30 — forked from will/mystery solved.md
How to embed a Dataclip into a Gist
@zeke
zeke / 0_silent_selector_grid.scss
Created May 16, 2012 06:42 — forked from chriseppstein/0_silent_selector_grid.scss
This gist describes a new feature we're experimenting with for Sass 3.2: placeholder selectors. They do not get generated into your output, but they can be used like a class and extended like one.
$gutter: 10px;
$grid-unit: 60px;
%clearfix {
*zoom: 1;
&:after {
content: "\0020";
display: block;
height: 0;
clear: both;
@zeke
zeke / foo.rb
Created February 10, 2012 22:17 — forked from wolfklinker/foo.rb
class Dingo
def self.bark
"woof"
end
def self.eat
"A dingo ate my baby!"
end
@zeke
zeke / split_random.rb
Created January 24, 2012 23:13 — forked from willf/split_random.rb
Another version of split random
class Array
# split array into groups up to n items, randomly choosing the size.
def split_random(n)
size == 0 ? self : (size == 1 ? [self] : self[1..-1].reduce([[self[0]]]){|ll, elt| (rand(n)==(n-1) || ll[-1].size==n) ? ll + [[elt]] : ll[0..-2] + [ll[-1] +[elt]]})
end
end
@zeke
zeke / split_random.rb
Created January 23, 2012 21:14 — forked from willf/split_random.rb
Split into random slices from an array in Ruby
class Array
def split_random(n)
def td(n)
[take(n),drop(n)]
end
def split_random_acc(n,l, acc)
head,tail = l.td(rand(n)+1)
return (acc + [head]) if tail==[]
split_random_acc(n, tail, acc + [head])
@zeke
zeke / inject_vs_readability.rb
Created January 13, 2012 07:56 — forked from bbwharris/inject_vs_readability.rb
Inject vs. Readability
# There is more than one way to skin a cat, different coders prefer different methods.
include ActionView::Helpers
class Link < Struct.new(:title, :url); end
a = Link.new("Google", "http://www.google.com")
b = Link.new("Hacker News", "http://news.ycombinator.com")
array_of_links = [a, b]