Skip to content

Instantly share code, notes, and snippets.

Takashi Nojima nojimage

View GitHub Profile
View ControllerResolver.php
<?php
/**
* Copyright 2018 Takashi Nojima.
*/
namespace App\Routing;
use Cake\Controller\Controller;
use Cake\Http\ControllerFactory;
use Cake\Http\Response;
@nojimage
nojimage / .gitlab-ci.yml
Last active Dec 4, 2018
Exclude run CI job on "WIP:" or "@wip" in the commit message
View .gitlab-ci.yml
(...snip...)
- vendor/bin/phpunit --coverage-text --colors=never --exclude-group=external
except:
variables:
- $CI_COMMIT_MESSAGE =~ /(?:^WIP:)|@WIP/i
@nojimage
nojimage / Chrome.php
Last active Jul 13, 2018
Codeception / WebDriver / ChromeDriver でモバイルエミュレーションする
View Chrome.php
<?php
/**
*
* Copyright 2018 ELASTIC Consultants Inc.
*
*/
namespace Helper\MobileEmulation;
use Codeception\Module;
@nojimage
nojimage / CakeFixture.php
Last active Dec 8, 2017
CakePHP Fixture Module for Codeception
View CakeFixture.php
<?php
namespace Codeception\Module;
use Cake\TestSuite\Fixture\FixtureManager;
use Codeception\Module;
use Codeception\Test\Cest;
use Codeception\TestInterface;
use Exception;
use stdClass;
@nojimage
nojimage / FileLog.php
Created Oct 3, 2017
CakePHP3 のログで$contextを宜しくロギング
View FileLog.php
<?php
/*
*
* Copyright 2017 ELASTIC Consultants Inc.
*
*/
namespace Elastic\ContextLogEngine\Log\Engine;
use Cake\Http\ServerRequest;
View ClearCacheShell.php
<?php
App::uses('Shell', 'Console');
/**
* ClearCache
*
* CakePHP 2.0
* PHP versions 5
*
@nojimage
nojimage / AppModel.php
Created Jan 20, 2017
CakePHP 2.x findEach
View AppModel.php
<?php
/**
* 検索結果に対して処理を行う
*
* example:
* $model->findEach(['conditions' => ['status' => 1]], function ($data) {
* // $data = ['Model' => [ ... ]]
* debug($data);
* });
*
@nojimage
nojimage / phpunit.sh
Created Oct 4, 2016
CakePHP 2.x Run UnitTest on Remote for NetBeans 8.2
View phpunit.sh
#!/usr/bin/env bash
##
# Custom PHPUnit script for Remote test on NetBaeans 8.2
##
PROJECT_ROOT=$(cd "$(dirname "$(dirname "$0")")" && pwd)
#
# Change these settings to your env
#
@nojimage
nojimage / 01佐賀県教育ネットワークの不正アクセスに関わる私的まとめ.md
Last active Jul 20, 2016
佐賀県教育ネットワークの不正アクセスに関わる私的まとめ
View 01佐賀県教育ネットワークの不正アクセスに関わる私的まとめ.md

2016/07/20

7月19日に記者発表を行った模様。

@nojimage
nojimage / BehaviorEventTrait.php
Created Jun 9, 2016
ビヘイビアが実行するイベントをOn/Offするやつ
View BehaviorEventTrait.php
<?php
namespace App\Model\Behavior;
use Cake\Event\EventDispatcherInterface;
use Cake\Event\EventListenerInterface;
/**
* ビヘイビアが実行するイベントをコントロール
*/
You can’t perform that action at this time.