Skip to content

Instantly share code, notes, and snippets.

View amerine's full-sized avatar
🌅
Out West

Mark Turner amerine

🌅
Out West
View GitHub Profile

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

package main
import (
"bufio"
"fmt"
"os"
"time"
)
const numWorkers = 3
Host *+*
ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') nc $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/:/ /')
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
@amerine
amerine / tpl-basicapp.rb
Created May 15, 2012 07:28 — forked from jetspeed/tpl-basicapp.rb
Rails 3, RSpec, Factory_Girl, HAML, SASS, Devise, JQuery, Backbone.js, jammit, haml.js
## Rails App Template
## Useful for Rails 3.0.x and Ruby 1.9.2
## Run using $ rails new [appname] -JT -m tpl-basicapp.rb
# ========
# = Gems =
# ========
# pre-install spork, dydram and elastic_searchable
run "gem install spork -v 0.9.0.rc --pre"
@amerine
amerine / connection_fix.rb
Created December 31, 2011 00:28 — forked from defunkt/connection_fix.rb
MySQL server has gone away fix
# If your workers are inactive for a long period of time, they'll lose
# their MySQL connection.
#
# This hack ensures we re-connect whenever a connection is
# lost. Because, really. why not?
#
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar)
#
# From:
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/
@amerine
amerine / gist:1265199
Created October 5, 2011 18:10 — forked from kalv/gist:913392
Clear out Resque messages that have Decode errors.
# Use from console, was required as old messages were incorrectly encoded and placed on the failed queue
# preventing us to view the failed queue.
include Resque::Helpers
Resque::Failure.count.times do |index|
puts "Checking #{index}"
begin
decode Resque.redis.lindex(:failed, index)
rescue Resque::Helpers::DecodeException
@amerine
amerine / rspec-syntax-cheat-sheet.rb
Created July 1, 2011 23:20 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@amerine
amerine / app.rb
Created February 22, 2011 07:25 — forked from densone/gist:838331
require 'rubygems'
require 'bundler'
Bundler.require(:default)
REST OF YOUR APP
desc "Rebuild localhosts"
task(:rebuild_localhosts => :environment) do
ClientDomain.rebuild_localhosts
end
def signup
user = User.new(blah blah blah)
begin
UserMailer.email_confirmation(user).deliver
rescue Exception => e
handle error
end
end