- Support for delaying the lookup (good for preventing too many AJAX requests)
- Some fixes regarding the data fed to the onselect callback
For the proper source, and other examples, please see the original gist and the extended version
source "http://gems.github.com" | |
source "http://gemcutter.org" | |
bundle_path "gems" | |
gem "dm-core" | |
gem "dm-migrations" | |
gem "dm-sweatshop" | |
gem "data_objects" | |
gem "do_postgres" |
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux] | |
curb (0.6.2.1) | |
em-http-request (0.2.5) | |
eventmachine (0.12.10) | |
typhoeus (0.1.13) | |
user system total real Memory (Kb) | |
4kb std | |
0.000000 0.000000 3.010000 ( 22.408594) 24,484 |
require 'gserver' | |
class ChatServer < GServer | |
def initialize *args | |
super | |
#Keep a list for broadcasting messages | |
@chatters = [] | |
#We'll need this for thread safety |
# <%= google_analytics 'UA-XXXXXX-XX' %> | |
# </body> | |
# application_helper.rb | |
module ApplicationHelper | |
def google_analytics(id) | |
content_tag :script, :type => 'text/javascript' do | |
"var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', '#{id}']); |
# Pass in the name of the site you wich to create a cert for | |
domain_name = ARGV[0] | |
if domain_name == nil | |
puts "Y U No give me a domain name?" | |
else | |
system "openssl genrsa -out #{domain_name}.key 1024" | |
system "openssl req -new -key #{domain_name}.key -out #{domain_name}.csr -subj '/C=US/ST=NJ/L=Monroe/O=MyCompany/OU=IT/CN=#{domain_name}'" | |
system "cp #{domain_name}.key #{domain_name}.key.bak" |
class LintTest < ActiveSupport::TestCase | |
include ActiveModel::Lint::Tests | |
class Model | |
# model.to_model | |
include ActiveModel::Conversion | |
# Implements Model.model_name | |
extend ActiveModel::Naming |
For the proper source, and other examples, please see the original gist and the extended version
# Based off of https://gist.github.com/1115513 | |
desc "Remote console on the production appserver" | |
task :console, :roles => ENV['ROLE'] || :web do | |
hostname = find_servers_for_task(current_task).first | |
puts "Connecting to #{hostname}" | |
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && cd #{current_path} && bundle exec rails c #{rails_env}'" | |
end |
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'sinatra' | |
set :server, 'thin' | |
set :sessions, true | |
streams = Hash.new {|k, v| k[v] = [] } | |
helpers do | |
def session_id |
group :production, :test, :cucumber, :staging do | |
gem 'rb-inotify', :require => false | |
end | |
group :test, :development, :cucumber do | |
gem 'rb-fsevent', :require => false | |
end |