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
#compdef homeshick | |
_homeshick () { | |
local context state line curcontext="$curcontext" ret=1 | |
_arguments -n : \ | |
{-q,--quiet}'[Suppress status output]' \ | |
'(-s --skip)'{-f,--force}'[Overwrite files that already exist]' \ | |
'(-f --force)'{-s,--skip}'[Skip files that already exist]' \ | |
{-b,--batch}'[Batch-mode: Skip interactive prompt]' \ | |
{-h,--help}'[Help message]' \ |
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
update | |
# add repositories | |
tap homebrew/binary || true | |
tap homebrew/completions || true | |
tap homebrew/dupes || true | |
tap homebrew/versions || true | |
tap phinze/homebrew-cask || true | |
tap josegonzalez/php || true |
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 h($var) { | |
return htmlspecialchars($var, ENT_QUOTES, 'Shift_JIS'); | |
} | |
function r($key, $escape=true) { | |
$value = (!empty($_REQUEST[$key])) ? $_REQUEST[$key] : null; | |
if ($escape!==true) return $value; | |
return h($value); |
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 Hoge | |
{ | |
public $hoge = array(1,2,3); | |
private $_page = array('a','b','c'); | |
} | |
function falsificate(& $property) |
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
server { | |
listen 8080; | |
server_name example.dev www.example.dev; | |
location / { | |
root /Users/Cobby/Sites/Example; | |
if ($host = 'www.example.dev' ) { | |
rewrite ^/(.*)$ http://example.dev:8080/$1 permanent; | |
} |
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 | |
subversion_base_config_path="${HOME}/.subversion" | |
config_file="${subversion_base_config_path}/servers" | |
function abort() | |
{ | |
echo $1 2>&1 | |
exit 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
#!/bin/bash | |
os_x="" | |
if [ -x `which sw_vers` ]; then | |
os_x="${sw_vers} | grep 'Mac OS X'" | |
fi | |
if [ -n "$os_x" ]; then | |
echo "Mac OS X" | |
else |
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 | |
if [ ! -x `which brew` ]; then | |
echo "Homebrew does not installed." | |
exit 1 | |
fi | |
php_path=`which php` | |
php_real_path=`stat -F $php_path` |
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 | |
echo " On Light Gray: On Black:" | |
echo -e "\033[47m\033[1;37m White \033[0m\ | |
1;37m \ | |
\033[40m\033[1;37m White \033[0m" | |
echo -e "\033[47m\033[37m Light Gray \033[0m\ | |
37m \ | |
\033[40m\033[37m Light Gray \033[0m" | |
echo -e "\033[47m\033[1;30m Gray \033[0m\ |
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 | |
$ip = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : ''; | |
$allowed_ips = array( | |
'127.0.0.1', | |
'192.168.11.*', | |
); | |
$validate = false; | |
foreach ($allowed_ips as $allowed_ip) { | |
if (preg_match('/^' . $allowed_ip . '$/', $ip)) { |
NewerOlder