Skip to content

Instantly share code, notes, and snippets.

View shybovycha's full-sized avatar

Artem Shubovych shybovycha

View GitHub Profile
@shybovycha
shybovycha / png_normalizer.rb
Last active December 15, 2015 03:49 — forked from AquaGeek/png.rb
# 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
@shybovycha
shybovycha / index.html
Created January 17, 2013 22:13
A very beautiful modal dialog (or a pop-up) on a CSS3. The article: http://css-tricks.com/receding-background-modal-boxes/
<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>
@shybovycha
shybovycha / mobile_detector.rb
Created November 14, 2012 13:53 — forked from tubalmartin/mobile_detector.php
Lightweight detector of mobile devices, OSs & browsers (Ruby)
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)',