Skip to content

Instantly share code, notes, and snippets.

View richardiux's full-sized avatar

Richard Millan richardiux

View GitHub Profile
@richardiux
richardiux / dependencies.sh
Last active November 29, 2017 13:25
golang on smartos with image magick
pkgin -y install git mercurial gcc47 gmake giflib-5.0.5 ImageMagick-6.8.7.4
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/gocode
cd
hg clone -u release https://code.google.com/p/go
cd go
hg update default
@richardiux
richardiux / gist:8839263
Created February 6, 2014 06:30
Check idle queries on postgres
select * from pg_stat_activity where state != 'idle';
@richardiux
richardiux / gist:8744229
Last active August 29, 2015 13:55
Add self signed certificate to keychain
sudo security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" "path_to_cer/mycert.cer"
@richardiux
richardiux / class-as-array.rb
Created December 10, 2010 22:14
Class that behaves like array
class A
def method_missing(method_sym, *arguments, &block)
if method_sym == :[] && arguments.first.is_a?(Integer)
# do something here with value (search something or create)
arguments.first
else
super
end
end
end
$ sudo gem update --system -V
GET 200 OK: http://gemcutter.org/latest_specs.4.8.gz
GET 200 OK: http://gems.rubyforge.org/latest_specs.4.8.gz
GET 200 OK: http://gems.github.com/latest_specs.4.8.gz
Nothing to update
$ sudo gem install paperclip -V
GET 200 OK: http://gemcutter.org/latest_specs.4.8.gz
GET 200 OK: http://gems.rubyforge.org/latest_specs.4.8.gz
GET 200 OK: http://gems.github.com/latest_specs.4.8.gz