Skip to content

Instantly share code, notes, and snippets.

Fingertips is a small high-end design and development team for web, iPhone, iPad, and Mac OS X application.
Fingertips is a high-end design and development team for web, iPhone, iPad, and Mac OS X.
class DOMNodeList
include Enumerable
def each
length.times { |i| yield item(i) }
end
end
doc = webView.mainFrameDocument
p document.querySelector('meta[name=viewport][content*=width]')
@tvandervossen
tvandervossen / gist:836355
Created February 20, 2011 22:06
Add a viewport meta element to Apache’s auto-generated index pages
Adding the following to /etc/apache2/extra/httpd-autoindex.conf makes browsing Apache’s auto-generated index pages a lot easier on an iOS device which can be handy while testing:
IndexHeadInsert "<meta name=\"viewport\" content=\"width=640,initial-scale=1\">"
@tvandervossen
tvandervossen / gist:864694
Created March 10, 2011 19:11
The Typotheque web font service is slow if you’re not in the US
Sadly, the otherwise fine Typotheque web font service is hosted on AWS EC2
instances in the us-east datacenter instead of on a proper CDN like CloudFront.
This means it’s really going to slow down page loading for your visitors if
they’re not inside the US.
Here’s a traceroute to wf.typotheque.com from Amsterdam:
thijs@mbp:office$ traceroute wf.typotheque.com
traceroute to typotheque-1610870073.us-east-1.elb.amazonaws.com (174.129.38.35), 64 hops max, 52 byte packets
@tvandervossen
tvandervossen / gist:865869
Created March 11, 2011 13:18
Add images to the iOS Simulator 'Saved Photos' album
#!/bin/bash
# Adds images to the iOS Simulator 'Saved Photos' album
# Originall from http://ofcodeandmen.poltras.com/2008/11/04/adding-pictures-to-the-simulator/
# You might have to change the simPath and you probably have to remove the contennt of the 'PhotoData'
# directory before the added photos can be found. Note that this overwrites existing images.
simPath="$HOME/Library/Application Support/iPhone Simulator/4.2/Media/DCIM/100APPLE"
@tvandervossen
tvandervossen / gist:918106
Created April 13, 2011 18:39
Simple flash embedding with an alternative image
<object type="application/x-shockwave-flash" data="movie.swf">
<param name="movie" value="movie.swf">
<img src="https://si1.twimg.com/profile_images/886948653/Avatar3_reasonably_small.png" alt="Flash alternative">
</object>
@tvandervossen
tvandervossen / testing.txt
Created April 13, 2011 20:13
A small part from a code review report for an iOS app
Testing
Automated testing (even though still not widely used by Objective-C developers) would make
refactoring much easier, faster and safer. Good test coverage would also allow maintenance
to be done and new features to be added without first having to fully investigate the
function of all parts of the codebase and the way these parts fit together. This especially
applies when work is contracted out to developers other than those who originally created
the application.
The lack of a comprehensive automated test suite is a real disadvantage. Adding one is
@tvandervossen
tvandervossen / gist:1156197
Created August 19, 2011 06:35
iOS web apps
One of the projects I recently worked on is a mobile gallery for Viewbook, a professional
web-based portfolio tool for artists and photographers. Here’s a video introducing the new viewer:
http://www.viewbook.com/weblog/2011/03/17/new-mobile-galleries-for-ipad-iphone-and-android/
What’s remarkable is that we’ve been able to create a web-based viewer with the same fluidity and
responsiveness as a native iPad or iPhone app. You can try it for yourself with this demo version:
http://stuff.vandervossen.net/temporary/viewbook/dist/test.html
@tvandervossen
tvandervossen / gist:1193159
Created September 4, 2011 17:08
XKCD bookmarklet for iOS
javascript:function%20get_img_w_longest_title()%7Bvar%20imgs=document.getElementsByTagName('img');max_title_length=0;max_img='';for(var%20i=0;i%3Cimgs.length;i++)%7Bif(imgs%5Bi%5D.title.length%3Emax_title_length)%7Bmax_title_length=imgs%5Bi%5D.title.length;max_img=imgs%5Bi%5D;%7D%7Dreturn%20max_img;%7Dalert(get_img_w_longest_title().title);