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/bin/env ruby | |
require 'set' | |
# This code is meant to demonstrate the difficulty of actually applying .gitignore semantics manually. It supports a key subset of .gitignore | |
# behaviors, including: | |
# * Anchored and unanchored patterns/globs. | |
# * Un-ignoring of patterns/globs, with the same quirky semantics as git. | |
# * Escaping a leading hash in a pattern. | |
# * User-wide exclusion list. | |
# * Top-of-repo .gitignore. |
body { | |
background-color: #002b36; | |
color: #839496; | |
font-size: 14px; | |
white-space: pre !important; | |
font-family: "Source Code Pro", monospace; | |
} | |
.property { | |
font-weight: bold; |
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 |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Chronological Diagram of Asia</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<style type="text/css"> | |
.chart { | |
shape-rendering: crispEdges; | |
} |
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for
, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add:
################################################################## | |
# ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0] | |
# 10gen: mongo-1.5.2 | |
# bson-1.5.2 (BSON::BSON_C) | |
################################################################## | |
user system total real | |
10gen: insert 10,000 blank documents 0.670000 0.060000 0.730000 ( 0.744400) | |
10gen: insert 10,000 blank documents safe mode 1.200000 0.140000 1.340000 ( 1.800714) | |
10gen: insert 1,000 normal documents 0.090000 0.010000 0.100000 ( 0.091035) |
DO WTF YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Alexey Silin <pinkoblomingo@gmail.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WTF YOU WANT TO PUBLIC LICENSE |
#!/usr/bin/env ruby | |
# | |
# Copyright Keming Labs 2011 | |
# But you can use it under the MIT license. Yay! | |
# See our visualization of these data here: | |
# | |
# http://keminglabs.com/ukuni/ | |
# | |
# This script imports data from UCAS | |
# |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |