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 ../;
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
#!/usr/bin/php | |
<?php | |
/** | |
* Because you want "tree", but cannot find the source code quick enough | |
* on the web to compile for OS.X or there is no suitable implementation | |
* on windows. | |
*/ | |
// set error reporting | |
error_reporting(E_STRICT | E_ALL); |
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 | |
setup(); | |
$t = new Tree('top', 'T'); | |
$t->append(new TreeNode('one', 1)); | |
$t->append($x = new TreeNode('two', 2)); | |
$t->append(new TreeNode('three', 3)); | |
$t->append(new TreeNode('foo', 'foo')); |
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 | |
// start PHP with: php -S localhost:8888 -t . spider.php | |
$site = 'http://www.targetwebsite.org/'; | |
$path = $_SERVER["REQUEST_URI"]; | |
if ($path == '/') { | |
$path = '/index.html'; |
Ralph's Database Column Organization
TLDR:
- primary key columns (e.g.
id
) - foreign key columns (e.g.
other_id
) - row qualifying columns (e.g.
status
) - entity identification columns (e.g.
name
,title
,slug
,base_url
) - non-string-based entity attribute columns (e.g.
rating
,is_admin
) - string-based entity attribute columns (e.g.
short_description
,description
,notes
)
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)) { |