Skip to content

Instantly share code, notes, and snippets.

View chockenberry's full-sized avatar

Craig Hockenberry chockenberry

View GitHub Profile

Keybase proof

I hereby claim:

  • I am chockenberry on github.
  • I am chockenberry (https://keybase.io/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
chockenberry / HelloChina.log
Created January 22, 2015 17:23
First traffic from China
183.60.243.240 - - [15/Jan/2015:23:34:10 -0800] "GET / HTTP/1.1" 403 13 "http://www.baidu.com/search/spider.htm" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"
113.224.238.213 - - [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"
113.224.238.213 - - [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"
118.228.30.248 - - [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"
60.168.38.222 - - [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=192.168.1.101&port=11277&uploaded=8380544196&downloaded=8380544196&left=3255698354&nu
@chockenberry
chockenberry / Hosts.txt
Created January 22, 2015 17:58
Host headers from China
1.gravatar.com
127.0.0.1:9010
2003---el-oro-de-moscu-xvid-avi.foldforper7.appspot.com
a.tracker.thepiratebay.org
a2.l3-images.myspacecdn.com
a248.e.akamai.net
acyd-karpathicus.deviantart.com
ads.exoclick.com
agentoftrickery.deviantart.com
airinya.deviantart.com
@chockenberry
chockenberry / elcap.html
Created July 7, 2015 20:23
San Francisco not available as CSS?
<!DOCTYPE html>
<head>
<title>El Capitan</title>
<style>
body {
font-size: 2em;
}
h1 {
font-family: "System Font Black", HelveticaNeue-CondensedBlack, ComicSansMS;
@chockenberry
chockenberry / signature.txt
Last active October 22, 2020 19:25
El Cap code signing
$ spctl --verbose=4 --assess --type execute xScope.app
xScope.app: rejected
source=obsolete resource envelope
$ codesign --verify --verbose=4 xScope.app
--prepared:/Users/craig/Downloads/xScope.app/Contents/Frameworks/Sparkle.framework/Versions/Current/.
--validated:/Users/craig/Downloads/xScope.app/Contents/Frameworks/Sparkle.framework/Versions/Current/.
--prepared:/Users/craig/Downloads/xScope.app/Contents/Frameworks/YAML.framework/Versions/Current/.
--validated:/Users/craig/Downloads/xScope.app/Contents/Frameworks/YAML.framework/Versions/Current/.
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
chockenberry / finder_icons.sh
Last active February 10, 2024 19:05
A simple shell script to turn the Finders desktop icons on and off
#!/bin/sh
defaults read com.apple.finder CreateDesktop > /dev/null 2>&1
enabled=$?
if [ "$1" = "off" ]; then
if [ $enabled -eq 1 ]; then
defaults write com.apple.finder CreateDesktop false
osascript -e 'tell application "Finder" to quit'
open -a Finder
// 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
chockenberry / Debug.swift
Last active April 11, 2024 13:22
Debug and release logging in Swift that's reminiscent of NSLog()
//
// Debug.swift
//
// Created by Craig Hockenberry on 3/15/17.
// Updated by Craig Hockenberry on 2/20/24.
// Usage:
//
// SplineReticulationManager.swift:
//
@chockenberry
chockenberry / Slack Formatting Bar Feedback.txt
Last active October 22, 2020 19:26
Slack Formatting Bar Feedback
There are a couple of problems with the new formatting bar:
1) The icon to turn it on/off doesn't make sense. It's a toolbar, and the "Aa" doesn't get that concept across. It's in a strange place, next to "@" and ":-)", icons that cause an element to come up over the text field without changing it. A lot of smart folks aren't figuring this out (and let's face it, no one reads the fricken' manual.) Don't believe me, check out the replies to this tweet:
https://twitter.com/chockenberry/status/1196992017143779328
2) Once you have the epiphany to turn it off, it doesn't turn off the functionality. I've been using Markdown since it was just a glint in John Gruber's eye, and it's actually easier for me to _read_ text *like this* even when it contains `code`.
If I opt out of the formatting bar, it feels like I should be opting out the fancy completion stuff, too.