Skip to content

Instantly share code, notes, and snippets.

View JiLiZART's full-sized avatar
💭
I may be slow to respond.

Nikolay Kost JiLiZART

💭
I may be slow to respond.
View GitHub Profile
@JiLiZART
JiLiZART / viewport-meta-in-20-best-responsive-designs.md
Created July 17, 2012 22:22 — forked from andreasbovens/viewport-meta-in-20-best-responsive-designs.md
Viewport meta tags used by the 20 sites that are listed in Social Driver's "20 Best Responsive Web Design Examples of 2012"

Intro

http://socialdriver.com/2012/07/20-best-responsive-websites/ lists 20 sites that are supposedly best-in-class when it comes to responsive design techniques. I had a look at the viewport meta tags used in these sites.

Findings

  • All sites use width=device-width, with in most cases an additional initial-scale=1. This is good practice.

However:

  • 8 sites turn off pinch-zooming by setting maximum-scale to 1, or using user-scalable=no. While there are some corner use cases for this, it does not make sense to do this on text-heavy sites as it impairs accessibility.
  • 3 sites use semi-colons as delimiters between viewport values. While this works in newer mobile browsers, it's not officially supported, and breaks in older mobile browser versions.
  • 1 site has 2 viewport meta tags (with different values) in the source...
@JiLiZART
JiLiZART / jquery.url.js
Created April 23, 2012 03:10 — forked from jlong/uri.js
jQuery url parser
(function($) {
function parseUrl(url) {
var parser = document.createElement('a');
parser.href = url; //"http://example.com:3000/pathname/?search=test#hash";
return parser;
};
/**
* url.protocol; // => "http:"
@JiLiZART
JiLiZART / HBitFlagBehavior.php
Created October 14, 2011 15:14
HBitFlagBehavior
<?php
/**
* Bit Flag Marker for model
*/
class HBitFlagBehavior extends CActiveRecordBehavior {
const FLAG_MANAGE_BLOCKED=0;