Skip to content

Instantly share code, notes, and snippets.

Feature: Localization
As a Japanese visitor
I want to access a localized version of seesmic.com
In order to have a better user experience with Seesmic Web
Scenario: Redirect based on UserAgent
Given a Japanese browser UserAgent
When I visit seesmic.com
Then I should get redirected to seesmic.jp
[Sun, 10 Oct 2010 20:14:39 +0300] ERROR: homebrew[hub] (/Users/xhr/.cinderella/cookbooks/homebrew/recipes/misc.rb:12:in `from_file') had an error:
/Users/xhr/Developer/bin/brew install hub returned 1, expected 0
/Library/Ruby/Gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in `handle_command_failures'
/Library/Ruby/Gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:131:in `run_command'
/Library/Ruby/Gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:199:in `run_command_with_systems_locale'
/Users/xhr/.cinderella/cookbooks/homebrew/providers/homebrew.rb:33:in `run_brew_command'
/Users/xhr/.cinderella/cookbooks/homebrew/providers/homebrew.rb:23:in `install_package'
/Library/Ruby/Gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/package.rb:60:in `action_install'
/Library/Ruby/Gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `send'
/Library/Ruby/Gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:in `run_action'
@andreimaxim
andreimaxim / ip.sh
Created November 9, 2010 11:00
Get the external IP and copy it into the system clipboard
# IP Check
function ip {
local current_ip=`curl -s www.whatismyip.com/automation/n09230945.asp`
echo "Current external IP address is: $current_ip"
echo $current_ip | pbcopy
}
begin
require 'autotest/timestamp'
require 'autotest/growl'
Autotest::Growl::image_dir = 'ampelmaennchen'
Autotest::Growl::hide_label = true
Autotest::Growl::sticky_failure_notifications = true
rescue LoadError
puts "Make sure you have the autotest-growl gem installed."
Klass.setup do |i|
i.foo = "chunky #{bacon}"
end
a = Klass.build :bacon => "foo" # sau oricum altcumva
a.foo #=> "chunky foo"
@andreimaxim
andreimaxim / thin
Created December 22, 2011 08:38 — forked from sorah/thin
/etc/init.d/thin - thin init script with bundle exec. own your risk - public domain.
#!/bin/bash
DAEMON=/path/to/thin
BUNDLE=/path/to/bundle
CONFIG_PATH=/etc/thin
SCRIPT_NAME=/etc/init.d/thin
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
require "active_support"
class FooOne
def m; 1; end
end
class FooTwo # classy
def m; 1; end
end
@andreimaxim
andreimaxim / FREEWAYS
Created July 19, 2012 21:47
Kernel for a FreeBSD-based gateway.
#
# FREEWAYS -- Custom kernel configuration for a FreeBSD gateway/storage server
#
# For more information on this file, please read the config(5) manual page,
# and/or the handbook section on Kernel Configuration Files:
#
# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
@andreimaxim
andreimaxim / ree.sh
Created August 2, 2012 06:29
REE 1.8.7 on Mountain Lion
# Thanks Olly Smith! http://coderwall.com/p/fywjrw
brew tap homebrew/dupes
brew install apple-gcc42
# Requires XQuartz from http://xquartz.macosforge.org/landing/
CPPFLAGS=-I/opt/X11/include CC=/usr/local/bin/gcc-4.2 rbenv install ree-1.8.7-2012.02

ruby-1.9.3-p385 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p385 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.