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 | |
| require __DIR__ . '/vendor/autoload.php'; | |
| $size = 1000000; | |
| $repeat = max([1, intval(5000000 / $size)]); | |
| $targetArray = range(1, $size); | |
| function plus1($n) { | |
| return $n + 1; |
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 | |
| namespace hoge\fuga; | |
| use Aws\Credentials\Credentials; | |
| use Aws\Signature\SignatureV4; | |
| use GuzzleHttp\Client; | |
| use GuzzleHttp\Psr7\Request; | |
| use yii\console\Controller; | |
| class AwsEsTestController extends Controller |
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 | |
| namespace App\Models; | |
| use Illuminate\Database\Eloquent\Model; | |
| /** | |
| * App\Models\Article | |
| * | |
| * @property integer $id |
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 | |
| namespace app\utils\widgets; | |
| use yii\helpers\Html; | |
| use yii\widgets\LinkPager; | |
| /** | |
| * ResponsiveLinkPager can reduce or style each buttons for responsive design. | |
| * | |
| * Define CSS classes as if maxButtonCount would be so. For example below applies hidden-xs class |
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($) { | |
| $.fn.confirmBeforeSubmit = function(options) { | |
| options = $.extend({ | |
| message: "本当に実行しますか。" | |
| }, options); | |
| this.each(function() { | |
| var $button = $(this); | |
| var $form = $button.closest('form'); |
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 | |
| /** | |
| * Sample code | |
| */ | |
| trait EmojiTrait | |
| { | |
| /** @var array */ | |
| protected $emojiMap = null; |
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 | |
| namespace app\models; | |
| use yii\db\ActiveRecord; | |
| abstract class Job extends ActiveRecord | |
| { | |
| public static function tableName() |
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
| . | |
| ├── codeception | |
| │ ├── _output | |
| │ ├── _support | |
| │ │ └── FixtureLoader.php --- フィクスチャ全部ロードするやつ | |
| │ ├── bin | |
| │ │ ├── _bootstrap.php | |
| │ │ ├── yii | |
| │ │ └── yii.bat | |
| │ ├── config |
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
| CREATE TABLE test ( | |
| day1 DATETIME, | |
| day2 TIMESTAMP | |
| ); | |
| SET SESSION time_zone = 'UTC'; | |
| INSERT INTO test VALUES ('2014-12-25 00:00:00', '2014-12-25 00:00:00'); | |
| SET SESSION time_zone = 'Asia/Tokyo'; | |
| INSERT INTO test VALUES ('2014-12-25 00:00:00', '2014-12-25 00:00:00'); | |
| SET SESSION time_zone = 'UTC'; | |
| SELECT * FROM test; |
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 | |
| $text = "あいうえお"; | |
| $text1 = substr($text, 1); | |
| $text2 = substr($text, 2); | |
| echo mb_strimwidth($text1, 0, 10) . "\n"; | |
| echo mb_strimwidth($text2, 0, 10) . "\n"; | |
| function valid($text) { | |
| return (ord($text[0]) & 0xa0) != 0x80; |