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
# config/environments/production.rb | |
config.serve_static_assets = false | |
config.assets.compress = true | |
config.assets.digest = true | |
config.action_controller.asset_host = ENV['FASTLY_CDN_URL'] | |
config.static_cache_control = 'public, s-maxage=15552000, maxage=2592000' |
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
#!/bin/env ruby | |
## | |
# fastly_upload_vcl - upload raw VCL files to Fastly | |
# | |
# Author:: Fastly Inc <[email protected]> | |
# Copyright:: Copyright (c) 2011 Fastly Inc | |
# License:: Distributes under the same terms as Ruby | |
# | |
# = USAGE |
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
fastly = Fastly.new(api_key: FASTLY_API_KEY) | |
# Site wide purge | |
s = fastly.get_service service_id | |
s.purge_all | |
# URL Purge | |
# "www.cool.com/blah.json" | |
fastly.purge("/blah.json") |
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
-----> Ruby app detected | |
<internal:prelude>:8:in `lock': deadlock detected (fatal) | |
from <internal:prelude>:8:in `synchronize' | |
from /usr/local/lib/ruby/1.9.1/thread.rb:293:in `push' | |
from /app/vendor/lpxc/lpxc.rb:39:in `puts' | |
from /app/slug-compiler/lib/utils.rb:173:in `log_write' | |
from /app/lib/loggable.rb:137:in `log_hash' | |
from /app/lib/loggable.rb:100:in `l2metfmt' | |
from /app/lib/loggable.rb:72:in `count' | |
from /app/lib/loggable.rb:47:in `monitor' |
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
mmay$ rake assets:clean | |
Booted rails in 0.83 | |
Included bundled gems in 5.738 | |
/Users/mmay/.rvm/rubies/jruby-1.7.3/bin/jruby /Users/mmay/.rvm/gems/jruby-1.7.3/bin/rake assets:clean:all RAILS_ENV=production RAILS_GROUPS=assets | |
Booted rails in 0.802 | |
Included bundled gems in 5.209 | |
Loading java environment from /Users/mmay/dev/.../src/main/rails/.../../../../../pom.xml | |
Built effective-pom.xml in 0.0s | |
Built build-classpath.txt in 0.0s | |
Added java paths to $CLASSPATH in 0.023 |
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
# "Stuff" is a java object with a default constructor | |
# In the style of ruby open struct | |
stuff = Stuff.new(attr1: "value1", attr2: "value2") | |
# VS | |
# typcial get/set style | |
stuff = Stuff.new | |
stuff.attr1 = "value1" |
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
# Adds minutes to the time string | |
# @param time [String] of format "[H]H:MM {AM|PM}" | |
# @param minutes [Integer] the number of minutes to add to the time | |
def add_minutes(time, minutes) | |
hours, min, am_pm = time.match(/(\d+):(\d+)\s(\w\w)/).captures | |
hours = hours.to_i | |
min = min.to_i + minutes | |
if hours == 11 && min > 59 | |
am_pm = am_pm == "PM" ? "AM" : "PM" |
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
development: | |
adapter: postgresql | |
encoding: utf8 | |
database: <app_name>_development | |
pool: 5 | |
timeout: 5000 | |
host: localhost | |
test: | |
adapter: postgresql |