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 'mh/blank_slate' | |
require 'mh/message_recorder' | |
module QueryBuilder | |
OPERATOR_MAP = { | |
:'<' => :lt, | |
:'<=' => :lte, | |
:'>=' => :gte, | |
:'>' => :gt, | |
:'=~' => :matches, |
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
ruby -e ' i=0; print " "; (1..20).each{|x| print "%3d |" % (x)}; puts; loop{ `uptime` =~ /load average: ([\d.]+)/; load = $1.to_f * 5; print("\r" + ("=" * load.ceil) + (" " * (100 - load.ceil)) + (%w{- \\ | /})[i%4]); $stdout.flush; i+=1; sleep 0.1} ' |
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
# Ubuntu 10.04 / Debian | |
rm CMakeCache.txt # Cache needs to be cleaned if you tried to install QtRuby with 1.9.2 | |
# rvm 1.0.14 | |
sudo aptitude install libqt4-core libqt4-dev cmake automoc | |
# from http://rubyforge.org/projects/korundum/ | |
wget http://rubyforge.org/frs/download.php/71843/qt4-qtruby-2.1.0.tar.gz | |
tar -xvzf qt4-qtruby-2.1.0.tar.gz | |
cd qt4-qtruby-2.1.0 | |
# the qtruby install uses the location of your ruby binary | |
rvm use 1.8.7 |
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
# Change version number when needed, but keep to 2.1. series. | |
wget http://download.zeromq.org/zeromq-2.1.10.tar.gz | |
tar -zxf zeromq-*.tar.gz | |
cd zeromq-* | |
aptitude install uuid-dev # Any other deps? | |
./configure | |
make | |
sudo make install | |
ldconfig # Somtimes needed to reload libraries, especially if You get 'libzmq.so.1: cannot open shared object file: No such file or directory' |
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
// Example usage | |
.row { | |
#fixed .row() | |
} | |
.row-fluid { | |
#fluid .row() | |
} |
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
aptitude install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison git pwgen vim libcurl4-openssl-dev | |
chmod 777 /opt | |
adduser www | |
su www | |
cd ~ | |
curl -L get.rvm.io | bash -s stable |
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 'open-uri' | |
require 'json' | |
require 'ostruct' | |
require 'mail' # you need to `gem install mail` | |
# Retrieval | |
print "Connecting to api.ihackernews.com ... "; $stdout.flush | |
home_page = open('http://api.ihackernews.com/page').read | |
puts "done." |
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
module MyModule | |
# Regenerating code | |
end unless __FILE__ == $0 | |
if __FILE__ == $0 | |
require 'savon' | |
split_on = "#" + " Regenerating code" | |
code = File.read(__FILE__).split(split_on).last | |
wsdl_file_path = File.join(File.dirname(__FILE__), ARGV.first || raise("Gimme file!")) |
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
# Helpful reference http://alexpeattie.com/blog/working-with-dates-in-git/ | |
require 'date' | |
require 'pp' | |
cmd="git log --author='#{ARGV[0]}' --abbrev-commit --format=medium --date=iso" | |
cmd+= " --since=#{Date.parse(ARGV[1]).to_s}" if ARGV[1] | |
cmd+= " --until=#{Date.parse(ARGV[2]).to_s}" if ARGV[2] | |
e = e = <<GIT |
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 'sinatra' | |
require 'oauth2' | |
require 'json' | |
require 'logger' | |
require 'pp' | |
set :port, 3000 | |
site = ARGV[0] || 'http://paszport.epf.org.pl/' | |
callback_host = ARGV[1] || 'http://localhost:3000' |
OlderNewer