Skip to content

Instantly share code, notes, and snippets.

View bronzehedwick's full-sized avatar
🐌
digging in

Chris DeLuca bronzehedwick

🐌
digging in
View GitHub Profile
@bronzehedwick
bronzehedwick / gist:73433126907b2f1ad3df2de268708f91
Created December 21, 2019 17:48
Output from Debian `apt-get dist-upgrade`
create mode 120000 ssl/certs/ff34af3f.0 [0/1871]
delete mode 120000 ssl/certs/ff783690.0
delete mode 120000 ssl/certs/spi-cacert-2008.pem
create mode 120000 systemd/system/default.target.wants/watchdog.service
delete mode 120000 systemd/system/hibernate.target.wants/anacron-resume.service
delete mode 120000 systemd/system/hybrid-sleep.target.wants/anacron-resume.service
create mode 120000 systemd/system/multi-user.target.wants/collectd.service
create mode 120000 systemd/system/multi-user.target.wants/nmbd.service
create mode 120000 systemd/system/multi-user.target.wants/rsync.service
create mode 120000 systemd/system/multi-user.target.wants/smbd.service
@bronzehedwick
bronzehedwick / ctags
Created November 13, 2019 16:54
Copying tpope's updated git ctags file
#!/bin/sh
set -e
if [ -d doc -a \( -d autoload -o -d ftdetect -o -d plugin \) ]; then
nohup vim -u NONE -c 'helptags doc' -cq >/dev/null 2>&1 </dev/null &
fi
optfiles=`git ls-files -oc --directory -- .ctags '*/.ctags'`
@bronzehedwick
bronzehedwick / dnd-stat-modifier.js
Last active July 27, 2019 19:15
Function to generate a D&D/Pathfinder stat modifier
function generateStatMod(score) {
return Math.floor((score - 10) / 2);
}
Verifying my Blockstack ID is secured with the address 1145uHcCDSoHNahWxJ42trCt1dfcmxH5jk https://explorer.blockstack.org/address/1145uHcCDSoHNahWxJ42trCt1dfcmxH5jk
@bronzehedwick
bronzehedwick / characters.js
Created February 20, 2019 18:48
Small node script to generate a markdown file with every character mentioned in a .fountain script file
#!/usr/local/bin/node
/* eslint-env node, es6 */
const fs = require('fs');
const file = process.argv[2];
const path = require('path');
const lineReader = require('readline').createInterface({
input: fs.createReadStream(file)
});
let characters = new Map();
@bronzehedwick
bronzehedwick / post-receive
Created March 15, 2018 02:57
Git post receive hook to deploy a hugo site
#!/bin/sh
GIT_DIR=/path/to/hugo/source
WEB_DIR=/path/to/webroot
# pull the latest code.
git --git-dir "$GIT_DIR/.git" --work-tree "$GIT_DIR" pull origin master
git --git-dir "$GIT_DIR/.git" --work-tree "$GIT_DIR" checkout --force
# build the site.
hugo --source "$GIT_DIR" --destination "$WEB_DIR"
@bronzehedwick
bronzehedwick / chat.sh
Created March 6, 2018 15:33
Simple script to start or re-attach weechat with dtach
#!/bin/sh
command -v dtach >/dev/null 2>&1 || { echo >&2 "Need dtach installed. Aborting." exit 1; }
command -v weechat >/dev/null 2>&1 || { echo >&2 "Need weechat installed. Aborting." exit 1; }
if [ -f /tmp/weechat ]; then
dtach -a /tmp/weechat
else
dtach -A /tmp/weechat weechat
fi
0482ad68d15afc1441d336db5b6eb1c06a8d29b5b1aed4a02173430d36ff5cf46525f4e4b3f46f8055fe678e7f47e027a9b77180bef0ab8aca6274025fa71eb737
@bronzehedwick
bronzehedwick / bullshit-fantasy-name-generator.js
Created January 19, 2018 17:48
A dumb script that pops out an even dumber name...
function random(min, max) {
return Math.round(Math.random() * (max - min) + min);
}
let vowels = [ 'a', 'e', 'i', 'o', 'u' ];
let consonents = [ 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'z' ];
function randomName() {
const clen = consonents.length - 1;
const vlen = vowels.length - 1;
@bronzehedwick
bronzehedwick / ordinalize.js
Created June 1, 2017 20:42
A simple function to add an ordinal to a number
function ordinalize(num) {
const lastDigit = (num + '').slice(-1);
if (lastDigit == 1) { return `${num}st`; }
else if (lastDigit == 2) { return `${num}nd`; }
else if (lastDigit == 3) { return `${num}rd`; }
return `${num}th`;
}