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
Earthquake.init do | |
output do |item| | |
if item["text"] || item["retweeted_status"] | |
matches = item['retweeted_status'].nil? ? | |
URI.extract(item["text"],["http", "https"]) : | |
URI.extract(item['retweeted_status']["text"],["http", "https"]) | |
matches.each do |match_url| | |
browse match_url | |
end | |
end |
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
source :rubygems | |
gem 'celluloid-zmq', github: "chatgris/celluloid-zmq", branch: "more_parts" |
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
source :rubygems | |
gem 'sinatra', git: 'git://github.com/sinatra/sinatra.git' | |
gem 'thin' |
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
# pulled out of a project authored by tpope && rbxbx | |
# not generic enough for general use, but a decent example of | |
# an application specific restful crud abstraction | |
module Incrudable | |
extend ActiveSupport::Concern | |
included do | |
expose(controller_name) { controller_name.classify.constantize.scoped } | |
expose(controller_name.singularize) |
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
# Asynchronous DSL for CoffeeScript | |
serial = (f) -> | |
next = -> arr.shift().apply(null, arguments) if arr.length | |
arr = (v for k, v of f(next)) | |
next() | |
null | |
parallel = (f, after = ->) -> | |
res = {}; arrc = 0 |
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 'rubygems' | |
require 'mongoid' | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new.db("mongoid_before_create") | |
end | |
Mongoid.master.collection("topics").drop | |
Mongoid.master.collection("members").drop | |
Mongoid.master.collection("posts").drop |