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:
| // @license http://opensource.org/licenses/MIT | |
| // copyright Paul Irish 2015 | |
| // Date.now() is supported everywhere except IE8. For IE8 we use the Date.now polyfill | |
| // github.com/Financial-Times/polyfill-service/blob/master/polyfills/Date.now/polyfill.js | |
| // as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values | |
| // if you want values similar to what you'd get with real perf.now, place this towards the head of the page | |
| // but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed |
| class ReloaderEventHandler(FileSystemEventHandler): | |
| """ | |
| Listen for changes to modules within the Django project | |
| On change, reload the module in the Python Shell | |
| Custom logic required to reload django models.py modules | |
| Due to the singleton AppCache, which caches model references. | |
| For those models files, we must clear and repopulate the AppCache | |
| """ | |
| def __init__(self, *args, **kwargs): |
| var runOnce = require('uvrun').runOnce; | |
| // Do something here, like make a server to keep the event loop busy | |
| var TCP = process.binding('tcp_wrap').TCP; | |
| var server = new TCP(); | |
| server.onconnection = function () { | |
| console.log("connection!"); | |
| }; | |
| server.bind("0.0.0.0", 3000); | |
| server.listen(511); |
| (defun browser-repl () | |
| (interactive) | |
| (run-lisp "/usr/local/bin/lein trampoline cljsbuild repl-listen")) | |
| (defun repljs () | |
| (interactive) | |
| (run-lisp "~/Dropbox/development/clojure/clojurescript/script/repljs")) |
| """ | |
| Two things are wrong with Django's default `SECRET_KEY` system: | |
| 1. It is not random but pseudo-random | |
| 2. It saves and displays the SECRET_KEY in `settings.py` | |
| This snippet | |
| 1. uses `SystemRandom()` instead to generate a random key | |
| 2. saves a local `secret.txt` |
| library(inline) | |
| inc <- ' | |
| /* This is taken from envir.c in the R 2.15.1 source | |
| https://github.com/SurajGupta/r-source/blob/master/src/main/envir.c | |
| */ | |
| #define FRAME_LOCK_MASK (1<<14) | |
| #define FRAME_IS_LOCKED(e) (ENVFLAGS(e) & FRAME_LOCK_MASK) | |
| #define UNLOCK_FRAME(e) SET_ENVFLAGS(e, ENVFLAGS(e) & (~ FRAME_LOCK_MASK)) | |
| ' |
| AA = Rickard Stark (M) AB = Eddard Stark (M) AC = Catelyn Tully (F) | |
| AD = Brandon Stark (M) AE = Benjen Stark (M) AF = Jon Snow (M) | |
| AG = Robb Stark (M) AH = Sansa Stark (F) AI = Arya Stark (F) | |
| AJ = Bran Stark (M) AK = Rickon Stark (M) AL = Hoster Tully (M) | |
| AM = Minisa Whent (F) AN = Edmure Tully (M) AO = Lysa Tully (F) | |
| AP = Jon Arryn (M) AQ = Robert Arryn (M) AR = Tytos Lannister (M) | |
| AS = Tywin Lannister (M) AT = Joanna Lannister (F) AU = Kevan Lannister (M) | |
| AV = Cersei Lannister (F) AW = Jamie Lannister (M) AX = Tyrion Lannister (M) | |
| AY = Robert Baratheon (M) AZ = Joffrey Baratheon (M) BA = Myrcella Baratheon (F) | |
| BB = Tommen Baratheon (M) BC = Lancel Lannister (M) BD = Steffon Baratheon (M) |
| ;; based on core.logic 0.8-alpha2 or core.logic master branch | |
| (ns sudoku | |
| (:refer-clojure :exclude [==]) | |
| (:use clojure.core.logic)) | |
| (defn get-square [rows x y] | |
| (for [x (range x (+ x 3)) | |
| y (range y (+ y 3))] | |
| (get-in rows [x y]))) |