Skip to content

Instantly share code, notes, and snippets.

Craig Hockenberry chockenberry

Block or report user

Report or block chockenberry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
chockenberry / Debug.swift
Last active Nov 19, 2019
Debug and release logging in Swift that's reminiscent of NSLog()
View Debug.swift
// Debug.swift
// Created by Craig Hockenberry on 3/15/17.
// Usage:
// debugLog("reticulating splines") prints "2019-10-04 11:52:28 SplineReticulationManager: reticulationFunction reticulating splines"
// debugLog() prints "2019-10-04 11:52:28 SplineReticulationManager: reticulationFunction called"
// Add "DEBUG" to project or target's "Active Compilation Conditions" for Debug builds.
View UIColor+RGB.m
// Created by Sean Heber on 4/12/12.
#import <UIKit/UIKit.h>
// If you work with a designer who specifies color in sRGB using 102,0,204, this category makes it simpler to instantiate
// a color with that specification: [UIColor colorWithRGB:102:0:204 alpha:1.0];
@interface UIColor (RGB)
// NOTE: If you're using the extended sRGB color space, you'll want to use something other than UInt8 :-)
+ (UIColor *)colorWithRGB:(UInt8)r :(UInt8)g :(UInt8)b alpha:(CGFloat)alpha;
chockenberry /
Last active Jun 6, 2018
A simple shell script to turn the Finders desktop icons on and off
defaults read CreateDesktop > /dev/null 2>&1
if [ "$1" = "off" ]; then
if [ $enabled -eq 1 ]; then
defaults write CreateDesktop false
osascript -e 'tell application "Finder" to quit'
open -a Finder
View GPU Statistics for iPulse
In the next version of iPulse, I'd like to show GPU statistics. Unfortunately, the format
for these statistics is vendor specfic (see the "Performance Statistics" dictionary below.)
In order to cover as many devices as possible, I'd like you to run the following commands
from your Terminal:
$ sysctl hw.model
$ ioreg -r -d 1 -w 0 -c "IOAccelerator"
You can help me read the results by putting them in a code block (triple backticks).
chockenberry / signature.txt
Last active Aug 29, 2015
El Cap code signing
View signature.txt
$ spctl --verbose=4 --assess --type execute rejected
source=obsolete resource envelope
$ codesign --verify --verbose=4
chockenberry / elcap.html
Created Jul 7, 2015
San Francisco not available as CSS?
View elcap.html
<!DOCTYPE html>
<title>El Capitan</title>
body {
font-size: 2em;
h1 {
font-family: "System Font Black", HelveticaNeue-CondensedBlack, ComicSansMS;
chockenberry / Hosts.txt
Created Jan 22, 2015
Host headers from China
View Hosts.txt
chockenberry / HelloChina.log
Created Jan 22, 2015
First traffic from China
View HelloChina.log - - [15/Jan/2015:23:34:10 -0800] "GET / HTTP/1.1" 403 13 "" "Mozilla/5.0 (compatible; Baiduspider/2.0; +" - - [15/Jan/2015:23:34:13 -0800] "GET /feeds/api/standardfeeds/GB/most_popular?time=this_week&format=2%2C3%2C9&start-index=1&max-results=10&safeSearch=moderate HTTP/1.1" 403 13 "-" "Android-YouTube/2" - - [15/Jan/2015:23:34:13 -0800] "GET /feeds/api/standardfeeds/GB/recently_featured?format=2%2C3%2C9&start-index=1&max-results=10&safeSearch=moderate HTTP/1.1" 403 13 "-" "Android-YouTube/2" - - [15/Jan/2015:23:34:14 -0800] "GET /file/OYwzhcyF/Power-Puff_Girls_-_Mojo_Jojo_a.htm HTTP/1.0" 403 13 "-" "Python-urllib/1.17" - - [15/Jan/2015:23:34:14 -0800] "GET /announce?info_hash=4%BF%AEy%60f%85M%AA%BD%7BcBk%10%7Ct%2D%AE%C7&peer_id=%2DSD0100%2D%E8V%2C%CE%9F%E39%06e%17%23%CA&ip=

Keybase proof

I hereby claim:

  • I am chockenberry on github.
  • I am chockenberry ( on keybase.
  • I have a public key whose fingerprint is 2E64 59C9 0BBD C169 3C0F 5C37 8EE0 CB38 3C52 E2F7

To claim this, I am signing this object:

chockenberry / gist:055bd31f28f3bc5904ea
Last active Aug 29, 2015
View gist:055bd31f28f3bc5904ea
typealias BOOLAEN = Bool
typealias LIKEON68K = UInt16
typealias LIKEONPENTIUM = UInt32
typealias STRING = String
typealias STRINGINDEX = String.Index
typealias BOOL = Bool
typealias UNICODESCALER = UnicodeScalar
typealias GONADS = String
typealias NUMBERSWITHDOTS = Double
You can’t perform that action at this time.