Skip to content

Instantly share code, notes, and snippets.

View jfahrenkrug's full-sized avatar

Johannes Fahrenkrug jfahrenkrug

View GitHub Profile
@jfahrenkrug
jfahrenkrug / extract_wwdc_samplecode.js
Created June 7, 2017 23:01
Extract the WWDC 2017 Sample Code URL from the sessions page. Just paste it into the JS console on https://developer.apple.com/wwdc/schedule/
$.getJSON( "https://devimages-cdn.apple.com/wwdc-services/h8a19f8f/049CCC2F-0D8A-4F7D-BAB9-2D8F5BAA7030/contents.json", function( data ) {
var items = [];
$.each( data.contents, function( key, val ) {
if (val.type == 'Session' && val.eventId == 'wwdc2017' && val.related && val.related.resources) {
$.each(val.related.resources, function (resKey, resId) {
var resource = data.resources[resId]
if (resource && resource['resource_type'] == 'samplecode') {
items.push(resource);

Keybase proof

I hereby claim:

  • I am jfahrenkrug on github.
  • I am jfahrenkrug (https://keybase.io/jfahrenkrug) on keybase.
  • I have a public key whose fingerprint is BE25 078F A534 3D3F E12D B915 3105 2A52 D4CA A081

To claim this, I am signing this object:

@jfahrenkrug
jfahrenkrug / TemplateInfo.plist
Created November 4, 2013 21:17
An Xcode 5 template that lets you deselect the use of storyboards.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ancestors</key>
<array>
<string>com.apple.dt.unit.cocoaTouchApplication</string>
</array>
<key>Concrete</key>
<true/>
@jfahrenkrug
jfahrenkrug / dead_snippets.rb
Created January 29, 2013 14:56
A small script to find unused or invalid snippets in Radiant CMS.
# encoding: utf-8
# Find unused and invalid Radiant CMS snippets
# @author Johannes Fahrenkrug
class DeadSnippetsFinder
SNIPPET_REGEX = /\<r\:snippet\s+name\=[\"\']([\w\d\:\-]+)[\"\']/
def self.scan(obj, field = 'id')
puts " #{field}: #{obj.send(field)} name='#{obj.name}'"
(obj.content || '').scan(SNIPPET_REGEX) do |m|
@jfahrenkrug
jfahrenkrug / cloudos_custom_icons.js
Created August 2, 2011 09:17
Add custom icons to the iCloud.com CloudOS SpringBoard
SC.run(function() {
COS.apps.github = {path: 'http://www.github.com', requiredServices: ["ubiquity"]};
COS.appsController._appsInfo.github = COS.AppInfo.create(COS.apps.github);
var github = {name: 'github', icon: 'http://ripthejacker.github.com/images/github_icon.png'};
var c = {
maskAsset: "/system/cloudos/en-us/14F/source/resources/images/mask.png",
warningArrowAsset: "/system/cloudos/en-us/14F/source/resources/images/warning_arrow.png",
shadowAsset: "/system/cloudos/en-us/14F/source/resources/images/shadow.png",
focusAsset: "/system/cloudos/en-us/14F/source/resources/images/app_icon_ring.png",
If you have installed MacGPG2 via the package installer, several other
checks in this script will turn up problems, such as stray .dylibs in
/usr/local and permissions issues with share and man in /usr/local/.
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
@jfahrenkrug
jfahrenkrug / config.log
Created July 27, 2011 13:36
homebrew xapian install fail on 10.7
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by xapian-core configure 1.2.4, which was
generated by GNU Autoconf 2.67. Invocation command line was
$ ./configure --prefix=/usr/local/Cellar/xapian/1.2.4 --disable-assertions --disable-dependency-tracking
## --------- ##
## Platform. ##
@jfahrenkrug
jfahrenkrug / radius_test.rl
Created July 15, 2011 14:42
Test showcasing how slow the new Ragel-based Radius parser is
%%{
machine parser;
action _prefix { mark_pfx = p }
action prefix {
if data[mark_pfx..p-1] != @prefix
closing = data[mark_pfx-1,1] == '/'
@nodes.last << data[mark_pfx-(closing ? 2 : 1)..p]
fbreak;
@jfahrenkrug
jfahrenkrug / sc_many_array_test.js
Created April 19, 2011 13:36
SC.ManyArray elements can't be accessed with getPath
TP.MATest = SC.Record.extend({
});
TP.store.createRecord(TP.MATest, {name: 'Thing One'});
TP.store.createRecord(TP.MATest, {name: 'Thing Two'});
function manyArrayTest() {
// arrays
a1 = ['a', 'b', ['c', 'd']];
a2 = ['x', ['y', ['z']]];
@jfahrenkrug
jfahrenkrug / wwdc2013.rb
Last active February 9, 2017 04:38
Ruby Script to check whether WWDC 2013 has been announced.
# in 2013 by Johannes Fahrenkrug, http://springenwerk.com
# See you at WWDC!
require 'rubygems'
require 'open-uri'
class WWDC2013
def self.announced?
begin
indicator_line = open('https://developer.apple.com/wwdc/') do |f|