Website:
http://prediction.io
Install Guide:
http://docs.prediction.io/installation/install-predictionio-on-linux.html
# Calculate the nth Fibonacci number, f(n). Using invariants | |
def fibo_tr(n, acc1, acc2) | |
if n == 0 | |
0 | |
elsif n < 2 | |
acc2 | |
else | |
return fibo_tr(n - 1, acc2, acc2 + acc1) | |
end | |
end |
# | |
# NOTE: This gist is now deprecated and has been moved into a gem: https://github.com/reidmorrison/mongo_ha | |
# | |
require 'mongo/collection' | |
module Mongo | |
class Collection | |
alias_method :find_one_original, :find_one | |
def find_one(*args) |
require "rspec/core/formatters/progress_formatter" | |
class ApplauseFormatter < RSpec::Core::Formatters::ProgressFormatter | |
def initialize(output) | |
super(output) | |
unless File.exists? "/tmp/applause.mp3" | |
p "Downloading applause for awesomeness" | |
system "wget http://www.soundjay.com/human/applause-1.mp3 -O /tmp/applause.mp3" | |
end | |
end |
# encoding: utf-8 | |
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) | |
require 'rvm/capistrano' | |
set :application, "hirefireapp" | |
set :repository, "git@codeplane.com:meskyanichi/myapp.git" | |
set :branch, "develop" | |
set :rvm_ruby_string, "1.9.2" |
#Stories are embedded docs in a Feed | |
class Feed | |
include MongoMapper::Document | |
many :stories | |
end | |
class Story | |
include MongoMapper::EmbeddedDocument | |
key :title, String |
Website:
http://prediction.io
Install Guide:
http://docs.prediction.io/installation/install-predictionio-on-linux.html
The purpose of this gem is to consume the JSON that KISSmetrics exports to an S3 bucket, and transform it in a variety of useful ways.
The core features are:
Spork.each_run do | |
load "#{Rails.root}/config/routes.rb" | |
Dir["#{Rails.root}/app/**/*.rb"].each { |f| load f } | |
end |
sudo cp nginx /etc/init.d/ | |
sudo update-rc.d nginx defaults | |
sudo chmod +x /etc/init.d/nginx | |
/etc/init.d/nginx start |