Skip to content

Instantly share code, notes, and snippets.

use Carbon\Carbon;
/**
* 全認証/認可サービスの登録
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
@hiroykam
hiroykam / connect.go
Last active April 15, 2018 14:47
Golang(ECHO+GORM)でJWTとGraphQLの環境を構築 ref: https://qiita.com/hiroykam/items/31862832a562388d876b
package db
import (
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
)
func ConnectGORM() *gorm.DB {
DBMS := "mysql"
USER := "root"
@hiroykam
hiroykam / App.js
Last active November 6, 2017 01:10
react-routerとreact-router-reduxのサンプルと環境構築 ref: http://qiita.com/hiroykam/items/b7c9380b5d394b899905
import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import * as myActions from '../actions/count'
class AppComponent extends Component {
render() {
return (
<div>
@hiroykam
hiroykam / app.js
Last active October 12, 2017 12:15
es6でよく使うユーティリティ ref: http://qiita.com/hiroykam/items/2962169443db60c29b59
"use strict";
import Dnd from "./dnd"
class App {
static exec() {
const obj = new App()
obj.init()
}
@hiroykam
hiroykam / file0.txt
Last active September 5, 2017 14:44
Python/Rubyの浅いコピーと深いコピーについて ref: http://qiita.com/hiroykam/items/e11fbfaa6974ed9ffb08
a = 3
print("id_3:%d, id_a:%d" % (id(3), id(a)))
b = a
print("id_b:%d" % id(b))
a += 1
print("id_3:%d, id_4:%d, id_a:%d, id_b:%d" % (id(3), id(4), id(a), id(b)))
import React, { Component } from 'react'
import ReactDOM from 'react-dom';
import ReduxInfiniteScroll from 'redux-infinite-scroll'
export default class ReduxInfiniteScrollEx extends ReduxInfiniteScroll {
constructor(props) {
super(props)
this._pastLength = 0
}
@hiroykam
hiroykam / file0.txt
Last active September 18, 2017 15:31
Rubyのインスタンス変数・メソッドとクラス変数・メソッドを検証 ref: http://qiita.com/hiroykam/items/9b47ca3fc05afbf91903
class Test
@c_i_var = 0
@@c_var = 10
var = 'var'
def initialize
@i_var = 100
end
def test
@hiroykam
hiroykam / DemoComponent.jsx
Last active August 15, 2017 07:21
ReactJS+Reduxで非同期Actionとコンポーネントの再利用 ref: http://qiita.com/hiroykam/items/408f3ab7c240ca2df02d
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import * as components from './components.jsx'
import * as actions from './actions.jsx'
import style from '../css/style.css'
class DemoContainer extends Component {
render() {
const { demoA, demoB, actions } = this.props;
export PATH=$(brew --prefix openssl)/bin:$PATH
@hiroykam
hiroykam / file0.txt
Last active July 1, 2017 03:40
Python+uWSGIでノンブロッキング ref: http://qiita.com/hiroykam/items/440d2763d824997b9700
$ pip3 install greenlet