This file contains hidden or 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
# set-option -g prefix C-a | |
bind-key C-b last-window | |
unbind % # Remove default binding since we’re replacing | |
bind | split-window -h | |
bind - split-window -v | |
# Set status bar | |
set -g status-bg black | |
set -g status-fg white |
This file contains hidden or 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
# From http://nathansjslessons.appspot.com/lesson?id=1080 | |
counter = ( -> | |
count = 0 # cannot be accessed as it's tied to the closure | |
f = -> | |
count += 1 | |
f | |
)() | |
console.log counter() # 1 |
This file contains hidden or 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
console.log("%o", window.location); |
This file contains hidden or 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
.wrap-words { | |
word-wrap: break-word; | |
} |
This file contains hidden or 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
# see https://github.com/rails/rails/blob/v2.0.2/railties/builtin/rails_info/rails/info.rb | |
@properties = { | |
:ruby => "#{RUBY_VERSION} (#{RUBY_PLATFORM})", | |
:rubygem => Gem::RubyGemsVersion, | |
:rails => Rails::VERSION::STRING, | |
:app_root => File.expand_path(RAILS_ROOT), | |
:env => RAILS_ENV, | |
:db_adapter => ActiveRecord::Base.configurations[RAILS_ENV]['adapter'], | |
:db_schema_version => (ActiveRecord::Migrator.current_version || nil), |
This file contains hidden or 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
# | |
# = Hash Recursive Merge | |
# | |
# Merges a Ruby Hash recursively, Also known as deep merge. | |
# Recursive version of Hash#merge and Hash#merge!. | |
# | |
# Category:: Ruby | |
# Package:: Hash | |
# Author:: Simone Carletti <[email protected]> | |
# Copyright:: 2007-2008 The Authors |
This file contains hidden or 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
ruby-1.8.7-p302 > tree_printer.call tree | |
Exception | |
IRB::Abort | |
NoMemoryError | |
ScriptError | |
LoadError | |
NotImplementedError | |
SyntaxError | |
SignalException | |
Interrupt |
This file contains hidden or 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
ArgumentError in 'Fog::Vcloud power_on with a vapp uri that doesn't exist should == {:type=>"application/vnd.vmware.vcloud.org+xml", :name=>"Boom Inc.", :href=>"https://fakey.com/api/v0.8/MockOrganization/2174953160"}' | |
Unrecognized arguments: username, module, password, versions_uri | |
/Users/arnab/code/github/fog/lib/fog/core/service.rb:141:in `validate_arguments' | |
/Users/arnab/code/github/fog/lib/fog/core/service.rb:43:in `new' | |
/Users/arnab/code/github/fog/spec/vcloud/terremark/ecloud/requests/../../../spec_helper.rb:276: |
This file contains hidden or 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
import java.io.Console; | |
public class NumberGuess { | |
private int small; | |
private int big; | |
private int guess; | |
private void guess(){ | |
this.guess = nextGuess(); | |
String verdict = System.console().readLine(guess + ": smaller/bigger/start-over? "); |
This file contains hidden or 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
require "fog" | |
CREDS_FILE = 'Somewhere' | |
DOMAIN = 'Dogs' | |
ATTRIBS_TO_CHANGE = { | |
'color' => 'white' | |
} | |
OPTIONS = { | |
:replace => ['color'], | |
:expect => { |