Sunrise and sunset time visualization for Minneapolis, Minnesota. Adapted from D3 for Mere Mortals.
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
application: yourappid | |
version: testgaesessions | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /stats.* | |
script: $PYTHON_LIB/google/appengine/ext/appstats/ui.py | |
- url: /.* | |
script: main.py |
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
# | |
# Silently fail instead of raising an exception when an error occurs while writing to Solr. | |
# NOTE: does not fail for reads; you should catch those exceptions, for example in a rescue_from statement. | |
# | |
# To configure, add this to an initializer: | |
# Sunspot.session = SilentFailSessionProxy.new(session_or_proxy) | |
# | |
# You can get the existing session with Sunspot.send(:session) (it's a private method in Sunspot 0.18, but not 1.0) | |
# | |
# This is for Sunspot 0.18 and would need to be changed a little bit for Sunspot 1.0. |
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
# Convert a Gemfile to Heroku's .gems file plus config.gem statements for Rails 2.3 | |
herokuconfig = "" | |
railsconfig = "" | |
gemfile = File.new("Gemfile") | |
gemfile.readlines.each do |line| | |
if line =~ /gem ['"](\w+)['"](?:, ['"](.+?)['"]){0,1}(?:, :require => ['"](.+?)['"]){0,1}/ | |
herokuconfig << "#{$1}" + ($2 ? %Q( --version "#{$2}") : '') + "\n" | |
railsconfig << "config.gem '#{$1}'" + ($2 ? ", :version => '#{$2}'" : '') + ($3 ? ", :lib => '#{$3}'" : '') + "\n" |
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
desc "Deploy to Heroku. Pass APP=appname to deploy to a different app" | |
task :deploy do | |
require 'heroku' | |
require 'heroku/command' | |
user, pass = File.read(File.expand_path("~/.heroku/credentials")).split("\n") | |
heroku = Heroku::Client.new(user, pass) | |
cmd = Heroku::Command::BaseWithApp.new([]) | |
remotes = cmd.git_remotes(File.dirname(__FILE__) + "/../..") |
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
module Sunspot | |
class Setup | |
def more_like_this=(fields) | |
@more_like_this = fields | |
end | |
def more_like_this | |
@more_like_this || [] | |
end | |
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
# an example Monit configuration file for collectiveidea's fork of delayed_job. | |
# See: http://stackoverflow.com/questions/1226302/how-to-monitor-delayedjob-with-monit/1285611 | |
# | |
# To use: | |
# 1. replace {app_name} and {environment} as appropriate | |
# 2. copy to your repository under config/delayed_job.monitrc | |
# 3. add this to your /etc/monit/monitrc: | |
# | |
# include /var/www/apps/{app_name}/current/config/*.monitrc | |
# 4. reload monit when you deploy to pick up any changes to your monitrc files: sudo monit reload |