$ mkdir -p ~/Library/Application\ Support/TextMate/Bundles
$ cd !$
$ svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
$ osascript -e 'tell app "TextMate" to reload bundles'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The project root directory | |
$root = ::File.dirname(__FILE__) | |
# Common Rack Middleware | |
use Rack::ShowStatus # Nice looking 404s and other messages | |
use Rack::ShowExceptions # Nice looking errors | |
# | |
# From Rack::DirectoryIndex: | |
# https://github.com/craigmarksmith/rack-directory-index/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Credentialing for MySQL server if you want the code to create table and load data automatically | |
$host = "localhost"; | |
$user = "user"; | |
$password = "password"; | |
$base = "database"; | |
$connection = mysql_connect($host,$user,$password) or die (mysql_error()); | |
mysql_select_db($base,$connection); | |
// $id is the unique identifier for the Socrata data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# Brett Terpstra 2013, WTF license <http://www.wtfpl.net/txt/copying/> | |
# Outputs a vertical bar chart from date-based JSON data | |
# Requires the JSON rubygem: `[sudo] gem install json` | |
require 'date' | |
require 'open-uri' | |
require 'rubygems' | |
require 'json' |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns on recent CPU
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 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory