Skip to content

Instantly share code, notes, and snippets.

View vinbarnes's full-sized avatar

Kevin R. Barnes vinbarnes

View GitHub Profile

There's no general rule you can follow here, because it's always going to depend on context. In my experience the kind of feedback loops you create, and the kind of safety nets you need are defined entirely by the domain, the organization, and the team culture.

Here are a few examples:

  1. I do a bit of work for a medium-sized dental clinic. The business manager there is really fun to work with, but has the tendency of changing his mind six times before he settles his ideas. So when he asks for a report, I don't put any effort at all into writing tests or worrying about minor bugs even, because my only goal is to flesh out in code something vaguely resembling what he asked for.

Often times, this means doing a handful of 30 minute prototypes until the requirements settle, each of which would have taken me 2 hours if I drove them via TDD. When things finally cool down, I evaluate the complexity and maintainability of the resulting code and either leave it untested, add some acceptance tests, backfill unit tes

@gnarmis
gnarmis / git-recent-branches
Last active August 29, 2015 14:01
List Git Branches by Recency
#!/bin/bash
#
# Blame @gnarmis if this doesn't work
#
# Put this anywhere on your $PATH (~/bin is recommended). Then git will see it
# and you'll be able to do `git recent-branches`.
#
# Show top 5 most recent branches:
# $ git recent-branches | head -n 5
#
@stephenyeargin
stephenyeargin / roll-slack-webhooks.rb
Last active August 29, 2015 14:17
Roll Slack Webhooks
require 'octokit'
# Config
GITHUB_API_TOKEN = '<a token>'
GITHUB_ORGANIZATION = '<an organization>'
###
client = Octokit::Client.new(
access_token: GITHUB_API_TOKEN
gist_ql()
{
GIST=$1
TMPFILE=~/tmp/gist_$GIST
gist $GIST > ~/tmp/gist_$GIST
qlmanage -c public.plain-text -p $TMPFILE >& /dev/null
}
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
MY_NAME = 'Yossef Mendelssohn'
CHECKIN_REQUEST_URL = 'http://www.southwest.com/flight/retrieveCheckinDoc.html'
prompt = false
conf = ARGV[0]
require 'spec/runner/formatter/progress_bar_formatter'
class NescafeFormatter < Spec::Runner::Formatter::ProgressBarFormatter
def example_failed(example, counter, failure)
super
dump_failure(counter, failure)
end
end
@jupp0r
jupp0r / emacs.rb
Created March 1, 2012 01:11
Homebrew Formular enabling Lion Fullscreen for Emacs 24 git HEAD
require 'formula'
class Emacs < Formula
homepage 'http://www.gnu.org/software/emacs/'
url 'http://ftpmirror.gnu.org/emacs/emacs-23.4.tar.bz2'
mirror 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.4.tar.bz2'
md5 '070c68ad8e3c31fb3cb2414feaf5e6f0'
fails_with_llvm "Duplicate symbol errors while linking.", :build => 2334
@eric
eric / _using_it.rb
Created March 16, 2012 20:41
Use Arel in Rails 2.3
>> engine = ArelBack::Engine.new(ar.connection, Arel::Visitors::MySQL)
>> table = Arel::Table.new(ar.table_name, engine)
>> table.project(Arel.sql('*')).to_sql
=> "SELECT * FROM `awesome_table` "
>>
$(document).ready(function() {
// automatically fix obfuscated email addresses pasted into
// to/cc/bcc fields
$("textarea[name=to], textarea[name=cc], textarea[name=bcc]")
.live('blur', function(e){
var text = $(this).val();
var separators = ['_', ' ', '\\[', '\\]', '\\(', '\\)'];
var separatorExp = '(' + separators.join('|') + ')+';
Nature's first green is gold,
Her hardest hue to hold.
Her early leaf's a flower;
But only so an hour.
Then leaf subsides to leaf.
So Eden sank to grief,
So dawn goes down to day.
Timezones: they're here to stay.