Skip to content

Instantly share code, notes, and snippets.

View a_ferdinand.md

Ferdinand

An unpacked Chrome extension that injects a script, waits a minute, and then throws an Error.

How to use me?

  1. Download or clone me, git clone https://gist.github.com/4c1e9a87f4b0b921711ea6791c265cc0.git
  2. Open chrome://extensions/
  3. Click "Load Unpacked"
  4. Select the "4c1e9a87f4b0b921711ea6791c265cc0" directory
@bkemper
bkemper / gist:ca6ac68b174a047b5ccde3930c8568dc
Last active Nov 17, 2020
How to edit a commit with interactive rebase
View gist:ca6ac68b174a047b5ccde3930c8568dc

While on a branch with a couple of commits, you can edit a commit with interactive rebase. This should be used sparingly and only on branches and never on master.

  1. Checkout the branch

$ git checkout my-branch

  1. Get the ref of the commit that you want to edit from the commit log. (e.g. 67b191fc62eda52b5b208cc4de50df7144a03171)

$ git log

@bkemper
bkemper / ruby-block_strings.md
Last active Jun 14, 2017
Dear Ruby, what about a squished block string?
View ruby-block_strings.md

Ruby supports a number of ways to define a block/multiline string.

  • Concatenation
  • Heredocs
  • Join an array of strings
  • Quotes
  • Shorthand

Here are some explanations:

@bkemper
bkemper / gist:ecb6d7a04a56d5222b9f1d3687fa8080
Created Sep 8, 2016
Script to "Not Watch" all your organizations repositories
View gist:ecb6d7a04a56d5222b9f1d3687fa8080
# Simple utility script to "Not Watch" all the repositories in your GitHub
# organization
#
# @example
# $ GITHUB_ACCESS_TOKEN=MYACCESSTOKEN ruby stop_watching.rb staqapp
require "faraday"
require "json"
NO_CONTENT = 204
@bkemper
bkemper / install
Last active Jan 3, 2017
Instructions to configure Pound for lvh.me
View install
#!/usr/bin/env bash
if [ -z "$(which brew)" ]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if [ -z "$(which pound)" ]; then
brew install pound # http://brewformulas.org/Pound
fi
View keybase.md

Keybase proof

I hereby claim:

  • I am bkemper on github.
  • I am kemper (https://keybase.io/kemper) on keybase.
  • I have a public key ASC99d4a3K26BmZY1SleTE0rPtssrTML9li3LUBykqyqjwo

To claim this, I am signing this object:

@bkemper
bkemper / gist:f3feea7dcbf4b513071e
Last active Sep 15, 2015
Key management with OS X Keychain
View gist:f3feea7dcbf4b513071e
# Too often developers leave keys in unencrypted files (e.g. bash_profile).
# The following are instructions to show how easy it is to create a new keychain
# for your project and fetch the keys.
# Create a keychain for your project
$ security create-keychain <your-project-name>.keychain
# Add keychain to search list (optional)
#
# @note The -s argument sets the list. If you have other keychains, you must
@bkemper
bkemper / gist:431a74c123debc3bb928
Created Jan 20, 2015
Rake task with editor input
View gist:431a74c123debc3bb928
task :with_editor do
require "tempfile"
temp_file = Tempfile.new("notes")
unless editor = ENV["EDITOR"]
abort "Please define your editor."
end
# Open editor
system("#{editor} #{temp_file.path}")