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
# Deploying a Sinatra app to Heroku | |
## Database | |
The location of the database Heroku provides can be found in the environment | |
variable DATABASE_URL. Check the configure-block of toodeloo.rb for an example | |
on how to use this. | |
## Server | |
Heroku is serving your apps with thin, with means you have all your thin goodness available, | |
such as EventMachine. |
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 'digest/sha1' | |
dictionary = ["solo","flex","scalable","rubyonrails","rails","cloud","web","hosting","ec2","aws","git","3des","abbrev","accessor","actionpack","active","activereload","addon","adjoin","aes","agile","ajax","alberti","algol","alias","allen","allman","aloha","amazon","AMI","amp","andreessen","android","apache","apple","applet","apricot","ar","arcade","array","assert","assoc","atbash","atkinson","awk","awsm","awstats","babbage","backus","balancers","bartle","base64","based","bash","bazeries","bdd","beck","becker","behavior","behlendorf","bell","benchmark","benchmarks","berkeleydb","berners","beta","betas","bford","bigdecimal","bignum","bigtable","biham","bin","bina","binaries","binary","bitsweat","bizstone","blank","bletchley","block","blocks","blog","blogs","boole","boolean","bot","box","bricklin","bridge","brin","browser","browsers","bsd","bug","bugs","build","builder","builders","builds","bytesize","c10k","cache","caches","caching","caesar","call","camp","capistrano","cardelli","carmack" |
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
namespace :ci do | |
task :enqueue do | |
sleep 60 while FileTest.exists?('tmp/currently_running_tests') | |
`touch tmp/currently_running_tests` | |
end | |
task :dequeue do | |
`rm tmp/currently_running_tests` | |
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 is a Shortwave configuration file | |
> http://shortwaveapp.com/ | |
> | |
> Some triggers copied from benpickles (http://gist.github.com/43371) | |
> | |
> Urls may contain the following replacement tokens: | |
> | |
> %s → search terms | |
> %r → URL of current page | |
> %d → domain part of the current URL |
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 is a Shortwave configuration file | |
> http://shortwaveapp.com/ | |
> | |
> Some triggers copied from benpickles (http://gist.github.com/43371) | |
> | |
> Urls may contain the following replacement tokens: | |
> | |
> %s → search terms | |
> %r → URL of current page | |
> %d → domain part of the current URL |
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
named_scope :with_city, lambda {|city| city.present? ? {:conditions => {:city => city} : {}} | |
Search.with_city('Pittsburgh').size # => 2 | |
Search.with_city(nil).size # => all |
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
# Hitting | |
http://otter.topsy.com/trackbacks.js?callback=jsonp1272404811434&url=http%3A%2F%2Fzachholman.com%2F2010%2F04%2Fapple-is-petrified%2F&perpage=50 | |
# Returns this JSON with only one result: | |
jsonp1272404811434({"request":{"parameters":{"url":"http://zachholman.com/2010/04/apple-is-petrified/","perpage":"50"},"response_type":"js","resource":"trackbacks","url":"http://button.topsy.com/trackbacks.js?perpage=50&url=http%3A%2F%2Fzachholman.com%2F2010%2F04%2Fapple-is-petrified%2F"},"response":{"page":1,"topsy_trackback_url":"http://topsy.com/tb/zachholman.com/2010/04/apple-is-petrified/","total":1,"perpage":50,"list":[{"permalink_url":"http://twitter.com/alexanderkahn/status/12966881983","date":1272404753,"content":"RT @holman: Why Apple (probably) won't fix iTunes:\n\nhttp://zachholman.com/2010/04/apple-is-petrified","date_alpha":"58 seconds ago","author":{"name":"Alex Kahn","url":"http://twitter.com/alexanderkahn","topsy_author_url":"http://topsy.com/twitter/alexanderkahn","photo_url":"http://a3.twimg.c |
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 'net/https' | |
require 'omniauth/enterprise' | |
use OmniAuth::Builder do | |
provider :CAS, :cas_server => "http://localhost:8080/cas-server-webapp-3.4.5" | |
end | |
enable :sessions |
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
puts "YOU ARE NOW SECURE USING RUBY™" |
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 'net/https' | |
module SecurityModule | |
class HighSecurity | |
class ReallyHighSecurity | |
def self.turn_on_safe_connections | |
OpenSSL::SSL::VERIFY_NONE | |
end | |
end | |
end |
OlderNewer