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 / jquery.smallTabs.js
Created April 29, 2013 13:45
Very light tabs div.tabs-container>(ul.tabs>li*3)+(div.tab*3)
/**
* @author Nikolay Kostyurin <[email protected]>
* Very lightweight tabs
*/
;(function ( $, window, document, undefined ) {
var pluginName = 'smallTabs',
defaults = {
content: 'div.tab',
navigation: 'ul.tabs',
@JiLiZART
JiLiZART / jquery.tmpl.js
Created April 26, 2013 03:55
doT.js jQuery wrapper function by Artem Sapegin
$.fn.tmpl = function(tmplId, data) {
var tmpl = doT.template($('#tmpl_' + tmplId).text());
if (!$.isArray(data)) data = [data];
return this.each(function() {
var html = '';
for (var itemIdx = 0; itemIdx < data.length; itemIdx++) {
html += tmpl(data[itemIdx]);
}
$(this).html(html);
@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;