Skip to content

Instantly share code, notes, and snippets.

@tvandervossen
tvandervossen / gist:1231476
Created September 21, 2011 07:33
Mobile Safari viewport sizes on iOS 4.3 and 5
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/multi_xml-0.4.0.gemspec]: invalid date format in specification: "2011-09-06 00:00:00.000000000Z"
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/multi_xml-0.4.0.gemspec]: invalid date format in specification: "2011-09-06 00:00:00.000000000Z"
@tvandervossen
tvandervossen / gist:1339061
Created November 4, 2011 10:25
Callback or custom event?
Hey, I’m playing around with a multitouch gesture recognition API
for Mobile Safari. Now I’m wondering; would you prefer to define the
event handler in a callback, like this:
recognize.tap(element, function() {
log('Tapped');
});
Or would you prefer the recognizer to fire a custom event, like this:
@tvandervossen
tvandervossen / gist:1344596
Created November 7, 2011 10:04
Multitouch recognizer event binding
$('.tap').recognize('tap').bind(
'touchstart touchenter', function() {
$(this).addClass('active');
}).bind(
'touchleave touchend touchcancel', function() {
$(this).removeClass('active');
}).bind(
'tap', function() {
log('Tapped');
});
@tvandervossen
tvandervossen / gist:1478543
Created December 14, 2011 21:09
Initial client lead questions
Can you please answer the following questions so we can assess the project,
and judge if we would be a good match?
1. Is this a new project, or is this for an existing website or application?
- This is a project for a completely new site or application
- This is a project to update an existing site or application
2. Which of the following areas do you need help with?
@tvandervossen
tvandervossen / gist:1502845
Created December 20, 2011 19:25
Encode WebM with -aspect to make sure Firefox displays it with the correct aspect ratio
Commands:
$ ffmpeg -i source.mp4 -s 1280x720 -vpre libvpx-720p -b 3900k -pass 1 -an -f webm -aspect 16:9 -y output.webm
$ ffmpeg -i source.mp4 -s 1280x720 -vpre libvpx-720p -b 3900k -pass 2 -acodec libvorbis -ab 100k -f webm -aspect 16:9 -y output.webm
Assumes the following preset (in /usr/local/share/ffmpeg/libvpx-720p.ffpreset):
vcodec=libvpx
g=120
rc_lookahead=16
@tvandervossen
tvandervossen / gist:1605091
Created January 13, 2012 08:32
Deployment to S3 with CloudFront invalidation using s3cmd 1.1 beta
Sync local-public-dir to bucket-name on S3 and invalidate changed files on CloudFront:
$ ./bin/s3cmd-1.1.0-beta1/s3cmd -c s3.config sync local-public-dir/ s3://bucket-name/ --acl-public --cf-invalidate --rexclude '.svn' --rexclude '.DS_Store'
You can create s3.config with:
$ s3cmd --configure
I keep my s3.config on an encrypted disk image which I mount manually when needed.
@tvandervossen
tvandervossen / gist:1646908
Created January 20, 2012 11:37
Our address
Fingertips B.V.
Barentszplein 7
1013 NJ Amsterdam
The Netherlands
@tvandervossen
tvandervossen / gist:1788012
Created February 10, 2012 09:28
jQuery / Zepto highest() plugin
(function($){
$.fn.highest = function() {
var height, highest = 0;
this.each(function() {
height = $(this).height();
if (height > highest) highest = height;
});
return highest;
};
})(window.Zepto || window.jQuery);
@tvandervossen
tvandervossen / gist:1810845
Created February 12, 2012 21:05
Quick patch for JSONP error callback support in Zepto
diff --git a/src/ajax.js b/src/ajax.js
index d75e13c..f9d399f 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -99,6 +99,11 @@
},
xhr = { abort: abort }, abortTimeout;
+ if (options.error) script.onerror = function() {
+ xhr.abort();