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
var undefined = true; |
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
/** | |
* Reverse a string | |
* @param String original string | |
* @return String new string | |
*/ | |
function stringReverse( s ){ | |
var r = ''; | |
while( s ){ | |
r += s.substr(-1,1); | |
s = s.slice(0,-1); |
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
/** | |
* Reverse a string | |
* @param String original string | |
* @return String new string | |
*/ | |
function stringReverse( s ){ | |
var r = '', i = 0, n = - s.length; | |
while( i > n ){ | |
r += s.substr(--i,1); | |
} |
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
/** | |
* String reverse bench test script. | |
* Runs in javascript shell, see print() function | |
*/ | |
/** make a 1MB string */ | |
function bigString(){ | |
var s = ''; |
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
curl http://api.foursquare.com/v1/venue.json?vid=154655 \ | |
| php -r "var_dump(json_decode(file_get_contents('php://stdin')));" \ | |
| less; |
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
isNaN(NaN); // true | |
NaN == NaN; // false | |
typeof NaN; // "number" |
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
// source | |
void ( function(){ | |
try { | |
var s = window.getSelection(); | |
var q = s ? s.toString().replace(/(^\W+|\W+$)/g,'') : ''; | |
if( ! q ){ | |
q = prompt('Enter a word to look up'); | |
if( ! q ){ | |
return; | |
} |
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
/* [twhitlock] define some configs before Wordpress can beat our plug-ins to it */ | |
define('WP_CDN_ROOT','http://cdn.timwhitlock.info/wordpress'); | |
define('WP_CONTENT_URL', WP_CDN_ROOT.'/wp-content'); | |
/** Sets up WordPress vars and included files. */ | |
require_once(ABSPATH . 'wp-settings.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
<?php | |
/** | |
Plugin Name: CDN Tools | |
Plugin URI: http://web.2point1.com/tag/wp-cdn | |
Description: Simple tool for deploying Wordpress assets on a CDN | |
Version: 0 | |
Author: Tim Whitlock | |
Author URI: http://twitter.com/timwhitlock | |
*/ |
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 | |
/** | |
* Add magic quotes to $_GET, $_POST, $_COOKIE, and $_SERVER. | |
* | |
* Also forces $_REQUEST to be $_GET + $_POST. If $_SERVER, $_COOKIE, | |
* or $_ENV are needed, use those superglobals directly. | |
* | |
* @access private | |
* @since 3.0.0 | |
*/ |
OlderNewer