This file contains hidden or 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
// Code snippets for dynamically loading JavaScript and CSS | |
// Copyright : This script has been placed in the public domain. | |
// Gist : https://gist.github.com/livibetter/5211293 | |
// Blog post : http://blog.yjl.im/2013/03/dynamically-loading-javascript-and-css.html | |
// Last update : 2013-03-21T07:35:25Z | |
// Author : Yu-Jie Lin | |
// Website : http://yjl.im | |
function load_CSS(src, cb) { | |
var link = document.createElement('link'); |
This file contains hidden or 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-based feature test for CSS position: fixed support. | |
Modified from Kangax's test (http://kangax.github.com/cft/#IS_POSITION_FIXED_SUPPORTED) in two ways: 1) uses jQuery API, 2) remove document.body dependency. | |
Method changes aside, the required workaround for dropping document.body use was to set scroll using window.scrollTo instead of body.scrollTop. | |
//Testing notes: | |
iOS4.3: false (expected) | |
iOS5: true (expected) | |
Chrome latest: true (expected) | |
...more soon | |
*/ |
This file contains hidden or 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 | |
// Source: http://goo.gl/NOCJKM | |
$max = Table::model()->count(array( | |
'condition' => 'status<:status', | |
'params' => array('status' => Table::STATUS_A) | |
)); | |
$offset = rand(0, $max); |