brew install logrotate
export PATH=${PATH}:/usr/local/sbin
logrotate -?
;; 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]))) |
require 'test/unit' | |
def score(*frames) | |
score = roll_count = 0 | |
rolls = frames.flatten | |
frames.each do |frame| | |
if sum(frame) == 10 | |
score += sum(next_three(rolls, roll_count)) | |
else | |
score += sum(frame) |
context "with an isolated decorator class" do | |
let(:decorator_class) { Class.new(Decorator) } | |
subject{ decorator_class.new(source) } | |
context "when #hello_world is called again" do | |
it "proxies method directly after first hit" do | |
subject.methods.should_not include(:hello_world) | |
subject.hello_world | |
subject.methods.should include(:hello_world) | |
end |
vagrant box add precise32 http://files.vagrantup.com/precise32.box | |
vagrant init precise32 | |
# update Vagrantfile to port forward: ln 32 => "config.vm.forward_port 80, 8080" | |
vagrant up | |
vagrant ssh |
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 |
# Colors | |
escape = -> n { STDOUT.tty? ? "\033[#{n}m" : "" } | |
red = escape[31] | |
green = escape[32] | |
yellow = escape[33] | |
blue = escape[34] | |
magenta = escape[35] | |
cyan = escape[36] | |
reset = escape[ 0] |
describe "Shopping Cart Requests" do | |
let!(:user) { Fabricate(:user) } | |
before(:each) do | |
login_user_post("admin", "admin") | |
end | |
context "when I visit the shopping cart" do | |
it " show the logged in users' cart items " do | |
#Test stuff |