This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
require 'pathname' | |
require 'fileutils' | |
Pathname.glob("content/articles/**/index.txt").entries.each do |path| | |
new_filename = path.to_s.split('/')[2..5].join('-') | |
new_filename = "#{new_filename}.html.markdown" | |
FileUtils.cp(path, new_filename) | |
end |
class NullObject < BasicObject | |
def method_missing(*) | |
self | |
end | |
def respond_to_missing?(name) | |
true | |
end | |
end |
Purchase = Struct.new(:description, :price) | |
DATA = [ | |
Purchase.new("Walkman", "1.25"), | |
Purchase.new("Mini-disc player", "2.57"), | |
Purchase.new("Record player", "3.54") | |
] | |
require 'logger' |
class User | |
def name | |
# ...from the database | |
"Fred" | |
end | |
def self.find(user_id) | |
user_id == 123 ? self.new : nil | |
end | |
end |
Google Analytics has Website Optimiser now built in
class Foo | |
def bar(arg) | |
arg.call | |
end | |
end | |
class X | |
def call | |
"Normal class" | |
end |