Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kujon
kujon / media-queries.css
Created April 26, 2012 16:24
CSS: Hardboiled css media-queries
/*
Hardboiled CSS3 Media Queries by Andy Clarke:
http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
Author: Andy Clarke
Web site: http://stuffandnonsense.co.uk
Twitter: http://twitter.com/malarkey
Hardboiled Web Design
@kujon
kujon / LICENSE.txt
Created March 15, 2012 19:09 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@kujon
kujon / Asset.js
Created March 15, 2012 15:23 — forked from jCrip/Asset.html
JavaScript: Viewport Scaling Bug
(function(doc) {
var addEvent = 'addEventListener',
type = 'gesturestart',
qsa = 'querySelectorAll',
scales = [1, 1],
meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
function fix() {
meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
@kujon
kujon / Asset.css
Created March 15, 2012 14:30 — forked from jCrip/Asset.css
CSS: Media Queries Bootstrap
// Landscape phones and down
@media (max-width: 480px) { ... }
// Landscape phone to portrait tablet
@media (max-width: 767px) { ... }
// Portrait tablet to landscape and desktop
@media (min-width: 768px) and (max-width: 979px) { ... }
// Large desktop
@kujon
kujon / rAF.js
Created March 15, 2012 14:21 — forked from paulirish/rAF.js
JavaScript: requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@kujon
kujon / selector.js
Created March 8, 2012 11:04
JavaScript: Defining selector
$.extend(
$.expr[ ":" ],
{ selector : function (a) { return test; }}
);
@kujon
kujon / modernizr.css
Created March 8, 2012 00:06 — forked from qwertypants/modernizr.css
CSS: Generic structure for Modernizr CSS styles
.js {}
.no-js {}
.flexbox {}
.no-flexbox {}
.canvas {}
.no-canvas {}
.canvastext {}
.no-canvastext {}
.webgl {}
.no-webgl {}
@kujon
kujon / modernizr-tests.js
Created March 8, 2012 00:04 — forked from danott/modernizr-tests.js
JavaScript: Custom Modernizr tests that are useful.
/* modernizr-test.js
* Daniel Ott
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/
@kujon
kujon / placeholder.js
Created March 7, 2012 23:45 — forked from athanassiadis/Modernizr placeholder
JavaScript: Modernizr placeholder
if (!Modernizr.input.placeholder) {
$('[placeholder]').each(function() {
var $self = $(this);
$self.val($self.attr('placeholder'));
$self.focus(function() {
$self.val('');
}).blur(function() {
if($self.val().length < 1) {
@kujon
kujon / starter.coffee
Created March 7, 2012 23:43
CoffeeScript: jQuery starting template
(($) ->
$ ->
)(jQuery)