Skip to content

Instantly share code, notes, and snippets.

Living on a sailboat

Brandon Keepers bkeepers

Living on a sailboat
View GitHub Profile
bkeepers / .env
Last active Nov 2, 2020
Probot plugin that ensures every commit message has the word "bananas"
View .env
# The ID of your GitHub App
# Uncomment this to get verbose logging
# LOG_LEVEL=trace # or `info` to show less
# Go to set this to the URL that you are redirected to.
bkeepers /
Last active Aug 9, 2020
Keep two HTML5 video elements in sync.
videos = document.getElementsByTagName('video')
new VideoSync(videos[0], videos[1])
bkeepers / .profile
Created Jun 19, 2009
Split bash profile into multiple files
View .profile
# My ~/.profile file was getting too messy and unmaintainable, so I
# split everything out into separate files and sourced them
for file in ~/.profile.d/*
source $file
bkeepers / application.rb
Created May 13, 2020
Add methods to `rails console`
View application.rb
module SailboatGuide
class Application < Rails::Application
console do
require 'console_helpers'
TOPLEVEL_BINDING.eval('self').extend ConsoleHelpers
bkeepers / .gitconfig
Created Feb 19, 2013
Git aliases to make new commits that fixup or are squashed into previous commits
View .gitconfig
fixup = !sh -c 'REV=$(git rev-parse $1) && git commit --fixup $@ && git rebase -i --autosquash $REV^' -
squash = !sh -c 'REV=$(git rev-parse $1) && git commit --squash $@ && git rebase -i --autosquash $REV^' -
bkeepers / application.js
Created Mar 3, 2010
Get timezone offset from the browser and use it for timezones in Rails
View application.js
jQuery(function() {
$.cookie('tz', (new Date()).getTimezoneOffset());
bkeepers /
Created May 14, 2013
Frameworks for building HTML+CoffeeScript+[CSS-preprocessor] sites.
bkeepers /
Last active Jan 20, 2018
Tell me your story about how open source has impacted your career.

I’m working on a talk about the relationship between community participation and careers, and want to hear from people who feel like open source has impacted their career. Tell me your story!

Below are some questions related to get you started. Feel free to either fork this gist, blog your answers and send me the link, or email them directly to me at I will ask your permission before sharing anything about your story publicly.

  • How do you feel your participation in open source has impacted your career, both good and bad?

  • How did you first get exposed to open source? Why did you decide to learn more about it?

  • Do you code? If so, were you a coder when you got started with open source? Why did you learn to code?

bkeepers / delete-comment.js
Created Sep 14, 2017
Probot app to delete 👍 and single emoji comments.
View delete-comment.js
// :+1: comments and single emoji
const pattern = /^\W*(:[\w-\+]+:|[\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])\W*$/g;
module.exports = robot => {
robot.on('issue_comment.created', context => {
if(context.payload.comment.body.match(pattern)) {
bkeepers / api_spec.rb
Created Sep 20, 2013
Use HyperClient to test your Hypermedia API
View api_spec.rb
# spec/features/api_spec.rb
require 'spec_helper'
describe 'API' do
class TestClient < Hyperclient::EntryPoint
def default_faraday_block
lambda do |faraday|
faraday.request :json
faraday.response :json, content_type: /\bjson$/
faraday.adapter :rack,
You can’t perform that action at this time.