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 'sinatra' | |
require 'fileutils' | |
# upload with: | |
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename | |
# or just go to http://localhost:4567/user/filename with a browser | |
get '/:name/:filename' do |
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
get '/' do | |
haml :index, :layout => !request.xhr? | |
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
# >---------------------------------------------------------------------------< | |
# | |
# _____ _ _ __ ___ _ | |
# | __ \ (_) | \ \ / (_) | | | |
# | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| | | |
# | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` | | |
# | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| | | |
# |_| \_\__,_|_|_|___/ \/ \/ |_/___\__,_|_| \__,_| | |
# | |
# This template was generated by RailsWizard, the amazing and awesome Rails |
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 'zmq' | |
context = ZMQ::Context.new | |
pub = context.socket ZMQ::PUB | |
pub.setsockopt ZMQ::IDENTITY, 'ping-pinger' | |
pub.bind 'tcp://*:5555' | |
i=0 | |
loop do | |
pub.send "ping pinger #{i+=1}" ; sleep 1 | |
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
require 'rubygems' | |
require 'mongo' | |
module MongoPubSub | |
QUEUES_COLLECTION = 'queues' | |
class EndSubscriptionException < Exception; end | |
class Publisher | |
def initialize(queue_name, mongo_connection) | |
# Initialize queue collection as a capped collection | |
if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name) |
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
!!! 5 | |
/[if lt IE 7] <html lang="en" class="no-js ie6"> | |
/[if IE 7 ] <html lang="en" class="no-js ie7"> | |
/[if IE 8 ] <html lang="en" class="no-js ie8"> | |
/[if IE 9 ] <html lang="en" class="no-js ie9"> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]--> | |
%head | |
%meta{:charset => "utf-8"}/ | |
/ | |
Always force latest IE rendering engine (even in intranet) & Chrome Frame |
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
# Basic tagging system for mongoid documents. | |
# jpemberthy 2010 | |
# | |
# class User | |
# include Mongoid::Document | |
# include Mongoid::Document::Taggable | |
# end | |
# | |
# @user = User.new(:name => "Bobby") | |
# @user.tag_list = "awesome, slick, hefty" |
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
<html> | |
<head> | |
<script type='text/javascript' src='https://www.google.com/jsapi'></script> | |
<script type='text/javascript'> | |
/* | |
Carlo Perassi - http://perassi.org/ - 2011 | |
based on: | |
http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 | |
http://code.google.com/apis/ajax/playground/?type=visualization#geo_chart | |
http://code.google.com/intl/it-IT/apis/chart/interactive/docs/gallery/geochart.html |
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
2011-12-25T09:18:03+00:00 app[web.1]: Start scheduled watched repos sync per user2011-12-25 09:18:03 +0000 | |
2011-12-25T09:18:03+00:00 app[web.1]: | |
2011-12-25T09:18:03+00:00 app[web.1]: End scheduled watched repos sync per user2011-12-25 09:18:03 +0000 | |
2011-12-25T09:18:03+00:00 app[web.1]: | |
2011-12-25T09:18:03+00:00 app[web.1]: | |
2011-12-25T09:18:06+00:00 app[web.1]: >> Thin web server (v1.3.1 codename Triple Espresso) | |
2011-12-25T09:18:06+00:00 app[web.1]: >> Maximum connections set to 1024 | |
2011-12-25T09:18:06+00:00 app[web.1]: >> Listening on 0.0.0.0:33856, CTRL+C to stop | |
2011-12-25T09:18:06+00:00 heroku[web.1]: State changed from starting to up | |
2011-12-25T09:18:08+00:00 app[web.1]: Dalli/SASL authenticating as app1707530%40heroku.com |
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
lsoave@ubuntu:~/rails/github/rails_apps_composer$ rake print --silent RECIPES=jquery,haml,rspec,cucumber,guard,mongoid,seed_database,add_user,omniauth,home_page,home_page_users,css_setup,application_layout,html5,navigation,users_page,omniauth_email,cleanup,ban_spiders,extras,git > ./template.txt --trace | |
** Invoke print (first_time) | |
** Execute print | |
rake aborted! | |
undefined method `requires' for nil:NilClass | |
/home/lsoave/rails/github/rails_apps_composer/lib/rails_wizard/template.rb:34:in `block in recipes_with_dependencies' | |
/home/lsoave/rails/github/rails_apps_composer/lib/rails_wizard/template.rb:33:in `each' | |
/home/lsoave/rails/github/rails_apps_composer/lib/rails_wizard/template.rb:33:in `recipes_with_dependencies' | |
/home/lsoave/rails/github/rails_apps_composer/lib/rails_wizard/template.rb:22:in `resolve_recipes' | |
(erb):23:in `compile' |