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: Show Server Time | |
Description: Shows the current server time when scheduling posts. This is helpful when there is a time difference between your local computer and the remote server | |
Version: 0 | |
Author: Michael Girouard | |
Author URI: http://www.lovemikeg.com/ | |
*/ |
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
function curry (method, scope, params) { | |
scope = scope || window; | |
params = params || []; | |
return function () { | |
return method.apply(scope, params); | |
}; | |
}; |
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 | |
$options = getopt('p:'); | |
$prefix = empty($options['p']) | |
? realpath('.') | |
: realpath($options['p']); | |
if (empty($prefix)) { | |
die("Bad prefix. Try again.\n"); | |
} |
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 | |
class Calendar | |
{ | |
protected $date; | |
public $timezone = 'America/New_York'; | |
public $yearFormat = 'Y'; | |
public $monthFormat = 'n'; | |
public $dayFormat = 'd'; |
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 app\controllers; | |
use \app\models\Book; | |
use \app\models\Job; | |
use \app\models\File; | |
class BooksController extends \lithium\action\Controller { |
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 | |
/* ----- snip (omitting everything already in config/bootstrap/action.php) ----- */ | |
/** | |
* Filter to capture any admin-specific requests | |
* This simply updates the internal action name for dispatching purposes. In order for this to | |
* properly work across the board, you'll need to enable a persistent param for `admin` in your | |
* routes configuration. Something to the effect of the following will do nicely: | |
* |
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
add_shortcode('mg_username', 'mg_username_shortcode'); | |
function mg_username_shortcode($args) { | |
$user = wp_get_current_user(); | |
if ($user && !empty($user->user_login)) { | |
return $user->user_login; | |
} | |
else { | |
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
#!/bin/bash | |
for p in `ls` | |
do | |
echo Updating $p | |
[[ -d $p/.git ]] && cd $p && git pull && cd .. | |
[[ -d $p/.svn ]] && svn up $p | |
done |
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 | |
function git_uri () | |
{ | |
echo $(git remote -v | grep "$1" | grep "fetch" | sed -E -e 's/^[a-z]+| |\(.+\)//g') | |
} | |
for VENDOR in `ls`; do | |
# Skip files | |
[[ -f $VENDOR ]] && continue |
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
mbp:EC6 m2$ ab -n 100 -c 10 http://www.willistherage.com/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking www.willistherage.com (be patient).....done | |
Server Software: Apache/2.2.3 | |
Server Hostname: www.willistherage.com |
OlderNewer