Skip to content

Instantly share code, notes, and snippets.

David Strauß stravid

Block or report user

Report or block stravid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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
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
private
def generate_number
prefix = "R#{Date.today.strftime('%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
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
[
'myapp-production-backups',
'myapp-staging-backups',
'myapp-s3-logs'
]
end
def test_buckets_subdomain_private
buckets.each do |bucket_name|
@tvandervossen
tvandervossen / testing.txt
Created Apr 13, 2011
A small part from a code review report for an iOS app
View testing.txt
Testing
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
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)
ActiveRecord::Base.connection
.execute("EXPLAIN ANALYZE #{query}")
.to_a
.each { |hash| puts hash["QUERY PLAN"] }
nil
@tvandervossen
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
mbleigh / Gemfile
Created Mar 21, 2012
Non-Rails Rackup with Sprockets, Compass, Handlebars, Coffeescript, and Twitter Bootstrap
View Gemfile
source "https://rubygems.org"
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
gem 'handlebars_assets'
gem 'coffee-script'
View gist:2282429
<script>
document.write('<script src=' +
('__proto__' in {} ? 'zepto' : 'jquery') +
'.js><\/script>')
</script>
@voodootikigod
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
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.
Umass.
Second job.
Version control.
Successful since then.
You can’t perform that action at this time.