Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan M. Hollin PerpetualBeta

View GitHub Profile
@PerpetualBeta
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')
ORDER BY SCHEMA_NAME;
-- Copy the output into your clipboard
SET FOREIGN_KEY_CHECKS = 0;
@PerpetualBeta
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
PerpetualBeta / srcset_factory.php
Created May 15, 2016
Factory for producing `srcset` image sets
View srcset_factory.php
#!/usr/bin/env php
<?php
/* Inspired by: https://github.com/MattWilcox/Adaptive-Images */
# 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
PerpetualBeta / network_status.sh
Last active Jan 7, 2017
Network status monitor for BitBar (https://getbitbar.com/)
View network_status.sh
#!/bin/bash
PING_TIMEOUT=2
PING_ADDRESS=8.8.8.8
PING_STATUS=false
EXTERNAL_IP_LABEL='IP Address (external): '
ACQUIRE_EXTERNAL_IP='/usr/local/bin/wget -qO- http://ipecho.net/plain'
EXTERNAL_IP_ADDRESS="$(eval "$ACQUIRE_EXTERNAL_IP")"
EXTERNAL_IP="${EXTERNAL_IP_LABEL}${EXTERNAL_IP_ADDRESS}"
VPN_STATUS=false
@PerpetualBeta
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
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": {
You can’t perform that action at this time.