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
/* mobile UA detection http://jsfiddle.net/Takazudo/rxPYk/ */ | |
var ua = (function(){ | |
var ua = {}; | |
var navigator = window.navigator; | |
var platforms = [ | |
{ property: 'platform', regex: /iPhone/i, identity: 'iPhone' }, | |
{ property: 'platform', regex: /iPod/i, identity: 'iPod' }, | |
{ property: 'userAgent', regex: /iPad/i, identity: 'iPad' }, | |
{ property: 'userAgent', regex: /Blackberry/i, identity: 'Blackberry' }, |
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
/*! | |
* viewport handler | |
* | |
* for tablet: 1024px fix | |
* others: width=device-width | |
* iPhone: +scaleFix | |
*/ | |
(function(){ | |
/* desktop page width */ |
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
/* css only preload */ | |
.foobar:after{ | |
content: ''; | |
width:0; | |
height:0; | |
position:absolute; | |
left:-9999px; | |
background:url(../images_v2/arrows/up.png); | |
} |
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
/* make pure css triangle */ | |
.cssTriangle{ | |
display:block; | |
height:20px; | |
position:relative; | |
overflow:hidden; | |
} | |
.cssTriangle span{ | |
position: absolute; | |
width: 0; |
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
/* jQuery deferred chain example | |
demo on jsfiddle: http://jsfiddle.net/Takazudo/ekbc4/ */ | |
var $ul = $('#dump'); | |
function dump(msg){ | |
$ul.append('<li>' + msg + '</li>'); | |
} | |
/* deferred functions */ |
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
/* js comment format collection */ | |
/*! | |
* script name | |
* | |
* @author : Takeshi Takatsudo (takazudo[at]gmail.com) | |
* @copyright : Takeshi Takatsudo | |
* @license : The MIT License | |
* @link : http://..... | |
* @modified : 2011/04/26 HH:MM:SS |
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
/* cache manifest debug from http://jonathanstark.com/blog/2009/09/27/debugging-html-5-offline-application-cache/ */ | |
(function(){ | |
var $log = $('#log'); // #log is ul | |
function log(msg){ | |
$log.append('<li>' + msg + '</li>'); | |
} | |
var cacheStatusValues = []; | |
cacheStatusValues[0] = 'uncached'; |
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
<?php | |
header('Cache-Control: no-cache, must-revalidate'); | |
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | |
header('Content-type: application/json; charset=utf-8'); | |
sleep(1); | |
readfile('amazonresult.json') | |
?> |
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
/* validation input shake */ | |
jQueryObject.stop() | |
.animate({ left: "-6px" }, 40).animate({ left: "6px" }, 40) | |
.animate({ left: "-6px" }, 40).animate({ left: "6px" }, 40) | |
.animate({ left: "0px" }, 40); |
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
function randomNum(from, to) { | |
return from + Math.floor( Math.random() * (to - from + 1) ); | |
} | |
function randomChar(length){ | |
var library = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']; | |
var res = ''; | |
for(var i=0; i<length; i++){ | |
res = [res, library[randomNum(0,9)]].join(''); | |
} | |
return res; |