Instantly share code, notes, and snippets.

View summary-ruby-example.rb
require 'rest-client'
require 'json'
site = "https://api.mmx.io"
path = "/query/summary"
token = $TOKEN # be sure to set this in your command line environment.
url = "https://api.mmx.io/query/summary"
body = {
datasource: "demoexchange",
View gist:2885238
data = ubalo.recv()
ubalo.map("analyze", data)
ubalo.send(final_result)
View gist:2879217
.hll { background-color: #ffffcc }
.c { color: #408080; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #008000; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.cm { color: #408080; font-style: italic } /* Comment.Multiline */
.cp { color: #BC7A00 } /* Comment.Preproc */
.c1 { color: #408080; font-style: italic } /* Comment.Single */
.cs { color: #408080; font-style: italic } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
View gist:2783772
SERVER = 'imap.gmail.com'
USERNAME = 'XXX'
PW = 'XXX'
require 'net/imap'
require 'net/smtp'
require 'tmail'
require 'maruku'
def to_markdown(text)
Maruku.new(text).to_html
View gist:2646744
export PACKAGESITE=http://ubalo.io.s3.amazonaws.com/packages/public
sudo pkg update
sudo pkg info -e java/openjdk6 || sudo pkg install -y java/openjdk6
javac hello.java
View gist:1443669
git log -S 'command :cp'
View gist:1399348
# To play with routes in the rails console from rails 3.1, use the following:
include Rails.application.routes.url_helpers
default_url_options[:host] = 'localhost:3000' # or whatever
# Now, can freely play with routes.
>> url_for User.first
=> "http://localhost:3000/users/7"
>> url_for [Pod.first, :tasks]
=> "http://localhost:3000/pods/8/tasks"
# etc.
View devise.rb
################################################################
# For views/migrations etc. check http://tinyurl.com/3xfx3zm #
################################################################
# File : RAILS_APP/config/initializers/devise.rb
# Change the following only. Rest can stay same
# NOTE : You must use devise master or any version released after Mar 13, 2011 to get everything mentioned here working.
config.authentication_keys = [ :login ]
config.confirmation_keys = [ :login ]
config.unlock_keys = [ :login ]
View gist:1083800
ls | xargs -P2 -I% echo "This file is [%]"
# -I replstr