Skip to content

Instantly share code, notes, and snippets.

View wtn's full-sized avatar

William T. Nelson wtn

  • United States
View GitHub Profile

Install OS X 10.10 Yosemite in VirtualBox

(based on this pastebin i've found via Google, markdownified and adjusted to work with the official Yosemite release)

Yosemite's first developer preview was released right after Monday's WWDC opening keynote. For the general public, an open beta will be available to download later this summer. However, for those who want a sneak peek at the new hotness, there is a way to safely install it without risking your machine, using the free and powerful VirtualBox application from Oracle.

(LEGAL DISCLAIMER: This guide aims to explain how to create a virtual machine on a regularly purchased Apple computer, running a genuine Mac OS X operating system, for testing purposes only.)

require 'openssl'
require 'Base64'
key = "secret-key"
data = "some data to be signed"
Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), key, data)).strip()
/*
* Copyright (C) 2006, 2008 Valery Kholodkov
* Client body reception code Copyright (c) 2002-2007 Igor Sysoev
* Temporary file name generation code Copyright (c) 2002-2007 Igor Sysoev
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#include <nginx.h>
@wtn
wtn / inject_benchmark.rb
Created April 5, 2011 22:01
compare Array#inject({}) to Array#map and Hash[]
ATTRIBUTES = %w{aa bb cc dd ee ff gg}
ITERATION_COUNT = 100_000
DELTA_CHAR = "\u0394"
def self.hash_inject_time_elapsed
start_time = Time.now
ITERATION_COUNT.times do
ATTRIBUTES.inject({}) {|h,s| h[s] = s.length; h }
end
Time.now - start_time
@wtn
wtn / array_mod_benchmark.rb
Created April 5, 2011 20:33
modify array with << and delete instead of + and -
ATTRIBUTES = %w{a b c d e f g h i j _id}
t0 = Time.now
100_000.times do
ATTRIBUTES.dup.map { |k| k.to_s } + ['id'] - ['_id']
end
map_time = Time.now - t0
@@hydra ||= Typhoeus::Hydra.new( max_concurrency: 100 )
def batch_download(pages)
fibers = pages.map(&:uncached_download_fiber).compact
requests = fibers.map(&:resume)
requests.each {|req| @@hydra.queue req }
@@hydra.run
requests.map.with_index {|req,i| fibers[i].resume(req.response) }
end
Oakland Raiders assistant Hanson says Cable could have killed him
Oakland Tribune staff and wire report
Posted: 10/11/2009 02:59:20 AM PDT
Updated: 10/11/2009 04:17:28 AM PDT
Deposed Oakland Raiders assistant coach Randy Hanson told Yahoo! Sports he could have been killed when an alleged attack by head coach Tom Cable during training camp left him with a broken jaw, two cracked teeth, a bruised knee and a bruised back.
Hanson, in his first public comments since the Aug. 5 incident, detailed what happened during a meeting with Cable at the Marriott-Napa Valley.