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:
| # switching identities in order to use multiple github accounts on one computer, you have to: | |
| # add to ~/.ssh/config according to current github user: | |
| Host github.com | |
| IdentityFile ~/.ssh/<rsa_id_for_current_user> | |
| # set git user globally or locally according to current github user: | |
| git config --local user.name "My Name" |
| # merge all pdf files from a directory to a single pdf file | |
| pdftk *.pdf cat output out.pdf | |
| # reverse page order of a pdf file | |
| PDFTK_PAGES=$(pdftk in.pdf dump_data | grep NumberOfPages | sed "s/^.*: //") | |
| pdftk in.pdf cat $PDFTK_PAGES-1 output out.pdf | |
| # Strip metadata in pdf | |
| PDFTK_FILE=in.pdf | |
| pdftk $PDFTK_FILE dump_data | sed -e 's/\(InfoValue:\)\s.*/\1\ /g' | pdftk $PDFTK_FILE update_info - output out.pdf |
| def rgb2hsl(r,g,b) | |
| r´ = r.to_f / 255 | |
| g´ = g.to_f / 255 | |
| b´ = b.to_f / 255 | |
| c_max = [r´, g´, b´].max | |
| c_min = [r´, g´, b´].min | |
| Δ = c_max - c_min | |
| h = Δ.zero? ? 0 : (60 * case c_max | |
| when r´ then ((g´ - b´) / Δ) % 6 | |
| when g´ then ((b´ - r´) / Δ) + 2 |
| window.cancelRequestAnimFrame = ( function() { | |
| return window.cancelAnimationFrame || | |
| window.webkitCancelRequestAnimationFrame || | |
| window.mozCancelRequestAnimationFrame || | |
| window.oCancelRequestAnimationFrame || | |
| window.msCancelRequestAnimationFrame || | |
| clearTimeout | |
| } )(); | |
| for (var i = 1; i < 99999; i++) { |
| sudo apt-get install build-essential pkg-config libc6-dev libssl-dev libexpat1-dev libavcodec-dev libgl1-mesa-dev libqt4-dev | |
| wget http://www.makemkv.com/download/makemkv-oss-1.9.0.tar.gz | |
| wget http://www.makemkv.com/download/makemkv-bin-1.9.0.tar.gz | |
| tar -xvf makemkv-oss-1.9.0.tar.gz | |
| tar -xvf makemkv-bin-1.9.0.tar.gz | |
| cd makemkv-oss-1.9.0/ | |
| ./configure | |
| make | |
| sudo make install |
| ary = [['a', :hello], ['b', :foo], ['b', :bar], ['b', :baz], ['a', :world]] | |
| # QUIZ: | |
| # How do you sort "ary" so equal objects stay in the same relative order to each other? | |
| # "ary" should be sorted by the first element of each entry. | |
| # Try now: http://tryruby.org/ | |
| expected = [['a', :hello], ['a', :world], ['b', :foo], ['b', :bar], ['b', :baz]] | |
| # HINT: |
| /*jslint browser: true, indent: 2 */ | |
| (function () { | |
| 'use strict'; | |
| var rgb, style, idx = 0, store = {}, tiles = document.getElementById('box').childNodes; | |
| for (idx; idx < tiles.length; idx += 1) { | |
| rgb = tiles[idx].style.backgroundColor.split("(")[1].split(")")[0].split(","); | |
| store[Math.sqrt(Math.pow(rgb[0], 2), Math.pow(rgb[2], 2), Math.pow(rgb[2], 2))] = tiles[idx]; | |
| } | |
| style = Object.keys(store).map(function (key) { return [key, store[key]]; }). | |
| sort(function (a, b) { return parseInt(a[0], 10) < parseInt(b[0], 10) ? 1 : -1; })[0][1].style; |
| xxd -p org.bin | tr -d '\n' > tmp | |
| xxd -p -r tmp > cpy.bin |
| ffmpeg -i in.mts -c:v mpeg4 -qscale:v 5 -acodec libmp3lame -b:a 192k out.mp4 |