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 | |
//SETTINGS | |
//Facebook APP ID | |
$client_id = 'YOUR_APP_ID'; | |
//Facebook APP SECRET | |
$client_secret = 'YOUR_APP_SECRET'; | |
//WebURI to access this script | |
$redirect_uri = 'http://YOUR.DOMAIN/PATH/TO/this_script.php'; | |
//Scopes U need | |
//Scopes: https://developers.facebook.com/docs/authentication/permissions/ |
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 | |
echo "Hello world.\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
print "Hello world.\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
#!/bin/sh | |
sudo yum -y remove php php-common php-mysql php-mbstring php-cli php-gd php-soap php-pdo php-xml | |
sudo yum -y remove httpd httpd httpd-tools | |
sudo yum -y install httpd24 mod24_ssl | |
sudo yum -y install php55-common php55-mysqlnd php55-mbstring php55-cli php55-gd php55-soap php55-pdo php55 php55-xml | |
sed -i -e 's/;date\.timezone =/date\.timezone = "Asia\/Tokyo"/g' /etc/php.ini | |
sudo chkconfig httpd on |
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 | |
REMOTE_NAME='origin' | |
git fetch --prune ${REMOTE_NAME} | |
msg='' | |
for remote_branch in `git branch -r | grep -v '\->'| grep ${REMOTE_NAME}/` | |
do | |
ahead=0 |
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
App::uses('Controller', 'Controller'); | |
AppController extends Controller { | |
public function __construct($request = null, $response = null) { | |
parent::__construct($request, $response); | |
// ここに書いた処理はComponent初期化より前に実行されます | |
} | |
public function startupProcess() { | |
// ここに書いた処理はComponent初期化より前に実行されます | |
// 親クラス(Controller)のstartupProcess()より前に書く必要があります。 |
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
;;display settings | |
(tool-bar-mode nil) ;ツールバーを消す | |
(show-paren-mode t) ; 対応する括弧のハイライト | |
(display-time) | |
(setq-default truncate-lines t) ;右端で折り返さない | |
(setq-default truncate-partial-width-windows t) ;右端で折り返さない | |
;; 行番号 | |
(global-linum-mode t) | |
(set-face-attribute 'linum nil |
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 add($number1, $number2) { | |
return $number1 + $number2; | |
} | |
$func = 'add'; | |
echo $func(1, 1); | |
// -> 2 | |
echo 'add'(1, 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/sh | |
do_start() | |
{ | |
#このインスタンスのPublicIPアドレスをRDSのセキュリティグループに追加 | |
PUBLICADDR=`curl http://169.254.169.254/latest/meta-data/public-ipv4 2> /dev/null` | |
aws rds authorize-db-security-group-ingress --db-security-group-name SECURITY-GROUP-NAME --cidrip "${PUBLICADDR}/32" | |
#このインスタンスをELB配下に置く | |
INSTANCEID=`curl http://169.254.169.254/latest/meta-data/instance-id 2> /dev/null` |
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/sh | |
GITIGNOREPATH=`git rev-parse --show-toplevel`'/.gitignore' | |
if [ $? -ne 0 ] | |
then | |
exit $? | |
fi | |
if [ ! -f $GITIGNOREPATH ] |