Skip to content

Instantly share code, notes, and snippets.

View holman's full-sized avatar

Zach Holman holman

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / example.png
Created November 5, 2014 05:35
A quick Hubot script to display Uber surge pricing from a particular point (LIKE AN OFFICE).
example.png
25 here
16 wtf
12 wat
11 lolol
9 derp
8 poop
8 foo
6 wut
6 hola
6 yo
{"here":25,"wtf":16,"wat":12,"lolol":11,"derp":9,"poop":8,"foo":8,"wut":6,"hola":6,"yo":6,"fuck":5,"test":4,"shit":4,"huh":4,"hello":3,"got here":3,"butts":3,"herp":3,"bar":3,"asdf":3,"ohai":3,"hell":3,"you got here":2,"sup":2,"bleh":2,"here 1":2,"here 2":2,"lol":2,"poo":2,"i like cheese":2,"fuuu":2,"lala":2,"omg":2,"hello?":2,"holla":2,"holman":2,"dupa":2,"lalala":2,"balls":2,"woot":2,"blah":2,"welp":2,"moo":2,"boom":2,"cat":2,"horse":1,"chk1":1,"coucou":1,"poldo":1,"asasdasdasdasd":1,"meow":1,"twerk -->":1,"ebasa":1,"dick fingers":1,"aaaaaaaaa":1,"hotdogs":1,"heyo":1,"chicken dinner":1,"woo":1,"ffs":1,"blip tip":1,"gah":1,"AREYOUKIDDING":1,"cocknobs":1,"PORTC = 0xFF":1,"haha":1,"apa":1,"wtfbbq":1,"wtffu":1,"prout":1,"eh":1,"goddammit2":1,"fuckthis1":1,"debug2":1,"debug1":1,"dog":1,"stip":1,"blag":1,"3💨":1,"yay":1,"hey grl":1,"heyheyhey":1,"die mofo":1,"nay":1,"boom!":1,"programming is stupid I hate computers who invented this fucking proffession anyway":1,"fuck you":1,"hi":1,"caca":1,"what the fuck is going
@holman
holman / Guthrie IP.md
Last active August 4, 2016 03:30
Woody Guthrie, on intellectual property.

This song is Copyrighted in U.S., under Seal of Copyright # 154085, for a period of 28 years, and anybody caught singin it without our permission, will be mighty good friends of ourn, cause we don’t give a dern. Publish it. Write it. Sing it. Swing to it. Yodel it. We wrote it, that’s all we wanted to do.

  • Woody Guthrie, 1940's —