Skip to content

Instantly share code, notes, and snippets.

daiki.sekiguchi daiki44

Block or report user

Report or block daiki44

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@daiki44
daiki44 / change-call-user-model.sh
Created Sep 17, 2018
【Laravel】Model ファイルのディレクトリ構成変更時にやること ref: https://daiki-sekiguchi.com/2018/09/17/laravel-how-to-change-model-dir/
View change-call-user-model.sh
# RegisterController.php
$ vim app/Http/Controllers/Auth/RegisterController.php
$ cat app/Http/Controllers/Auth/RegisterController.php
<?php
namespace App\Http\Controllers\Auth;
# 「Models\」を追加
use App\Models\User;
use App\Http\Controllers\Controller;
@daiki44
daiki44 / move-user.sh
Created Sep 17, 2018
【Laravel】Model ファイルのディレクトリ構成変更時にやること ref: https://daiki-sekiguchi.com/2018/09/17/laravel-how-to-change-model-dir/
View move-user.sh
$ mv app/User.php app/Models/
$ vim app/Models/User.php
$ cat app/Models/User.php
<?php
# 「Models\」を追加
namespace Models\App;
use Illuminate\Notifications\Notifiable;
@daiki44
daiki44 / mkdir-Models.sh
Created Sep 17, 2018
【Laravel】Model ファイルのディレクトリ構成変更時にやること ref: https://daiki-sekiguchi.com/2018/09/17/laravel-how-to-change-model-dir/
View mkdir-Models.sh
$ cd <Laravelプロジェクト PATH>
$ mkdir app/Models
View success.js
let insert = await this.client.query(
'INSERT INTO table(column1, column2, column3, column4, column5) VALUES($1, $2, $3, $4, $5)',
[val1, val2, val3, val4, val5]
);
View error.js
let insert = await this.client.query(
'INSERT INTO table(column1, column2, column3, column4, column5) VALUES($1, $2, $3, $4, $5)',
[val1, val2, val3, val4]
);
@daiki44
daiki44 / es6-do.js
Created Sep 11, 2018
【Node.js】babel を使って ECMAScript 2015 (ES6) へ対応する ref: https://daiki-sekiguchi.com/2018/09/11/nodejs-how-to-use-es6/
View es6-do.js
$ cat es6.js
import moment from 'moment';
console.log(moment.now());
$ npm run start
> nodejs@1.0.0 start /Users/daiki.sekiguchi/work/blog/nodejs
> babel-node es6.js
@daiki44
daiki44 / package.json
Created Sep 11, 2018
【Node.js】babel を使って ECMAScript 2015 (ES6) へ対応する ref: https://daiki-sekiguchi.com/2018/09/11/nodejs-how-to-use-es6/
View package.json
...
"scripts": {
"start": "babel-node es6.js",
...
},
...
@daiki44
daiki44 / .babelrc
Created Sep 11, 2018
【Node.js】babel を使って ECMAScript 2015 (ES6) へ対応する ref: https://daiki-sekiguchi.com/2018/09/11/nodejs-how-to-use-es6/
View .babelrc
{
"presets": [
[
"env", {
"targets": {
"node": "current"
}
}
]
]
@daiki44
daiki44 / babel-install.sh
Created Sep 11, 2018
【Node.js】babel を使って ECMAScript 2015 (ES6) へ対応する ref: https://daiki-sekiguchi.com/2018/09/11/nodejs-how-to-use-es6/
View babel-install.sh
$ npm install --save-dev babel-cli
$ npm install --save-dev babel-preset-env
@daiki44
daiki44 / es6-error.js
Created Sep 11, 2018
【Node.js】babel を使って ECMAScript 2015 (ES6) へ対応する ref: https://daiki-sekiguchi.com/2018/09/11/nodejs-how-to-use-es6/
View es6-error.js
$ cat es6.js
import moment from 'moment';
console.log(moment.now());
$ node es6.js
/Users/daiki.sekiguchi/work/blog/nodejs/es6.js:1
(function (exports, require, module, __filename, __dirname) { import moment from 'moment';
^^^^^^
You can’t perform that action at this time.