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
Drop in replace functions for setTimeout() & setInterval() that | |
make use of requestAnimationFrame() for performance where available | |
http://www.joelambert.co.uk | |
Copyright 2011, Joe Lambert. | |
Free to use under the MIT license. | |
http://www.opensource.org/licenses/mit-license.php |
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
http://www.kylejlarson.com/blog/2011/fixed-elements-and-scrolling-divs-in-ios-5/<html> | |
<head> | |
<meta name="viewport" content="initial-scale = 1.0, user-scalable = no"> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<style> | |
body {margin: 0; padding: 0;} | |
#width {width: 100%;} | |
#content {position: absolute; top: 50px; left: 0; right: 0; bottom: 50px; overflow: scroll; -webkit-overflow-scrolling: touch;} | |
p {margin-bottom: 20px;} | |
#header {background: #000; color: #fff; height: 50px; position: fixed; top: 0; width: 100%;} |
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
icon-glass | |
icon-music | |
icon-search | |
icon-envelope-alt | |
icon-heart | |
icon-star | |
icon-star-empty | |
icon-user | |
icon-film | |
icon-th-large |
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 myFunction (a, blabla, c, somethingElse, e, f) { | |
var obj = []; | |
//'(a, b, c, d, e, f)' | |
var tmp = arguments.callee.toString().match(/\(.*?\)/g)[0]; | |
//["a", "b", "c", "d", "e", "f"] | |
var argumentNames = tmp.replace(/[()\s]/g,'').split(','); | |
[].splice.call(arguments,0).forEach(function(arg,i) { | |
obj.push({ | |
// question is how to get variable name here? |
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
stat -c %a /etc/passwd |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
// http://pastebin.com/raw.php?i=Xdf49BgK | |
@interface UIBarButtonItem (UIBarButtonItem_customBackground) | |
+ (id) customBarButtonWithTitle:(NSString *)title target:(id)target selector:(SEL)selector; | |
+ (id) customBackButtonWithTitle:(NSString *)title target:(id)target selector:(SEL)selector; | |
@end | |
@implementation UIBarButtonItem (UIBarButtonItem_customBackground) |
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
background-image: -webkit-gradient(radial, 50% 50%, 1, 50% 50%, 283, color-stop(0, rgba(112, 66, 20, 0.2)), color-stop(1, rgba(112, 66, 20, 0.4))); | |
background-image: -webkit-radial-gradient(rgba(112, 66, 20, 0.2), rgba(112, 66, 20, 0.4)); | |
background-image: -moz-radial-gradient(rgba(112, 66, 20, 0.2), rgba(112, 66, 20, 0.4)); | |
background-image: radial-gradient(rgba(112, 66, 20, 0.2), rgba(112, 66, 20, 0.4)); | |
-webkit-box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5); | |
-moz-box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5); | |
box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5); |
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
gradient_background(start_color, stop_color) | |
background linear-gradient(top, start_color, stop_color); /* Standard (W3C) */ | |
background -moz-linear-gradient(center top, start_color, stop_color); /* FF */ | |
background -webkit-gradient(linear, left top, left bottom, from(start_color), to(stop_color)); /* Chrome, Safari */ | |
background -o-linear-gradient(top, start_color, stop_color); /* Opera */ | |
body | |
background url(/images/darkdenim3.png) repeat | |
font-family Arial | |
font-size 12px |