Skip to content

Instantly share code, notes, and snippets.

View wenzowski's full-sized avatar

Alec Wenzowski wenzowski

View GitHub Profile
require 'rubygems'
require 'spork'
require 'simplecov'
SimpleCov.start 'rails'
Spork.prefork do
require "rails/application"
# Prevent Devise from loading the User model super early with it's route hacks for Rails 3.1
# see also: https://github.com/timcharper/spork/wiki/Spork.trap_method-Jujutsu
This file has been truncated, but you can view the full file.
export FOG_MOCK=true && bundle exec shindont +aws
export FOG_MOCK=true && bundle exec shindont +bluebox
export FOG_MOCK=true && bundle exec shindont +brightbox
export FOG_MOCK=true && bundle exec shindont +dnsimple
export FOG_MOCK=true && bundle exec shindont +ecloud
export FOG_MOCK=true && bundle exec shindont +google
export FOG_MOCK=true && bundle exec shindont +joyent
export FOG_MOCK=true && bundle exec shindont +local
export FOG_MOCK=true && bundle exec shindont +rackspace
export FOG_MOCK=true && bundle exec shindont +stormondemand
@wenzowski
wenzowski / Rakefile
Created September 14, 2012 06:04
use travis-ci to deploy a middleman app
task :build do
puts `bundle exec middleman build`
end
task :sync do
require 'fog'
require 'digest'
path = './build'
bucket = 'APPNAME.melang.ent.io'
@wenzowski
wenzowski / what_am_i.rb
Created September 20, 2012 19:47
What is a block?
def what_am_i(&block)
block.class
end
what_am_i {}
# => Proc
@wenzowski
wenzowski / zsh.md
Created October 1, 2012 07:59
Oh my zsh in Ubuntu 12.04

Getting zsh to work in ubuntu:

Install zsh

sudo apt-get install zsh

nb. on a Vagrant VM, the default user (vagrant) has password vagrant.

Install oh-my-zsh

@wenzowski
wenzowski / get_rdf.sh
Created November 15, 2012 15:43
facebook graph api supports rdf
#!/bin/bash
##
# The entire facebook graph api is available in rdf format via
# [turtle](http://www.w3.org/TeamSubmission/turtle/)
# simply by setting the appropriate `Accept` header.
#
# see http://lists.w3.org/Archives/Public/public-lod/2011Sep/0091.html
##
class Integer
##
# Automatically choses fastest accurate algorithm.
def factorial
case
when 0 <= self && self <= 21
self.factorial_via_gamma
when 21 < self
self.factorial_via_reduce
else
@wenzowski
wenzowski / factorial.rb
Created January 26, 2013 21:48
factorial lookup table
##
# Factorial[positive_integer] computes and memoizes the
# factorial of a given positive integer.
module Factorial
class << self
def [](n)
@factorial_table ||= Hash.new { |hash, key|
hash[key] = (1..key).reduce(:*) || 1
}
@factorial_table[n]
@wenzowski
wenzowski / cfn-hup.log
Created March 5, 2013 16:51
elastic beanstalk logs for environment instrumentio-develop-en
2013-03-05 16:16:01,989 [INFO] Refreshing listener credentials
2013-03-05 16:16:02,194 [INFO] Scheduling next credential refresh in 7200 seconds
2013-03-05 16:19:53,733 [INFO] Running action for aws-eb-command-handler
2013-03-05 16:19:57,259 [INFO] Action for aws-eb-command-handler succeeded, returning SUCCESS
2013-03-05 16:20:14,201 [INFO] Running action for aws-eb-command-handler
2013-03-05 16:20:18,318 [INFO] Action for aws-eb-command-handler succeeded, returning SUCCESS
2013-03-05 16:34:35,890 [INFO] Running action for aws-eb-command-handler
$ speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from TekSavvy Solutions (69.196.189.53)...
Selecting best server based on ping...
Hosted by Nexicom Inc. (Toronto, ON) [2.30 km]: 79.711 ms
Testing download speed........................................
Download: 16.02 Mbit/s
Testing upload speed..................................................
Upload: 6.73 Mbit/s