Skip to content

Instantly share code, notes, and snippets.

View coxandrew's full-sized avatar

Andrew Cox coxandrew

View GitHub Profile

Watchful Waiting (CDC)

  • As of 2023, the CDC recommends Watchful Waiting for Ear Infections
    • If your child is feeling better over the next 2-3 days, no further treatment should be needed
    • Call your healthcare professional right away if your child has any of the following:
      • Fever of 102.2°F (39°C) or higher
      • Fluid draining from the ear

Watchful Waiting (UPMC)

class BacklogWidget < Apotomo::Widget
PivotalTracker::Client.token = APP_CONFIG["pivotal"]["api_key"]
def display
project_config = APP_CONFIG["pivotal"]["projects"]["firefly"]
project = PivotalTracker::Project.find(project_config["id"])
iteration = PivotalTracker::Iteration.current(project)
@filter_labels = get_labels(params[:labels])
@stories = get_stories(iteration, @filter_labels)
@coxandrew
coxandrew / what-next.md
Created July 31, 2012 02:19
What Next? Talk notes

Title

  • What's next
    • or: What I wish I knew 10 years ago

Target audience

  • Someone who has just attended their first conference

Background

@coxandrew
coxandrew / git-flow-example.sh
Created July 25, 2012 15:43
Git release branching workflow
#!/bin/bash
set -eux
## ***************************************************************************
## Reset local and remote repositories
## ***************************************************************************
REMOTE_REPOSITORY=~/scm/git-flow-ex
DEVELOPER_CHECKOUT=~/dev/git-flow-ex
rm -rf $REMOTE_REPOSITORY
* Get away from the idea of "getting things done"
* We always have the sense of wanting to get it done
* This sense causes us to rush a little bit; cut some corners (that you *should* cut because you're trying to get stuff down)
* When you're cutting corners, you're not going to try to do something you don't know how to do
* Goal: shrink the gap between your day-to-day code quality and the ideal
* It's not practice that makes perfect - it's perfect practice that makes perfect
* Today is the day you write perfect code
* Focus on the 4 Rules of Simple Design
* This problem was picked because it's too big to finish in 45 minutes
* After the 1st session, walk around and ruthlessly mock their code
h3 {
background: #efefef;
border: 1px solid #ccc;
padding: 1em;
width: 600px;
}
.filter_text {
float: left;
line-height: 30px;
margin-right: 10px;
require 'spec_helper'
describe ProjectsController do
def mock_project(stubs={})
@mock_project ||= mock_model(Project, stubs).as_null_object
end
before(:each) do
controller.stub!(:current_user).and_return(@current_user)
end
class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :current_user
helper_method :current_project
helper_method :user_projects
before_filter :login_required
private

BDD

  • Cucumber
  • Pickle
  • Capybara

Factories

  • FactoryGirl
module PlayingCards
SUITS = [:spades, :hearts, :diamonds, :clubs]
class Card
attr_reader :suit, :value
class InvalidCardError < StandardError; end
def initialize(value, suit)
raise InvalidCardError unless SUITS.include?(suit.downcase.to_sym)
raise InvalidCardError if value == "nothing"