This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Helper method to fix Apple's stupid png optimizations | |
# Adapted from: | |
# http://www.axelbrz.com.ar/?mod=iphone-png-images-normalizer | |
# https://github.com/peperzaken/iPhone-optimized-PNG-reverse-script/blob/master/Peperzaken/Ios/DecodeImage.php | |
# PNG spec: http://www.libpng.org/pub/png/spec/1.2/PNG-Contents.html | |
require 'zlib' | |
require 'stringio' | |
module PngNormalizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="page-wrap"> | |
<h1>A receding background dialog box.</h1> | |
<button>Open Dialog Box</button> | |
</div> | |
<div id="dialog"> | |
<h2>I'm a dialog box. You have to click a button to open me.</h2> | |
<button>Close Dialog Box</button> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MobileDetector | |
# pass request.env for Rails 3.2 | |
def initialize(headers) | |
@headers = headers | |
end | |
def get_mobile_os | |
regexps = { | |
#mobile OSs | |
'ios' => 'ip(hone|ad|od)', |
NewerOlder