This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#/ Usage: clean-merged-branches | |
#/ Delete locally merged branches | |
set -e | |
# show usage maybe | |
[ "$1" = "--help" ] && { | |
grep '^#/' <"$0"| cut -c4- | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Concerns::Paranoid | |
extend ActiveSupport::Concern | |
included do | |
scope :alive, -> { where deleted_at: nil } | |
scope :dead, -> { where.not deleted_at: nil } | |
instance_method(:destroy).tap do |destroy_method| | |
undef destroy | |
define_method(:delete_forever, destroy_method) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM_NAME = "ls-secure_gmaps" | |
COMMIT_MESSAGE = "update to latest ls-secure_gmaps\n This makes sure all calls are made with the correct keys for our new contract" | |
APPS = ["browse", "browse-service", "escapes", "events", "preferences", "sponsors"] | |
CMDS = ["git pull origin master", | |
"bundle install", | |
"bundle exec rake", | |
"bundle update #{GEM_NAME}", | |
"bundle exec rake", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Insufficiency of Good Design | |
We all want to write good code, and there is no shortage of advice on | |
how to do that. SOLID. SOA. SRP. LoD. These are undoubtedly important, | |
but none of them address the single factor that has the biggest impact | |
on the quality of a codebase. | |
That factor is Other People. The people you're working with affect the | |
codebase more than you do, in aggregate, if there's more than a few of | |
them. And it's not just the individuals. How your team is organized, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Clone heroku environment variables to a .env file for foreman'" | |
namespace :heroku do | |
namespace :env do | |
task :clone => :environment do | |
ignore_list = [ | |
"DATABASE_URL", | |
"GEM_PATH", | |
"LANG", | |
"LOG_LEVEL", | |
"PATH", |
- Baan Thai - Small hole in the wall on the College campus, pretty much the best Thai Food I have found
- Biwa - Awesome Japanese Izakaya place. I love this place so much and the owner Gabe is super nice. Get the Ramen unless it's about a million degrees. The Kara age is amazing too.
- Bailey's Best beer spot in Portland. 20 rotating taps (almost) always from the west coast and mostly local to Portland. They never replace the a keg with the same beer so it's always a different lineup. Geoff and Michael know their shit so you can always ask for advice.
- Bunk Sandwiches Some of the best sandwiches I've had. The pork belly bahn mi is to die for if they have it. They have a sister place called bunk bar that's open for dinner too, but I'm partial to the lunch only original.
Data integrity is an underrated part of proper application architecture. Many of the bugs in production systems are triggered by missing or malformed user data. If a user can possibly screw it up or screw with it, they will. Validations in the model can help!
Before we begin, let's talk about syntax. There are two primary syntaxes for writing validations in Rails 3:
validates_presence_of :price
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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") |
NewerOlder