Skip to content

Instantly share code, notes, and snippets.

View duksis's full-sized avatar
🇪🇺
I definitely will be slow to respond.

Hugo Duksis duksis

🇪🇺
I definitely will be slow to respond.
View GitHub Profile
@boriscy
boriscy / install-ruby-debug-ubuntu-ruby-1.9.3
Created November 1, 2011 18:57
ruby-debug in ruby-1.9.3 and ubuntu
#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
@khalsah
khalsah / deploy.sh
Created January 3, 2012 22:59
Experimental git sync & deploy hooks
#!/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
@AMekss
AMekss / namespace.js
Created June 26, 2012 08:47
Helper for global javascript namespace definition
// 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] || {};
@ashleyconnor
ashleyconnor / ruby.rb
Created July 23, 2012 11:13
Ruby Test Cart
require 'bigdecimal'
class Item
attr_accessor :code, :name, :price
def initialize(code, name, price)
@code = code
@name = name
@price = BigDecimal.new("#{price}")
@tmikoss
tmikoss / log.rb
Created November 16, 2012 07:06
Capistrano recipes for remote log viewing
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}"
anonymous
anonymous / gist:7324533
Created November 5, 2013 19:18
iex remote node
Node A:
iex --sname "nodea"
iex> Process.register self, :iex
Node B:
iex --sname "nodeb"
iex> Node.connect :"nodea@myhostname"
true