Usage:
SpoonDaemon.new('start', 'path/to/my/script.rb', 'tmp/pids')| #!/bin/bash | |
| REMOTE=play@SERVER_IP | |
| REMOTE_APP=/home/play/PROJECT_NAME/ | |
| sbt stage || exit 1; | |
| rsync -va target/ $REMOTE:$REMOTE_APP/target; | |
| ssh $REMOTE "cd $REMOTE_APP; ./stop.sh"; | |
| ssh $REMOTE "cd $REMOTE_APP; ./start.sh"; | 
| <html> | |
| <body> | |
| <div id="my-app"></div> | |
| <script src="http://fb.me/react-0.11.1.js"></script> | |
| <script src="out/goog/base.js" type="text/javascript"></script> | |
| <script src="pomodoro.js" type="text/javascript"></script> | |
| <script type="text/javascript">goog.require("pomodoro");</script> | |
| </body> | |
| </html> | 
| Download "Format: Shapefile, Projection: WGS84 (Large polygons are split, use for larger scales)" from: | |
| http://openstreetmapdata.com/data/land-polygons | |
| Import into PG database with PostGIS extension: | |
| shp2pgsql -s 4326 land_polygons.shp | psql <database> | |
| Add index: | |
| CREATE INDEX idx_land_polygons_geom ON land_polygons USING gist(geom); | |
| Query example: | 
| .rotate (@deg) { | |
| -webkit-transform: rotate(@deg); | |
| -moz-transform: rotate(@deg); | |
| -ms-transform: rotate(@deg); | |
| -o-transform: rotate(@deg); | |
| } | |
| .loopRotated(@index) when (@index > 0) { | |
| .rotated-@{index} { | 
| require 'date' | |
| require 'nokogiri' | |
| require 'gnuplot' | |
| class Point | |
| attr_accessor :lon, :lat, :speed, :time | |
| def initialize(lon, lat, speed, time) | |
| @lon = lon | |
| @lat = lat | 
| package org.example | |
| import akka.actor._ | |
| import akka.camel.{ CamelMessage, Consumer, CamelExtension } | |
| import org.apache.activemq.camel.component.ActiveMQComponent | |
| class CdrLogConsumer extends Actor with Consumer { | |
| def endpointUri = "activemq:FOO.BAR" | |
| def receive = { | 
Usage:
SpoonDaemon.new('start', 'path/to/my/script.rb', 'tmp/pids')| module Actors | |
| class Manager | |
| include Celluloid | |
| include Celluloid::Logger | |
| def initialize | |
| @brokers = CONF.brokers.voip | |
| @brokers.each do |broker, conf| | |
| StompListener.supervise_as("#{broker}_listener".to_sym, | |
| current_actor, | 
| source :rubygems | |
| gem 'redis' | |
| gem 'mongoid' | |
| gem 'celluloid' | 
| require 'action_controller/test_process' | |
| class Factory | |
| module FixtureFileUpload | |
| def fixture_file_upload(attr_name, path, mime_type=nil, binary=false) | |
| uploaded_file = ActionController::TestUploadedFile.new( | |
| Test::Unit::TestCase.respond_to?(:fixture_path) ? Test::Unit::TestCase.fixture_path + path : path, | |
| mime_type, | |
| binary | |
| ) | |
| add_attribute attr_name, uploaded_file |