This file contains hidden or 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
git diff ref1 ref2 --raw | awk '{if($5 ~ /D/){print "rm", $6;}}' |
This file contains hidden or 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
cd /path_to_src | |
git clone git://gist.github.com/705408.git git-now | |
sudo ln -s /path_to_src/git-now/git-now /opt/local/libexec/git-core/ |
This file contains hidden or 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 | |
// app/app_controller.php | |
class AppController extends Controller { | |
public $components = array('Maintenance.Maintenance' => array('maintenanceUrl' => '/pages/maintenance')); | |
// ... snip | |
} |
This file contains hidden or 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
# メンテナンス画面のURL | |
ErrorDocument 503 /maintenance.html | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# 2011年05月27日 20:00 以降をメンテナンスモードにする | |
RewriteCond %{TIME} >201105272000.* | |
# メンテナンス画面と画像,js,cssをリダイレクトから除外 |
This file contains hidden or 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 JapaneseTestCase extends CakeTestCase { | |
function test日本語のテストケースメソッドを書いてみるテスト() { | |
$this->assertTrue(true); | |
$this->assertFalse(true, 'これは失敗するテスト: %s'); | |
} | |
} |
This file contains hidden or 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 proml { | |
local FONT_RESET="\[\033[0m\]" | |
local FONT_BOLD="\[\033[1m\]" | |
local BLACK="\[\033[0;30m\]" | |
local RED="\[\033[0;31m\]" | |
local GREEN="\[\033[0;32m\]" | |
local YELLOW="\[\033[0;33m\]" | |
local BLUE="\[\033[0;34m\]" | |
local MAGENTA="\[\033[0;35m\]" | |
local CYAN="\[\033[0;36m\]" |
This file contains hidden or 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 | |
SERVICES=('zabbix_agentd' 'sshd' 'denyhosts' 'httpd' 'mysqld' 'postfix' 'amavisd') | |
for service in ${SERVICES[@]}; do | |
proc_count=`ps ax | grep -v 'grep' | grep -c "$service" 2>/dev/null` | |
if [ $proc_count -eq 0 ]; then | |
echo "start ${service}..." | |
/etc/init.d/${service} start | |
fi; |
This file contains hidden or 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
sudo port install gearmand +drizzle | |
sudo port install php5-gearman | |
sudo vim /Library/LaunchDaemons/org.macports.gearmand.plist |
This file contains hidden or 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 | |
/** | |
* for code completion | |
* | |
* @link http://docs.php.net/manual/en/book.gearman.php | |
*/ | |
if (false) { | |
define('GEARMAN_SUCCESS', 0); |
This file contains hidden or 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 | |
/** | |
* HttpSocket support Proxy | |
* | |
* for CakePHP 1.3+ | |
* PHP version 5.2+ | |
* | |
* Copyright 2011, nojimage (http://php-tips.com/) | |
* | |
* Licensed under The MIT License |