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 PostController extends Controller | |
{ | |
// ... | |
public function actionDelete($id) | |
{ | |
$this->findModel($id)->delete(); | |
if (!Yii::$app->request->isAjax) { | |
return $this->redirect(['index']); |
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
package s | |
import ( | |
"bytes" | |
"testing" | |
) | |
func A1() (s string) { | |
for i := 0; i < 1000; i++ { | |
s += "a" |
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 | |
declare -a a=(a1 a2 a3) | |
# 配列をすべて表示 | |
echo "${a[@]}" | |
# a1 a2 a3 | |
# 配列の先頭に要素を追加 | |
a=(a0 ${a[@]}) |
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
if application "iTunes" is running then | |
tell application "iTunes" | |
set songInfo to current stream title | |
-- 保存場所は任意 | |
set savePath to "/Users/jamband/Dropbox/document/etc/music.txt" | |
do shell script "echo \"" & songInfo & "\" >>" & savePath | |
end tell | |
end if |
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 | |
return array( | |
... | |
'aliases' => array( | |
'actions' => 'application.components.actions', | |
), | |
'import' => array( | |
'application.models.*', | |
'application.components.*', | |
//'application.components.actions.*', |
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 | |
$scenario->group('containJs'); | |
$I = new WebGuy($scenario); | |
$I->amOnPage(WordPage::URL_EDIT); | |
SitePage::of($I)->login(); | |
$I->amGoingTo('400エラーの確認'); | |
$I->amOnPage(WordPage::URL_DELETE.'/5'); | |
$I->see($error400); |
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
watch('./(.*).php') { |m| changed(m[0]) } | |
def changed(file) | |
run "clear && cd tests && phpunit unit" | |
end | |
def run(cmd) | |
result = `#{cmd}` | |
puts result | |
notify result |
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
$exec = "phpunit" | |
watch('models/(.*).php') { |m| changed(m[0]) } | |
watch('tests/unit/(.*)Test.php') { |m| changed(m[0]) } | |
def changed(file) | |
# pathは人それぞれ | |
path = "/Users/xxx/Dropbox/htdocs/hoge/protected/tests/" | |
run "cd #{path} && #{$exec} unit/" | |
end |
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 | |
trait Trait1 | |
{ | |
public function a() | |
{ | |
echo 'a1'; | |
} | |
} | |
trait Trait2 |
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 | |
return array( | |
... | |
'commandMap' => array( | |
'migrate' => array( | |
'class' => 'system.cli.commands.MigrateCommand', | |
'migrationTable' => 'migration', | |
'templateFile' => 'application.migrations.template', | |
), | |
), |
NewerOlder