Skip to content

Instantly share code, notes, and snippets.

View fielding's full-sized avatar
🙊

Fielding Johnston fielding

🙊
View GitHub Profile
@fielding
fielding / worker-inline-css.js
Last active January 16, 2022 22:47 — forked from Nooshu/worker-inline-css.js
Use a CF worker to add inline CSS to the head.
// set the site we are modifying
const site = 'www.example.com';
// do this on a fetch
addEventListener('fetch', event => {
const request = event.request
const url = new URL(request.url)
event.respondWith(handleRequest(request))
});
@fielding
fielding / amps.rb
Created December 6, 2017 02:22 — forked from i8degrees/amps.rb
the effects of sleep deprivation on the logical mind
#!/usr/bin/env ruby
class NomNom
def initialize(io)
# ...I'm not writing this class over again, hoe!
end
end
class SuperYumNom < NomNom
@fielding
fielding / hosts
Last active June 15, 2018 19:39 — forked from i8degrees/hosts.latest
Ye'old pirates host config - hopefully early of a few revisions
# hosts
#
# Ye' Old Pirates Host config
# by fielding and i8degrees
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
@fielding
fielding / ascii.cheatsheet
Last active May 3, 2016 20:59 — forked from xero/ascii.cheatsheet
box drawing cheat sheet for ascii art
╓─────[ box drawing cheat sheet ]
╙────────────────────────────────────── ─ ─
─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏
┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟
┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯
@fielding
fielding / git-multi-status.sh
Last active August 29, 2015 14:12 — forked from c0wfunk/git-multi-status.sh
script to recursively view the status of multiple git repositories
#!/bin/bash
# original at https://gist.github.com/c0wfunk/3666392
# revised by Fielding Johnston for personal use
# most recent available at
# https://gist.github.com/justfielding/f64f7729ae1c0683e3c9
# usage: $0 source_dir [source_dir] ...
# where source_dir args are directories containing git repositories
@fielding
fielding / conditional-url-forwarding.js
Created March 13, 2012 01:58 — forked from tomeast/conditional-url-forwarding.js
Conditional URL rewrite forwarding
var http = require('http'),
httpProxy = require('http-proxy');
//
// Create a new instance of HttProxy to use in your server
//
var proxy = new httpProxy.HttpProxy();
//will match the root url or
//a request for any html pages