Thursday, 30 June 2016

$ ruby console.rb

# usage: $ ruby console.rb
require 'irb'
module IRB
def self.start_session(binding) # call this method to drop into irb
unless @__initialized
args = ARGV
ARGV.replace(ARGV.dup)
IRB.setup(nil)
ARGV.replace(args)
@__initialized = true
end
workspace = WorkSpace.new(binding)
irb = Irb.new(workspace)
@CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
@CONF[:MAIN_CONTEXT] = irb.context
catch(:IRB_EXIT) do
irb.eval_input
end
end
end
IRB.start_session(binding)
view raw console.rb hosted with ❤ by GitHub

Wednesday, 22 June 2016

The Avalanches' mixtapes, live sets, and DJ sets

The Holy Grail:
--------↓Wildflower Tour↓--------
Live Footage


https://www.reddit.com/r/theavalanches/comments/2zj33i/24_and_counting_of_the_avalanches_mixtapes_live/

Wednesday, 1 June 2016

Delete all non-design docs in CouchDB (using cradle) Raw

var cradle = require('cradle');
var database = 'app';
cradle.setup({
host: '127.0.0.1',
port: 5984,
auth: { username: "YOUR_USERNAME", password: "YOUR_PASSWORD" }
});
var db = new(cradle.Connection)().database(database);
/* Delete non-design documents in a database. */
db.all(function(err, doc) {
/* Loop through all documents. */
for(var i = 0; i < doc.length; i++) {
/* Don't delete design documents. */
if(doc[i].id.indexOf("_design") == -1) {
db.remove(doc[i].id, doc[i].value.rev, function(err, doc) {
console.log(doc);
});
}
}
});