Skip to content

Instantly share code, notes, and snippets.

View vinbarnes's full-sized avatar

Kevin R. Barnes vinbarnes

View GitHub Profile

2013 Reading List

I read sixty-six books this year, one more than last. You can find the full list over at Good Reads, but here are my top picks.

Philosophy

A Manual For Creating Atheists by Peter Boghossian

The best book on teaching critical thinking I have read. Includes "intervention dialogues" transcripts, plenty of research, genuine compassion and empathy for other people, plus a wealth of experience in the author, who has been teaching philosophy and talking about faith for decades.

@pasela
pasela / capture3_with_timeout.rb
Last active October 18, 2023 18:33
[ruby] capture3_with_timeout
# encoding: utf-8
require "timeout"
# Capture the standard output and the standard error of a command.
# Almost same as Open3.capture3 method except for timeout handling and return value.
# See Open3.capture3.
#
# result = capture3_with_timeout([env,] cmd... [, opts])
#

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
#
@bradp
bradp / setup.sh
Last active May 1, 2024 21:34
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
RUBY_GC_HEAP_FREE_SLOTS=600000
RUBY_GC_HEAP_GROWTH_FACTOR=1.25
RUBY_GC_HEAP_GROWTH_MAX_SLOTS=300000
RUBY_GC_HEAP_INIT_SLOTS=600000
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.3
RUBY_GC_MALLOC_LIMIT=64000000
RUBY_GC_OLDMALLOC_LIMIT=64000000
RUBY_HEAP_FREE_MIN=12500
RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
RUBY_HEAP_SLOTS_INCREMENT=100000
@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
@matthewpwatkins
matthewpwatkins / 01-JiraLikeTrello.md
Last active April 21, 2019 11:44
Make Jira's Agile Board look like Trello

Make Jira's Agile Board look like Trello

Do you love the simple, easy-to-use, good-looking interface of Trello? But are you instead forced to use the ugly, complicated "polar bear in a snow storm" Jira agile board for your planning, grooming, and standups? Then this is the pill that just might help you survive, allowing you to use Jira's clunky agile board without giving up your sanity.

To start improving your Atlassian experience, use the browser plugin of your choice to inject the CSS code below into your Jira page (Chrome users: I have really enjoyed this extension if you don't have one already).

Extra credit

Hate Jira's annoying issue editing sidebar that takes precious column space and is too squished to appreciate your ticket anyway? And hate it when you click the ticket title and Jira redirects you to another page? You

@vinbarnes
vinbarnes / changelog_summary.sh
Created November 17, 2015 14:25
get changelog summary
git log -p --no-color --since="5 days ago" -S "*" -- CHANGELOG.md |grep -n "+.*\*" | tr -d '+' | sort -r -n | sed 's/^[0-9]*://g'
[aaron@TC omglolwut (master)]$ cat lib/tasks/disable_autoload_during_migrations.rake
task :disable_autoload do
ActiveSupport::Dependencies.class_eval do
extend Module.new {
def load_file(path, const_paths = loadable_constants_for_path(path))
return if path.starts_with? File.join(Rails.application.root, 'app', 'models')
super
end
}
end