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
=> ["/Users/joho/source/goodfilms/site/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/expressions.rb:3:in `count'", | |
"/Users/joho/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:220:in `binary?'", | |
"/Users/joho/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:229:in `visit_String'", | |
"/Users/joho/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:102:in `accept'", | |
"/Users/joho/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:282:in `block in visit_Hash'", | |
"/Users/joho/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:280:in `each'", | |
"/Users/joho/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:280:in `visit_Hash'", | |
"/Users/joho/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:102:in `accept'", | |
"/Users/joho/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:387:in `block in emit_coder'", | |
"/Users/joho/.rbenv/versions/1.9.3-p125/lib/ruby/1.9. |
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
# is this way of marking methods as private better/worse than... | |
class Meh | |
def your_face | |
"blah" | |
end | |
private | |
def banana | |
"there are no private bananas" |
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
STMBLPN = window.STMBLPN || {}; | |
(function () { | |
if (STMBLPN && STMBLPN.hasHelperFunctions) return; | |
if (STMBLPN instanceof Array) { | |
var list = STMBLPN; | |
STMBLPN = {}; | |
STMBLPN.list = list; | |
} | |
STMBLPN.browser = function () { | |
var ua = navigator.userAgent; |
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
source :rubygems | |
gem "thin" | |
gem "sinatra" | |
group :development do | |
gem "heroku" | |
gem "foreman" | |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
div.container { | |
width: 600px; | |
border: solid 3px red; | |
} | |
div.widget { |
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
/** | |
* Blinking like it's 1999 | |
*/ | |
@-webkit-keyframes blink { | |
0% { opacity: 0 } 50% { opacity: 0 } | |
50.01% { opacity: 1 } 100% { opacity: 1 } | |
} | |
blink { |
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
@-webkit-keyframes blink | |
0% | |
opacity: 0 | |
50% | |
opacity: 0 | |
50.01% | |
opacity: 1 | |
100% | |
opacity: 1 |
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
# from http://pushandpop.blogspot.com.au/2011/05/handling-gzip-responses-in-ruby-nethttp.html | |
# i wanted syntax highlighting | |
require 'net/http' | |
debug = Proc.new{|msg| STDERR.puts "[#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}] #{msg}" } | |
page = nil | |
http = Net::HTTP.new( "www.google.com", 80 ) | |
req = Net::HTTP::Get.new( "/search?num=20&hl=en&noj=1&q=test&btnG=Search", { "Accept-Encoding" => "gzip", "User-Agent" => "gzip" } ) |
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
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X) | |
(if you aren't using version 9.1.5, change line 6 with the correct version) | |
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
2. mv /usr/local/var/postgres /usr/local/var/postgres91 | |
3. brew update | |
4. brew upgrade postgresql | |
5. initdb /usr/local/var/postgres -E utf8 | |
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres | |
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ |
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
set :path_to_repo, "/path_to_repo/" | |
set :running_app_user, "appusername" | |
namespace :webscale do | |
desc "Cache a signed out version of the path. Usage: cap webscale:signed_out_cache_page -s path_to_cache=/films/on_netflix" | |
task :signed_out_cache, roles: :app do | |
cache_base_path = "#{path_to_repo}/public/signed_out" | |
cached_destination_path = "#{cache_base_path}#{path_to_cache}.html" | |
working_path = "#{cached_destination_path}.tmp" |