This gist is no longer valid. Please see Compass-Rails for instructions on how to install.
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 | |
$provider = new stdClass; | |
$provider->disabled = FALSE; /* Edit this to true to make a default provider disabled initially */ | |
$provider->name = 'twitter'; | |
$provider->title = 'Twitter'; | |
$provider->url = 'http://api.twitter.com'; | |
$provider->consumer_advanced = array( | |
'signature method' => 'HMAC-SHA1', | |
'request token endpoint' => '/oauth/request_token', | |
'authorization endpoint' => '/oauth/authenticate', |
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 color_meter(cwith, ccolor) { | |
if (!cwith && !ccolor) return; | |
var _cwith = (cwith.charAt(0)=="#") ? cwith.substring(1,7) : cwith; | |
var _ccolor = (ccolor.charAt(0)=="#") ? ccolor.substring(1,7) : ccolor; | |
var _r = parseInt(_cwith.substring(0,2), 16); | |
var _g = parseInt(_cwith.substring(2,4), 16); | |
var _b = parseInt(_cwith.substring(4,6), 16); |
Looking at the ES5 compatibility table, several browsers provide everything often used (i. e. not Object.freeze() and friends) except Function.prototype.bind
. So I just inline that. Browsers that don't provide other functions also don't include Object.getOwnPropertyNames, so I used it as my test for including the entire shim.
Note that I haven't tested it yet, and it doesn't work for the six Object functions next to each other in the Safari 5 part of the compatibility chart (Safari 5 is deemed good enough).
Update: I added JSON for IE <= 7. JSON is used in a good number of node.js modules.
NewerOlder