Skip to content

Instantly share code, notes, and snippets.

@chumpy
chumpy / custom_formatter.rb
Created January 7, 2021 19:37 — forked from mcoms/custom_formatter.rb
When you're having a bad day and just want to skip every failing RSpec test
# frozen_string_literal: true
class CustomFormatter
RSpec::Core::Formatters.register self, :example_failed
def initialize(output)
@output = output
end
def example_failed(notification)
@chumpy
chumpy / .vimrc
Created February 19, 2020 16:02
Vim Config
setlocal expandtab shiftwidth=2 tabstop=2
set number
set nocompatible
syntax enable
filetype plugin on
" FINDING FILES:
" search down into subfolders
@chumpy
chumpy / sample_spec.rb
Created November 12, 2019 23:13
test sample
require 'rails_helper'
describe StoreFront do
describe '#shows_meal_label_line?' do
let(:dc_geo) { FactoryGirl.build(:store_front, name: "DC") }
let(:other_geo) { FactoryGirl.build(:store_front) }
it 'true when multiple lines (aka DC)' do
dc_geo.lines << FactoryGirl.create(:line, name: "Paleo")
dc_geo.lines << FactoryGirl.create(:line, name: "Mix")

Keybase proof

I hereby claim:

  • I am chumpy on github.
  • I am kbeddingfield (https://keybase.io/kbeddingfield) on keybase.
  • I have a public key whose fingerprint is 7AEA FDC5 7533 D5F7 639C 1F65 64FA FEFC 60A9 7D1A

To claim this, I am signing this object:

@chumpy
chumpy / wipe_vim_configs.sh
Created June 23, 2014 15:52
Take Vim back to vanilla
#!/bin/bash
# cleanup vim configs and start again with an empty install
cd
mv .vimrc .vimrc-old
mv .vim .vim-old
touch .vimrc
mkdir .vim
<% @approval_states.each do |step| %>
<li><%= link_to step.state, garden_meal_path(@garden_meal, garden_meal: { id: @garden_meal.id}, approval_state: step.state), method: :put %></li>
<% end %>
@chumpy
chumpy / README.md
Created March 5, 2014 18:49
test for gist-it

All packages in this directory will be automatically loaded

@chumpy
chumpy / distinction.rb
Last active December 25, 2015 21:49
if you're going to hard code the area stuff maybe this is better
#######################
# The following code goes in the distinction model
#######################
# This is the hard-coding alternative to putting these values in the db
DISTINCTION_AREAS = {'01' => 'moira.poe@yale.edu', '02' => 'nicole.chulick@yale.edu'}
def area_email
DISTINCTION_AREAS[self.area]
end
@chumpy
chumpy / state_selector.md
Last active December 18, 2015 15:58
State selector

State Selector

def us_states
  [
    ['Alabama', 'AL'],
    ['Alaska', 'AK'],
    ['Arizona', 'AZ'],
    ['Arkansas', 'AR'],
@chumpy
chumpy / rails_admin_notes.md
Last active December 18, 2015 15:19
rails_admin notes

Accessing model instance inside config block:

field :email do 
  formatted_value do
    bindings[:object].user.email
  end
end