Skip to content

Instantly share code, notes, and snippets.

@eprothro
eprothro / PEC Action Required
Created January 31, 2012 23:40
PEC Clean Water Action
Date: January 30, 2012
R.B. Sloan
Chief Executive Officer
Pedernales Electric Cooperative
P.O. Box 1
Johnson City, TX 78636
Dear PEC Bard Members and PEC Staff:
source :rubygems
gem 'rails', '3.1.2'
gem 'asset_sync', '~> 0.4.1'
gem 'awesome_print', '~> 1.0.2'
gem 'authorize-net', '~> 1.5.2'
gem 'cells', '~> 3.8.3'
gem 'countries', '~> 0.8.2'
gem 'dalli', '~> 2.0.4'
source :rubygems
gem 'rails', '3.1.2'
gem 'asset_sync', '~> 0.4.1'
gem 'awesome_print', '~> 1.0.2'
gem 'authorize-net', '~> 1.5.2'
gem 'cells', '~> 3.8.3'
gem 'countries', '~> 0.8.2'
gem 'dalli', '~> 2.0.4'
tddium suite
Looks like you haven't set up a suite on this computer for youversion-web/mobile...
Enter a repo name or press 'Return'. Using 'youversion-web' by default: 'youversion-web/mobile'
... Detected branch mobile
... Detected ruby ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin11.2.0]
... Detected bundle Bundler version 1.1.3
... Detected gem 1.8.15
>>> Tddium selects tests to run by default (e.g., in CI) by matching against a
list of Ruby glob patterns. Use "," to join multiple globs.
@eprothro
eprothro / cache.rake
Last active December 14, 2015 09:29
A simple rake file with tasks to: 1) clear the rails cache 2) give statistics for a memcache protocol store (e.g., Dalli)
namespace :cache do
task :clear => :environment do
puts "=> Clearning Rails cache..."
Rake::Task["cache:stats"].invoke
puts "\n `Rails.cache.clear` => " + Rails.cache.clear.to_s + "\n\n"
# manually reset the stats, as clearing the cache doesn't do so
Rails.cache.dalli.reset_stats if Rails.cache.try(:dalli).respond_to? :reset_stats
Rake::Task["cache:stats"].reenable
@eprothro
eprothro / gist:5065952
Last active December 14, 2015 09:38
not crap makes...

Importing images for models done with missing images for the following 76 models:

  • /hyundai/elantra.jpg
  • /hyundai/azera.jpg
  • /honda/goldwing.jpg
  • /nissan/maxima_3.5.jpg
  • /saturn/ion.jpg
  • /chevrolet/k_1500.jpg
  • /chevrolet/c150.jpg
  • /chevrolet/express.jpg
@eprothro
eprothro / communication via narrative.md
Last active January 4, 2023 16:58
Connextra, Gherkin, and Free-form prose for multidisciplinary communication via narrative.

Overview

Getting clients, managers, project managers, designers, and developers on the same page when it comes to feature expectations is hard. Everyone speaking the same language (literally) can go a long way to achieving the same, metaphorically.

There are three common formats that are great for written and verbal communication between stakeholders with different backgrounds, responsibilities, and risk exposures. They are each natural-language, narrative formats (they use plain english) that anyone can understand, but their structrued nature is proven to help clearly communicate behavior, specify intent and synchronize expectations.

Connextra user stories

  • Great for high level feature description
  • Typically bad for detailed behavior description
@eprothro
eprothro / shards.yml
Created April 12, 2013 19:28
Dynamic Octopus configuration for master/slave horizontal DB scaling with a Rails application on the Heroku stack. See the wiki page for more info: https://github.com/tchandy/octopus/wiki/Replication-with-Rails-on-Heroku. Props to Heroku for the idea, gleaned from the dynamic database.yml they inject at build-time for rails apps.
<%
require 'cgi'
require 'uri'
def attribute(name, value, force_string = false)
if value
value_string =
if force_string
'"' + value + '"'
else
@eprothro
eprothro / octopus.rb
Last active December 16, 2015 04:08
Octopus initializer for use with master/slave horizontal DB scaling with a Rails application on the Heroku stack. See the wiki page for more info: https://github.com/tchandy/octopus/wiki/Replication-with-Rails-on-Heroku
module Octopus
def self.shards_in(group=nil)
config[Rails.env].try(:[], group.to_s).try(:keys)
end
def self.followers
shards_in(:followers)
end
class << self
alias_method :followers_in, :shards_in
alias_method :slaves_in, :shards_in

<Feature name, noun>

Feature Description

As a User
I want to <do something conceptually simple>
So that <motivation for doing that thing>