Skip to content

Instantly share code, notes, and snippets.


David Strauß stravid

View GitHub Profile
View What is a Product Manager?
Somebody asked me how to become a Product Manager. Here's what I wrote them.
Hi Jon,
Those are a lot of questions. Let me try to simplify it.
I think a Product Manager is a person who is responsible for determining
what a product should be and how it should evolve. This is a design role
clemens / invoice.rb
Created Jul 24, 2014
invoice number generation per year
View invoice.rb
class Invoice < ActiveRecord::Base
before_validation :generate_number, on: :create
def generate_number
prefix = "R#{'%y')}-"
last_order_number_this_year = self.class.where("number LIKE ?", "#{prefix}%").order("number DESC").limit(1).pluck(:number).first
number = last_order_number_this_year ? last_order_number_this_year.match(/\A#{prefix}(\d+)\z/)[1].to_i : 0
thbar / private_buckets_test.rb
Last active Aug 29, 2015
Production sanity test to verify that S3 buckets remain private over time
View private_buckets_test.rb
def buckets
def test_buckets_subdomain_private
buckets.each do |bucket_name|
tvandervossen / testing.txt
Created Apr 13, 2011
A small part from a code review report for an iOS app
View testing.txt
Automated testing (even though still not widely used by Objective-C developers) would make
refactoring much easier, faster and safer. Good test coverage would also allow maintenance
to be done and new features to be added without first having to fully investigate the
function of all parts of the codebase and the way these parts fit together. This especially
applies when work is contracted out to developers other than those who originally created
the application.
The lack of a comprehensive automated test suite is a real disadvantage. Adding one is
sirupsen / explain.rb
Created Dec 6, 2011
.ircrb entry to run explain on a query.
View explain.rb
if defined? ActiveRecord
def explain(query)
query = query.to_sql if query.is_a?(ActiveRecord::Relation)
.execute("EXPLAIN ANALYZE #{query}")
.each { |hash| puts hash["QUERY PLAN"] }
tvandervossen / gist:1478543
Created Dec 14, 2011
Initial client lead questions
View gist:1478543
Can you please answer the following questions so we can assess the project,
and judge if we would be a good match?
1. Is this a new project, or is this for an existing website or application?
- This is a project for a completely new site or application
- This is a project to update an existing site or application
2. Which of the following areas do you need help with?
mbleigh / Gemfile
Created Mar 21, 2012
Non-Rails Rackup with Sprockets, Compass, Handlebars, Coffeescript, and Twitter Bootstrap
View Gemfile
source ""
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
gem 'handlebars_assets'
gem 'coffee-script'
View gist:2282429
document.write('<script src=' +
('__proto__' in {} ? 'zepto' : 'jquery') +
voodootikigod / migrate.js
Created Jan 3, 2012
Schema (SQL) and Data (JS) Migrations for node.js (specifically PostgreSQL, but could be MySQL)
View migrate.js
#!/usr/bin/env node
// this file is stored in a directory of APP_ROOT/script for me, all things are relative to that
var APP_ROOT = __dirname+"/../";
// this assumes there is a file stored in APP_ROOT called "config.js" with the following structure:
// module.exports = {
// "development: {
// "postgresql": "tcp://postgres@localhost/dev-db"
r00k / gist:5885955
Created Jun 28, 2013
Notes for my talk at Engineers4Engineers at Constant Contact on 6/28/13.
View gist:5885955
My name is Ben Orenstein and I work at thoughtbot in Boston.
Notes will be published.
I'd like to tell you a story. (5:42)
I've never talked about this publicly.
Second job.
Version control.
Successful since then.
You can’t perform that action at this time.