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:
#reduce PDF size | |
#-dPDFSETTINGS | |
# /screen | |
# /ebook | |
# /printer | |
# /prepress | |
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -sOutputFile=out.pdf in.pdf |
#! /usr/bin/env bash | |
# brew install imagemagick | |
# brew install jpegoptim | |
mkdir 2048 | |
for image in *.[jJ][pP][eE]?[gG]; do | |
convert $image -resize 2048x2048\> ./2048/$image | |
jpegoptim --strip-all -q --max=80 ./2048/$image | |
done |
# <#Integer>.underscore(n) returns a string, seperating n digits by | |
# an underscore. n is 3 by default. This is supposed to make | |
# working with large numbers easier. | |
# example: | |
# 1000000000000000.underscore #=> "1_000_000_000_000_000" | |
# 100_00000_00_0000_00.underscore #=> "1_000_000_000_000_000" | |
# 987654321.underscore(6) #=> "987_654321" | |
class Integer | |
def underscore(s=3) | |
self.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1_") |
# Skip forward/back a word with opt-arrow | |
# https://gist.github.com/knugie/fc9964695951b4c13ed3 | |
bindkey -e | |
bindkey '\e\e[C' forward-word | |
bindkey '\e\e[D' backward-word |
ffmpeg -i movie.mov -vcodec copy -acodec copy out.mp4 |
window.cancelRequestAnimFrame = ( function() { | |
return window.cancelAnimationFrame || | |
window.webkitCancelRequestAnimationFrame || | |
window.mozCancelRequestAnimationFrame || | |
window.oCancelRequestAnimationFrame || | |
window.msCancelRequestAnimationFrame || | |
clearTimeout | |
} )(); | |
for (var i = 1; i < 99999; i++) { |
xxd -p org.bin | tr -d '\n' > tmp | |
xxd -p -r tmp > cpy.bin |
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
require 'benchmark' | |
require 'open3' | |
require 'histogram/array' | |
array = Array.new(10_000_000) { rand(60) } | |
puts 'uniq, count:' | |
uniq_count = Benchmark.measure do | |
array.uniq.map { |key| array.count(key) } | |
end |