This file contains 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
Node A: | |
iex --sname "nodea" | |
iex> Process.register self, :iex | |
Node B: | |
iex --sname "nodeb" | |
iex> Node.connect :"nodea@myhostname" | |
true |
This file contains 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
namespace :log do | |
desc "Search from log files on server" | |
task :grep, :roles => :app do | |
run "cd #{current_path}/log && grep #{ENV['str']} -B #{ENV['before'] || 5} -A #{ENV['after'] || 35} #{rails_env}.log*" | |
end | |
desc "Tail log files on servers" | |
task :tail, :roles => :app do | |
run "tail -f #{shared_path}/log/#{rails_env}.log" do |channel, stream, data| | |
puts "#{data}" |
This file contains 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 'bigdecimal' | |
class Item | |
attr_accessor :code, :name, :price | |
def initialize(code, name, price) | |
@code = code | |
@name = name | |
@price = BigDecimal.new("#{price}") |
This file contains 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
// The MIT License (MIT) => http://www.opensource.org/licenses/mit-license | |
// Copyright (c) 2012 Artūrs Mekšs | |
// | |
// Runtime depndency jQuery 1.4 or above | |
(function($, rootspace){ | |
window[rootspace] = function(namespace, object){ | |
var setNamespace = function(namespace){ | |
var root = window[rootspace]; | |
$(namespace.split(".")).each(function(idx, name){ | |
root = root[name] = root[name] || {}; |
This file contains 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
#!/bin/sh | |
LOCAL_BRANCH="master" | |
LIVE_BRANCH="live" | |
REMOTE_NAME="deploy" | |
if [ "$(git symbolic-ref -q HEAD)" != "refs/heads/${LOCAL_BRANCH}" ]; then | |
echo "Not on ${LOCAL_BRANCH}, not deploying" | |
exit 1 | |
else |
This file contains 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
#To install ruby-debug on Ubuntu ruby-1.9.3 you need to download from http://rubyforge.org/frs/?group_id=8883 | |
linecache19-0.5.13.gem | |
ruby_core_source-0.1.5.gem | |
ruby-debug19-0.11.6.gem | |
ruby-debug-base19-0.11.26.gem | |
#Then in your console | |
export RVM_SRC=/your/path/to/ruby-1.9.3 |