Skip to content

Instantly share code, notes, and snippets.


Jonathan M. Hollin PerpetualBeta

View GitHub Profile
PerpetualBeta / karabiner.json
Created Jun 30, 2017
Karabiner Configuration File
View karabiner.json
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
"profiles": [
"complex_modifications": {
"parameters": {
PerpetualBeta / sw.js
Created Jun 11, 2017
Perpetual βeta Service Worker
View sw.js
'use strict';
const version = 'v1.17l::';
const staticCacheName = version + 'pwa';
const pagesCacheName = version + 'pages';
const imagesCacheName = version + 'assets';
const offlinePage = '/local-offline.html';
const weblogSlug = '/weblog/';
const cacheList = [
PerpetualBeta /
Last active Jan 7, 2017
Network status monitor for BitBar (
EXTERNAL_IP_LABEL='IP Address (external): '
ACQUIRE_EXTERNAL_IP='/usr/local/bin/wget -qO-'
PerpetualBeta / srcset_factory.php
Created May 15, 2016
Factory for producing `srcset` image sets
View srcset_factory.php
#!/usr/bin/env php
/* Inspired by: */
# BEGIN: Configuration
$config = array (
'breakpoints' => array(10, 80, 480, 768, 820, 1024, 1280, 1640),
'group_breakpoints' => TRUE, // if TRUE, will group the images into folders for each breakpoint
PerpetualBeta / loading.svg
Created May 15, 2016
Spinning activity indicator.
View loading.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
PerpetualBeta / create_drop_all_dbs.sql
Last active Aug 29, 2015
A MySQL script that will generate a list of statements to drop all DBs on a server.
View create_drop_all_dbs.sql
-- Run this script
SELECT CONCAT('DROP DATABASE `', schema_name, '`;') AS stmt
FROM information_schema.schemata
WHERE schema_name NOT IN ('information_schema', 'performance_schema', 'mysql')
-- Copy the output into your clipboard

Keybase proof

I hereby claim:

  • I am PerpetualBeta on github.
  • I am jhollin ( on keybase.
  • I have a public key whose fingerprint is 9547 E5D6 4590 94C5 D627 F8BC 1616 3E98 79D4 DF03

To claim this, I am signing this object:

PerpetualBeta / gist:6845202
Created Oct 5, 2013
Bash script to recursively chmod the permissions of files or folders.
View gist:6845202
# Traverse a directory starting at $path and change the permissions of all files
# or folders (determined with options) to $permissions
helpText=$"Usage: ${0##*/} -(f|d) permissions path";
if [[ $path ]]
PerpetualBeta / gist:6653157
Created Sep 21, 2013
Bash script header to elevate a script that needs to run as "root" if it is run without sudo. Background here:
View gist:6653157
# /bin/sh
if [ "$(whoami)" != 'root' ]; then
echo 'This script must be run as "root".'
echo 'Enter password to elevate privileges:'
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
SELF=`basename $0`
exit 1
PerpetualBeta / fixedTableHeader.js
Created Dec 9, 2012
On large HTML tables, in a height-constricted viewport, keeps the 'thead' visible while the table is scrolled.
View fixedTableHeader.js
fixedTableHeader: function(options) {
var defaults = { wrapper : null, offset : 0 };
options = $.extend(defaults, options);
return this.each(function() {
var o = options;
if (o.wrapper === null) { $(this).wrap('<div class="w" />'); o.wrapper = $('.w'); }
var scrollbarWidth = function(){var a=$('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div></div>');$('body').append(a);var b=$('div',a).innerWidth();a.css('overflow-y','auto');var c=$('div',a).innerWidth();$(a).remove();return b-c;};
$(this).clone().appendTo(o.wrapper).wrap('<div class="b" />');
You can’t perform that action at this time.