- 1. Avoid all exercise
- 2. Eat what you're told
- 3. Don't waste your life in bed
- 4. Live better through chemistry
- 5. Maximize your screen time
- 6. If you want it, buy it
- 7. Can't afford it? Get it anyway!
- 8. Give 100 percent to your work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# A simple hash table implementation in Ruby using Ruby's built-in | |
# prehashing methods, chaining, and variable load factors. | |
# | |
# Author:: Hunter Gatewood | |
# A linked-list node with key, value, and next node attributes. | |
class Node | |
attr_accessor(:key, :val, :next_node) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
random_note.py prints a random musical note at the passed interval (seconds). | |
If no interval passed, defaults 4 seconds. | |
""" | |
import itertools | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Read in notes from the passed notes.json file and send to our Twitch channel. | |
Usage: `python3 play_notes.py <your notes.json file>` | |
Notes: | |
- Careful about getting rate limited! The limits per 30 seconds | |
are 30 messages for non-mods and 100 messages for mods. Pass that | |
limit and your IP gets banned for 8 hours. See | |
https://help.twitch.tv/customer/portal/articles/1302780-twitch-irc. | |
- Expects fields in notes.json to be filled out (pass, nick, notes). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isoFetch = require('isomorphic-fetch'); | |
const Dropbox = require('dropbox').Dropbox; | |
const util = require('util'); | |
exports.handler = function(context, event, callback) { | |
log(context); | |
log(event); | |
const whitelisted_numbers = [ | |
context.HCG_NUM_1, |
Quick overview of installing Network UPS Tools on macOS.
- Config files are located in their normal Linux-style locations, with the
brew --prefix
prepended. So e.g., on Apple silicon,nut.conf
is located at/opt/homebrew/etc/nut/nut.conf
. - NUT's Homebrew service should be run as root, to support default shutdown command.
- While desktop macOS supports "wake after power loss", it doesn't seem to support "wake on power". It treats the graceful shutdown as a normal shutdown, which doesn't result in startup after power restore. Can either accept manual power-on required, or remove graceful shutdown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vpnon connects to GlobalProtect VPN. | |
# | |
# NOTE: GlobalProtect must be running. | |
# | |
# REF: https://gist.github.com/kaleksandrov/3cfee92845a403da995e7e44ba771183 | |
# | |
# Usage: vpnon | |
function vpnon { | |
osascript <<EOF | |
tell application "System Events" to tell process "GlobalProtect" |
This guide outlines steps to access Uptime Kuma through a semi-protected Cloudflare Tunnel.
Semi-protected meaning the status page is public, while all other endpoints are private.
This guide outlines steps to create a custom dialer for Google Chrome on macOS, i.e. opening specific URLs with simple keyboard shortcuts.
The goal is to recreate Safari's affordance of ⌘1 opening your 1st bookmark, ⌘2 opening your 2nd bookmark, etc.
- Install BetterTouchTool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sort airline tickets | |
# | |
# An "airline ticket" is defined as a tuple containing the departure airport code and arrival airport code. | |
# For example: ("SFO", "LAX") is a trip from SFO to LAX. | |
# A "legal trip" is a trip that uses all of the airline tickets, where | |
# the arrival airport for a ticket must be same as the departure airport for the next ticket. | |
# | |
# Example | |
# Input: [("SFO", "LAX"), ("LAX", "NYC"), ("ORD", "SFO")] | |
# Output: [("ORD", "SFO"), ("SFO", "LAX"), ("LAX", "NYC")] |
OlderNewer