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
#push a local branch to repo if does not exist remotely | |
git push origin branch_name:refs/heads/branch_name | |
# to start tracking a branch | |
git branch --track branch_name origin/branch_name | |
# create remote git branch from head of master | |
git push origin origin:refs/heads/branch_name | |
# create a remote branch from another branch's head |
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 | |
if (!defined('TMP')) { | |
define('TMP', getcwd() . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR); | |
} | |
$file = getcwd() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'database.php'; | |
if (!is_readable($file)) { | |
echo "Can't find database config at : $file\n"; | |
die(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
[alias] | |
st = status -sb | |
ci = commit | |
co = checkout | |
br = branch | |
lg = log --graph --pretty=format:'%C(yellow)%h%Creset -%Cblue%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative | |
info = config --list | |
last = log --format=medium -n 5 | |
rollback = reset HEAD~1 | |
unindex = reset HEAD |
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
AuthUserFile :vhosts/.htpasswd | |
AuthGroupFile /dev/null | |
AuthName ByPassword | |
AuthType Basic | |
<Limit GET> | |
require user d1rk |
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
public function load() | |
{ | |
global $PHP_SELF; | |
global $wp_embed; | |
global $wpdb; | |
$db = Connections::get('default', array('config'=>true)); | |
//set connection to inboundink database just so it has a valid connection for now | |
//when actually doing something, it will connect to the appropriate db | |
define('DB_HOST', $db['host'] ); | |
define('DB_NAME', $db['database'] ); |
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 | |
xdebug_start_trace('/tmp/mytrace'); | |
// do stuff | |
xdebug_stop_trace(); | |
?> |
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 | |
# From my question and answer at SO: | |
# http://stackoverflow.com/questions/10183103/security-of-generating-hash-salts-using-phps-mt-rand | |
function blowfish($string, $salt = NULL, $iterations = '12') | |
{ | |
return crypt($string, $salt ?: "$2a\$$iterations$" . md5(mcrypt_create_iv(22, MCRYPT_DEV_URANDOM))); | |
} |
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 | |
/** | |
* This script is meant to be executed via crontab. | |
* It should help you easily set li3 commands as cron jobs. | |
* | |
* You should put this in the root of your application. | |
* However, you don't need to, but you would then need to | |
* pass a --path= option with the path to your app. | |
* This is because the li3 console command must be called | |
* from a specific location. |
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 lithium\action\Response; | |
use lithium\core\Environment; | |
use lithium\core\ErrorHandler; | |
use lithium\core\Libraries; | |
use lithium\console\Response as ConsoleResponse; | |
use lithium\net\http\Media; | |
use lithium\analysis\Logger; | |
use lithium\net\http\Service; |
OlderNewer