Skip to content

Instantly share code, notes, and snippets.

View holman's full-sized avatar

Zach Holman holman

View GitHub Profile
@holman
holman / BRAINSTORMING.md
Created December 9, 2014 22:29
Examples you could use in order to better explain your programming language inheritance and OOP syntax instead of using cars, animals, and shapes.
  • Cats, as defined by how important they were as plot devices (the cat from The Matrix would inherit from ImportantCat, whereas the cat from Boondock Saints would inherit from DeadCat)
  • Batman (primarily as a way to describe situations in which a child has no parents)
  • Presidents of the United States (Nixon vs Cheney vs Garfield)
  • Zombies (Walking Dead vs World War Z vs Zombieland)
  • Zombie Presidents of the United States
  • Children in television shows, as grouped by whether they actually did cause their parents' separation
  • Radioactive attack squirrels bent on global hegemony, beamed down to Earth from the mirror universe USS Enterprise
  • George Carlins by decade
  • Cocaine
  • Metropolises, cities, towns, villages, and Detroits
@holman
holman / emoji_test.rb
Last active June 18, 2020 01:27
A snapshot of the tests we use internally at GitHub to help edit our blog posts before they go out to everybody. For more information, take a peek at http://zachholman.com/posts/how-github-writes-blog-posts
require_relative "test_helper"
require "open-uri"
require "net/http"
class EmojiTest < Blog::Test
def test_no_emoji
posts.each do |post|
content = File.read(post)
refute_match /:[a-zA-Z0-9_]+:/, content,
@holman
holman / header-anchors.diff
Created January 19, 2015 20:37
add anchors to headings in github pages
diff --git a/_config.yml b/_config.yml
index 8f2dd40..fc83f8e 100644
--- a/_config.yml
+++ b/_config.yml
@@ -1,3 +1,6 @@
+markdown: redcarpet
+redcarpet:
+ extensions: [with_toc_data]
@holman
holman / tmobile.sh
Created June 29, 2015 21:32
Will someone destroy Comcast already
# Manually download each month's call history from t-mobile.com and toss them in
# a directory. Or do it automatically using computers, who cares.
#
# Install spark: https://github.com/holman/spark
cat * | grep 266-2278 | sort | cut -d, -f5 | spark
# ▂█▁▃▅
echo "fuck comcastttttttttttttttttttttttttttttttttttttttttt"
# ⒻⓊⒸⓀ ⒸⓄⓂⒸⒶⓈⓉ
@holman
holman / jekyll_media_length.rb
Created October 19, 2015 01:18
Drop the length of a particular audio file and junk into your Jekyll page.
# jekyll_media_length / by @holman
#
# Drop the length of a particular audio file and junk into your Jekyll page.
# (See https://twitter.com/Una/status/655856628198014976 for more context).
#
# INSTALL:
#
# brew install taglib
# gem install taglib-ruby
#
@holman
holman / instantiate.rb
Created October 31, 2024 21:55
instantiate.rb
module Instantiate
def instantiate(created_by, parent = nil, starting_position = nil, starting_page = 0, root_parent = nil, position = 0)
attrs = {:created_by => created_by, :position => position + 1,
:based_on => self, :display_position => nil,
:root_parent => root_parent, :uncalculated_state => self.state}
pages_added = 0
i = if parent.nil?
Instance.new(attrs)
else
@holman
holman / inthunter.sh
Created June 16, 2025 21:36
inthunter
#!/bin/bash
# Get the user's global git email
user_email=$(git config --global user.email)
if [ -z "$user_email" ]; then
echo "Could not find your global git user.email. Please set it with 'git config --global user.email \"[email protected]\"'"
exit 1
fi
tmpfile=$(mktemp)