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:
#!/usr/sbin/dtrace -s | |
/* Run like: | |
% sudo csh | |
# ./spy.d $PROCESS_ID [$INTERESTING_PROBEPROV] | |
Prints a line of dashes every 5 seconds to delineate different experiments. | |
*/ | |
#pragma D option quiet |
// | |
// NBResponderChainUtilities.h | |
// | |
// Created by Nicolas @ bou.io on 19/04/13. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIView (NBResponderChainUtilities) | |
- (UIView*) nb_firstResponder; // Recurse into subviews to find one that responds YES to -isFirstResponder |
# (File moved to https://github.com/ole/Storyboard-Strings-Extraction) |
;; 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]))) |
// Copyright (c) 2012-2013 Peter Steinberger (http://petersteinberger.com) | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
The bridge is now located at https://github.com/fjolnir/TLC |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
var match = [] | |
var _finalizeExpr = function(match) { | |
var vs = match[0] | |
var _iter = match[1] | |
var _done = match[2] | |
var i = 0 | |
var _iterWrappper = function() { | |
if(i === vs.length) { |