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
chockenberry / gist:11235824
Last active Aug 29, 2015
Pipe standard output to a running Cocoa app
View gist:11235824
1) Create a script named '~/bin/xscope':
#!/bin/sh
parameter=""
if [ -z "$1" ]; then
parameter=`cat /dev/stdin`
else
parameter="$1"
fi
View appcheck
#!/bin/sh
find=`find /Applications /Applications/Utilities -maxdepth 2 -name '*.app' -exec echo \{\} \;`
#echo $find
IFS=$'\n'
apps=($find)
total=${#apps[*]}
echo "Checking $total applications..."
echo "The following applications will break in Gatekeeper on 10.9.5 and Yosemite:"
count=0
View gist:85d10a83a924e415ece6
- (void)createStatusItems
{
const CGFloat itemLength = 22.0f;
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults boolForKey:generalStatusbarSingleItemKey]) {
// create a single status item with a menu to access tools
NSMenu *statusMenu = [[[NSMenu alloc] initWithTitle:@"Status"] autorelease];
@chockenberry
chockenberry / gist:055bd31f28f3bc5904ea
Last active Aug 29, 2015
LAST TIME I WAS IN A PLAY GROUND I GOT BUSTED
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
View keybase.md

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 / Hosts.txt
Created Jan 22, 2015
Host headers from China
View Hosts.txt
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 / HelloChina.log
Created Jan 22, 2015
First traffic from China
View HelloChina.log
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 / elcap.html
Created Jul 7, 2015
San Francisco not available as CSS?
View elcap.html
<!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 Aug 29, 2015
El Cap code signing
View signature.txt
$ 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/.
View gist:1260280
- (void)loadDefaultSettings
{
NSMutableDictionary *defaults = [NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default-Settings" ofType:@"plist"]];
// other setup...
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithDictionary:defaults]];
}
- (void)resetDefaultSettings
You can’t perform that action at this time.