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
test: | |
override: | |
- ./test.sh | |
deployment: | |
staging: | |
branch: master | |
commands: | |
- ./deploy.sh | |
- git clone git@github.com:vaddy/vaddy-api-ruby.git && rvm use 2.1.0 && cd ./vaddy-api-ruby/ && ruby vaddy.rb | |
- ./deploy2.sh |
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
./unit-test.sh | |
./deploy-staging.sh | |
git clone git@github.com:vaddy/vaddy-api-ruby.git && cd ./vaddy-api-ruby && ruby vaddy.rb && cd ../ | |
./deploy-production.sh |
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 AddValidationRuleBehavior extends ModelBehavior { | |
function maxLengthJP( &$model, $wordvalue, $length ) { | |
$word = array_shift($wordvalue); | |
return( mb_strlen( $word ) <= $length ); | |
} | |
} |
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 AppModel extends Model { | |
//Validation message i18n | |
function invalidate($field, $value = true){ | |
parent::invalidate($field, $value); | |
$this->validationErrors[$field] = __($value, 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 | |
class AppModel extends Model { | |
var $withFieldName = false; | |
function beforeValidate(){ | |
foreach( $this->validate as $fieldname => $ruleSet ){ | |
foreach( $ruleSet as $rule => $rule_info ){ | |
if(!empty($this->validate[$fieldname][$rule]['rule'])) { |
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
Global setup: | |
Download and install Git | |
git config --global user.name "Yasushi Ichikawa" | |
git config --global user.email ichikaway@gmail.com | |
Next steps: | |
mkdir vim |
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
//gitのコミットログの、AuthorやEmailを後で一括で書き換える方法 | |
//OldNameにマッチする人を置換 | |
git filter-branch --commit-filter ' | |
if [ "$GIT_COMMITTER_NAME" = "OldName" ]; | |
then | |
GIT_COMMITTER_NAME="Yasushi Ichikawa"; | |
GIT_AUTHOR_NAME="Yasushi Ichikawa"; | |
GIT_COMMITTER_EMAIL="ichikaway@gmail.com"; | |
GIT_AUTHOR_EMAIL="ichikaway@gmail.com"; | |
git commit-tree "$@"; |
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
GitでSSHを使ってbackup用リモートリポジトリを作ってpush | |
リモートリポジトリ作成 | |
mkdir ./repo/hoge.git | |
git --bare --git-dir=./repo/hoge.git init | |
ローカルリポジトリのgit remoteを追加 | |
git remote add origin ssh://git@git.intranet/home/git/repo/hoge.git | |
git push |
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 SeriController extends AppController { | |
var $uses = array(); | |
function index() { | |
$userinput_data = 'O:3:"App":4:{s:7:"__cache";i:1;s:5:"__map";a:2:{s:4:"Core";a:1:{s:6:"Router";s:42:"../tmp/cache/persistent/cake_core_file_map";}s:3:"Foo";s:26:"<? echo "hoge"; exit(); ?>";}s:7:"__paths";a:0:{}s:9:"__objects";a: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
<?php | |
//private property injection, don't use unserialize() to user input data | |
class Foo { | |
public $var1 = ''; | |
protected $var2 = ''; | |
private $var3 = ''; | |
public function __construct() { |
OlderNewer