git clone ./zf2 ZendServiceAmazon-library;
git clone ./zf2 ZendServiceAmazon-tests;
git init ZendServiceAmazon;
cd ZendServiceAmazon-library;
git filter-branch --subdirectory-filter library/Zend/Service/Amazon -- --all;
git filter-branch --index-filter 'git ls-files -s | sed "s--library/ZendService/Amazon/-g" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD
cd ../;
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 | |
/** @license http://unlicense.org/UNLICENSE */ | |
function colorize($string, $useAnsi = null) | |
{ | |
if (is_null($useAnsi)) { | |
$useAnsi = function_exists('posix_isatty'); | |
} | |
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 SampleOauth2Client; | |
class Client | |
{ | |
protected $configuration = [ | |
'token_file' => null, // path to a file to store token information | |
'api_authorization_token' => null, // authorization to talk to token service | |
'api_token_url' => null, // url to post to |
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 EntityMapperFramework { | |
class EntityMapper { | |
public function __construct() { | |
stream_wrapper_register('dynamicproxygenerator', __NAMESPACE__ . '\DynamicProxyGeneratorStream'); | |
} | |
public function createProxy($entity) { | |
$class = get_class($entity); |
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 | |
function array_walk_recursive_key(array $array, callable $valueCallback, callable $keyCallback = null) { | |
foreach ($array as $n => &$v) { | |
$n2 = ($keyCallback) ? $keyCallback($n) : $n; | |
if ($n != $n2) { | |
$array[$n2] = &$array[$n]; | |
unset($array[$n]); | |
} | |
if (is_array($v)) { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
copy(__DIR__ . '/music.db.original', __DIR__ . '/music.db'); | |
include 'vendor/autoload.php'; | |
return new Zend\Db\Adapter\Adapter(array( | |
// Sqlite Configuration | |
'driver' => 'Pdo', | |
'dsn' => 'sqlite:' . __DIR__ . '/music.db', |
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
require "#{ENV["TM_SUPPORT_PATH"]}/lib/scriptmate" | |
class NodeScript < UserScript | |
def lang; "JavaScript" end | |
def default_extension; ".js" end | |
def args | |
[] | |
end | |
def executable; @hashbang || ENV['TM_NODE'] || 'node' end | |
def version_string |
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 | |
function matchNamedArguments($target, $arguments = array()) | |
{ | |
if (!is_array($arguments) && !$arguments instanceof \ArrayAccess) { | |
throw new \InvalidArgumentException('$arguments for ' . __CLASS__ . ' must be array or ArrayAccess'); | |
} | |
if (is_string($target) || $target instanceof \Closure) { | |
$r = new \ReflectionFunction($target); |