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 |
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 |
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| |
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 |
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 |
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? |
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> |
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" |
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. |
OlderNewer