Skip to content

Instantly share code, notes, and snippets.

@jefflembeck
jefflembeck / gist:1686289
Created January 27, 2012 01:13
time.localtime bug
$ rvm use 1.9.2
Using /Users/jlembeck/.rvm/gems/ruby-1.9.2-p290
$ irb
~> Console extensions: wirble ap rails2 rails3 pm interactive_editor
irb: utc = Time.now.to_i
===> 1327626629
irb: time = Time.at(utc)
===> 2012-01-26 17:10:29 -0800
irb: time.localtime("-05:00")
===> 2012-01-26 20:10:29 -0500
@jefflembeck
jefflembeck / fixorientationzoom.js
Created January 6, 2012 01:21 — forked from scottjehl/fixorientationzoom.js
Fix iOS Orientation Change Zoom Bug
/*
An attempt at fixing the dreaded iOS orientationchange zoom bug http://adactio.com/journal/5088/. Seems to work!
Authored by @scottjehl
MIT License.
*/
(function(w){
var doc = w.document;
if( !doc.querySelectorAll ){ return; }
@jefflembeck
jefflembeck / ios-test.css
Created October 19, 2011 20:10 — forked from tonywok/ios-test.css
iOS Media Queries
// iOS Media Queries
// Goal: capture styles for iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2
//
// Author: Tony Schneider (@tonywok)
// Please tell me where I fail. :)
// iPhone v(4,4S) portrait
// test: black text (overwritten by v* portrait) with blue background
@media all and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) {
a {
@jefflembeck
jefflembeck / php_validation
Created December 30, 2010 20:54
validation_error
WORKS
var $validate = array(
'id => '/[0-9]{1,}$/i',
'startDate' => VALID_NOT_EMPTY
);
DOES NOT WORK
var $validate = array(
'id => '/[0-9]{1,}$/i',