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 | |
use Guzzle\Http\Message\Response; | |
use Guzzle\Plugin\Mock\MockPlugin; | |
use Guzzle\Service\Client; | |
use Guzzle\Service\Description\ServiceDescription; | |
use Guzzle\Service\Resource\Model; | |
use Guzzle\Tests\GuzzleTestCase; | |
/** |
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 | |
namespace my\TestBundle\Assetic; | |
use Assetic\Factory\LazyAssetManager; | |
/** | |
* Overridden asset manager that exposes source maps referenced in CSS and JS | |
*/ | |
class AssetManager extends LazyAssetManager { |
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 | |
/** | |
* display warning in Wordpress admin that WPLANG constant will be ignored | |
*/ | |
is_admin() and add_action( 'admin_notices', function(){ | |
if( defined('WPLANG') && WPLANG && 3 < (int) $GLOBALS['wp_version'] ){ | |
echo '<div class="error"><p><strong>Warning</strong> <code>WPLANG</code> is deprecated and should be removed from wp-config.php</p></div>'; | |
} | |
} ); |
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 | |
/** | |
* A warning to myself that custom iterators cannot entirely masquerade as native arrays for legacy code compatibility: | |
* | |
* - Custom classes implementing the Iterator interface work with `foreach`, but not with native array pointer functions. | |
* - Built-in iterators do work with `current`, `key` and `next` but the iterator methods cannot be overridden in subclasses. | |
*/ | |
/** |
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
#!/bin/bash | |
# Actually just strips carriage returns | |
cp -p "$1" "$1.dos" | |
tr -d '\r' < "$1.dos" > "$1" | |
rm -f "$1.dos" |
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; |
OlderNewer