Skip to content

Instantly share code, notes, and snippets.

View itod's full-sized avatar

Todd Ditchendorf itod

View GitHub Profile
@itod
itod / github-bug-report-objc-weekly-trend.md
Last active August 29, 2015 13:57
GitHub.com Bug Report: "Trending Objective-C repos on GitHub this week” shows mostly non-ObjC repos

###SUMMARY: GitHub.com Bug Report: "Trending Objective-C repos on GitHub this week” shows mostly non-ObjC repos

###CONTEXT: OS X 10.9.2

Any Browser of:

  • Chrome Version 33.0.1750.152
  • Safari Version 7.0.2 (9537.74.9)
  • Firefox 28.0
@itod
itod / instapaper_userstyle.css
Created April 11, 2014 16:53
Kill Fixed Position header in Instapaper
// Starting with: https://www.instapaper.com/read/
#controlbar_container {
position:static !important;
}

Keybase proof

I hereby claim:

  • I am itod on github.
  • I am itod (https://keybase.io/itod) on keybase.
  • I have a public key whose fingerprint is 6295 B943 39B1 61B7 966F 3CA6 BF86 019C 3167 EF39

To claim this, I am signing this object:

@itod
itod / gist:d6f6e73a1b0b8525f703
Last active August 29, 2015 14:00
NSXML XPath AttributeTest bug
/*/attribute(*)
Should match any attribute on the document (outermost) element. NSXML fails.
From XPath 2.0 Spec:
http://www.w3.org/TR/xpath20/#abbrev
If the axis name is omitted from an axis step, the default axis is child unless the axis step contains an AttributeTest or SchemaAttributeTest; in that case, the default axis is attribute. For example, the path expression section/para is an abbreviation for child::section/child::para, and the path expression section/@id is an abbreviation for child::section/attribute::id. Similarly, section/attribute(id) is an abbreviation for child::section/attribute::attribute(id). Note that the latter expression contains both an axis specification and a node test.
@itod
itod / gist:b99e20aa36ad3611db14
Created May 3, 2014 03:37
NSXML Path Expr containing a reverse Axis result sort order borked
NSXML XPath bug
Results of a path expression should always be sorted in document order regardless of axes used therein
//c/ancestor::*
<doc>
<a>A
<b>B
<c>C</c>
@itod
itod / gist:3942c5a20abf37400356
Last active August 29, 2015 14:01
NSXML XPath Bug
Source.xml:
<?xml version="1.0" encoding="utf-8" ?>
<doc id="foo"/>
Context Node:
/doc/@*
@itod
itod / gist:35dbdd0319018363efa6
Created May 12, 2014 16:28
NSXML namespace-uri() fails
<book xmlns:foo="bar">
<chapter foo:baz="OHAI"/>
</book>
//@*[namespace-uri(.)='bar']
@itod
itod / feedbin.js
Created May 20, 2014 20:42
FeedBin Fluid
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
var newBadge = '';
var els = document.querySelectorAll('.feed-link .count');
for (var i = 0; i < els.length; ++i) {
@itod
itod / gist:5d1a317d6ca4f7101b28
Created July 22, 2014 18:23
Enabling AppleID two-step verication prevents logging into iTunesConnect mobile app on iOS

###SUMMARY

Enabling AppleID two-step verication prevents logging into iTunesConnect mobile app on iOS

###CONTEXT

Device: iPhone 5S OS: iOS 7.3 App: iTunes Connect.app

@itod
itod / wave_func.m
Last active August 29, 2015 14:06
Wave Function: 0.0-1.0, twice in 360º
// 0 == w:1.0 h:0.0
// 90 == w:0.0 h:1.0
// 180 == w:1.0 h:0.0
// 270 == w:0.0 h:1.0
// 360 == w:1.0 h:0.0
CGFloat rad = TDD2R(angle);
CGFloat wRatio = 0.5+(cos(2.0*rad)/2.0);
CGFloat hRatio = 1.0 - wRatio;