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:
tim@touchsmart:~/Code$ nvm use v0.11.2-generators | |
Now using node v0.11.2-generators | |
tim@touchsmart:~/Code$ node --harmony testgen.js | |
<Buffer 76 61 72 20 66 73 20 3d 20 72 65 71 75 69 72 65 28 27 66 73 27 29 3b 0a 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 46 69 6c 65 28 70 61 74 68 2c 20 65 6e 63 ...> | |
Sleeping for 2000ms... | |
Done |
from M2Crypto import SSL | |
from M2Crypto.SSL.Checker import SSLVerificationError, NoCertificate, WrongCertificate, WrongHost | |
import socket, re | |
from datetime import datetime | |
import pytz | |
class ValidationResults: | |
def __init__(self): | |
self.connection_error = False |
// Rewrite http://tour.golang.org/#63 to scala using Channel | |
import scala.concurrent._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object GO63Channel extends App { | |
def sum(a: List[Int], c: Channel[Int]) = future { | |
c write a.sum | |
} | |
val c = new Channel[Int]() |
import square.SquareRoot; | |
import java.math.BigInteger; | |
public class FindRoot { | |
private static final int TIMING_LOOP_COUNT = 10; | |
public static void main(String[] args) { | |
// max and min bound the square-root of n: min < sqrt(n) <= max | |
// maxN and minN bound the square, n (i.e. SquareRoot.n): minN < n <= maxN |
(function(Backbone, _) { | |
var leave, leaveArgs; | |
_.extend(Backbone.Router.prototype, Backbone.Events, { | |
route : function(route, name, callback) { | |
if(!callback) | |
callback = this[name]; | |
var before | |
, fn = callback |
<!DOCTYPE html> | |
<!-- By Jan Wrobel. See it working at: | |
http://mixedbit.org/blog/2013/02/10/random_walk_illustrated_with_d3.html | |
--> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Random walk</title> |
// simple example of the cake pattern | |
// abstract DAO trait | |
trait Repository[A, B]{ | |
// saves an entity, returns an ID | |
def save(entity: A): B | |
// more features.. | |
} | |
trait RdbmsRepository extends Repository[MyUserCaseClass, Long]{ |
package pivot | |
class Pivot(val rows: List[List[String]]) { | |
val headers = rows.head.zipWithIndex.map(_.swap) | |
val body = rows.tail | |
def addCalcCol(f: List[String] => String)(newColName: String) : Pivot = { | |
val newRows = (headers.map(_._2) :+ newColName) +: | |
body.map(row => { row :+ f(row)}) |