Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Adapted from: https://gist.github.com/mythmon/4151152
export LEEROY_URL="https://leeroybot.herokuapp.com/"
LEEROY_RERUN="https://raw.github.com/lonnen/leeroy-rerun/master/leeroy-rerun.py"
# Usage
[[ -z $1 ]] && {
echo "Rerun a Leeroy job for Kuma."
@openjck
openjck / kuma-vagrant-reset.sh
Last active August 29, 2015 14:02
Take common steps to fix the Kuma development environment. Basically the equivalent of resetting Firefox or unplugging a router. Restarts as much as possible without losing data.
#!/bin/bash
# Configuration
KUMA_ROOT=/path/to/kuma
# Script
# https://www.youtube.com/watch?v=ckIMuvumYrg
pushd .
cd $KUMA_ROOT
vagrant halt
@openjck
openjck / filter-branch-prepend-and-append
Created December 11, 2014 17:08
Using sed and filter-branch to prepend and append to Git commit messages without newlines
# Prepending text to the five most recent commit messages:
git filter-branch --msg-filter 'sed "s/\(.*\)/[prepended text] \1/g"' HEAD~5..HEAD
# Appending text to the five most recent commit messages:
git filter-branch --msg-filter 'sed "s/\(.*\)/\1 [appended text]/g"' HEAD~5..HEAD
@openjck
openjck / fix-static-drupal-site-filenames.sh
Last active January 18, 2016 01:21
Script that restores original filenames (misc/drupal/index.js -> misc/drupal.js) after following the steps in this article: http://webikon.com/cases/park-your-old-drupal-site
#!/bin/bash
# Fix filenames after making a static copy of a Drupal website. This script
# should only be run after following all of the steps in this article:
#
# http://webikon.com/cases/park-your-old-drupal-site
#
# When the steps in the article are followed, all files are renamed to
# index.[ext], so you end up with a bunch of files like misc/drupal.js.
# This script restores the original filenames (e.g., misc/drupal.js), and
{# Randomly determine if the new heading should be shown #}
{% set show_new_heading = random_boolean() %}
{% if show_new_heading %}
<h1>The Best Documentation Around</h1>
{% endif %}
<script>
window['optimizely'] = window['optimizely'] || [];
@openjck
openjck / bookmarklet-remove-wikipedia-links.js
Last active March 7, 2016 22:39
Simple bookmarket to remove distracting links in Wikipedia articles
@openjck
openjck / bookmarklet-remove-wikipedia-pictures.js
Last active March 8, 2016 01:04
Simple bookmarket to remove pictures in Wikipedia articles
javascript:(function(){$('#mw-content-text .thumb, #mw-content-text img').remove();})();
@openjck
openjck / metrics-graphics-#764.html
Last active August 8, 2017 21:29
HTML document demonstrating the issue described in metricsgraphics/metrics-graphics#764
<!doctype html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8" />
<title>Example</title>
<link href="https://rawgit.com/mozilla/metrics-graphics/4722d8a7aaaea604a942f6b39bd169b9bfa815fb/dist/metricsgraphics.css" rel="stylesheet" />
</head>
<body>
<div id="target"></div>
@openjck
openjck / metrics-graphics-#783.html
Last active December 22, 2017 00:05
HTML document demonstrating the issue described in metricsgraphics/metrics-graphics#783
<!doctype html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8" />
<title>Example</title>
<link href="https://rawgit.com/mozilla/metrics-graphics/b363d82c229fba6a280c9782b8154aad0ac901e7/dist/metricsgraphics.css" rel="stylesheet" />
</head>
<body>
<div id="target"></div>
@openjck
openjck / keybase.md
Created December 5, 2019 05:47
keybase.md

Keybase proof

I hereby claim:

  • I am openjck on github.
  • I am johnkarahalis (https://keybase.io/johnkarahalis) on keybase.
  • I have a public key whose fingerprint is F941 FEA9 729E 1040 6829 CE96 357D 0C1B 6454 146A

To claim this, I am signing this object: