Skip to content

Instantly share code, notes, and snippets.

View smoovej's full-sized avatar

Jeremy Frazao smoovej

  • Google
  • Boulder, CO
View GitHub Profile
@smoovej
smoovej / setup-statsd.sh
Created January 12, 2012 21:19 — forked from collegeman/setup-statsd.sh
Turn an Ubuntu 10.04 linode into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
@smoovej
smoovej / gist:2831159
Created May 29, 2012 22:23
Clear memcached on Heroku
heroku run bundle exec rails console --app flixmaster
require "dalli"
dc = Dalli::Client.new
dc.flush
@smoovej
smoovej / gist:2854576
Created June 1, 2012 19:28
NBC API error
2012-06-01T19:22:59+00:00 heroku[router]: GET adsgame.heroku.com/images/mark.png dyno=web.1 queue=0 wait=0ms service=4ms status=200 bytes=546
2012-06-01T19:22:59+00:00 heroku[nginx]: 75.70.205.204 - - [01/Jun/2012:19:22:59 +0000] "GET /images/mark.png HTTP/1.1" 200 546 "http://adsgame.heroku.com/projects/654?debug_assets=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5" adsgame.heroku.com
2012-06-01T19:23:00+00:00 heroku[router]: GET adsgame.heroku.com/images/popup_close_btn.png dyno=web.1 queue=0 wait=0ms service=4ms status=200 bytes=470
2012-06-01T19:23:00+00:00 heroku[nginx]: 75.70.205.204 - - [01/Jun/2012:19:23:00 +0000] "GET /images/popup_close_btn.png HTTP/1.1" 200 470 "http://adsgame.heroku.com/projects/654?debug_assets=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5" adsgame.heroku.com
2012-06-01T19:23:00+00:00 app[web.1]:
2012-06-01T19:23:00+00:00 a
@smoovej
smoovej / deploy.rb
Created June 5, 2012 03:53 — forked from jcanfield/deploy.rb
Heroku Deployment Script
#!/usr/bin/env ruby
# Usage
# ./deploy [staging|production] <options>
#
# Options
# -m or --maintenance - Put the application into maintenance mode
# -b or --branch - deploy from a branch other than "master"
if ['staging', 'production'].include? ARGV[0]
class TripProviders::WebService::SubscriptionPaymentsController < TripProviders::WebServiceController
def create
# unless params.has_key?( :data )
# return head :unprocessable_entity
# end
# errors = {}
city = 'Lima' if city == 'Lima, Cusco, Sacred Valley'
city = 'Yukon' if city == 'Yukon'
city = 'San Francisco' if city == 'Bay Area'
city = 'Geneva' if city == 'Geneva, Anthy'
city = 'Denver' if city == 'Denver/Boulder'
city = 'Los Gatos' if city == 'Castle Rock State Park'
city = 'Kars' if city == 'Kars, Ardahan, Artvin'
city = 'Alicante' if city == 'Bollua near Alicante'
city = 'Mount Rainier' if city == 'Mt. Rainier National Park'
city = 'Mount Shasta' if city == 'Mt. Shasta'
def show
@article = Article.find(params[:id])
respond_to do |format|
format.html
format.json { render json: @article.as_json(only: [:id, :name, :content], include: [:author, {comments: {only:[:id, :name, :content]}}]) }
end
end
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
// Does this belong in the resolvers Seq?
// resolvers += Classpaths.typesafeResolver
val conspireSettings = Project.defaultSettings ++ Seq(
version := appVersion,
scalaVersion := V.Scala,
exportJars := true,
parallelExecution in Test := false,
resolvers ++= Seq(
"Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases",