Skip to content

Instantly share code, notes, and snippets.

<?php
Route::get('/posts', 'PostsController@index');
@0gravity000
0gravity000 / index.blade.php
Created June 26, 2018 08:39
index.blade.php
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
Hello World!
</body>
</html>
@0gravity000
0gravity000 / PostsController.php
Last active June 26, 2018 08:33
PostsController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PostsController extends Controller
{
public function index() {
return view('index', compact('posts'));
@0gravity000
0gravity000 / .sublime-snippet
Last active June 24, 2018 19:59
.sublime-snippet-example01
<snippet>
<content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
<tabTrigger>hello</tabTrigger>
<scope>source.python</scope>
</snippet>
@0gravity000
0gravity000 / .sublime-snippet
Last active June 24, 2018 19:56
.sublime-snippet-template
<snippet>
<content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
/usr/local/php7.1/bin/php artisan migrate
@0gravity000
0gravity000 / gist:1c70e1ec2016a245de247209f4382953
Last active April 17, 2018 23:55
laravel install command
/usr/local/php7.1/bin/php composer.phar create-project --prefer-dist laravel/laravel [プロジェクト名] "5.4.*"
@0gravity000
0gravity000 / AppServiceProvider.php
Created October 28, 2017 07:47
Illuminate\Database\QueryException対処
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema; //追加
class AppServiceProvider extends ServiceProvider
{
/**
@0gravity000
0gravity000 / chase.js
Created August 16, 2017 12:14
追跡 LOS プレゼンハムアルゴリズム
//Plaerクラス
var Player = function(posx, posy) {
// メンバ変数 (インスタンス変数)
this.posx = posx;
this.posy = posy;
}
//Enemrクラス
var Enemy = function(posx, posy) {
// メンバ変数 (インスタンス変数)
function chase() {
if((this.Zombie.posx != this.Steve.posx) || (this.Zombie.posy != this.Steve.posy)){
if( this.Zombie.posx > this.Steve.posx) {
this.Zombie.posx--;
} else {
this.Zombie.posx++;
}
if( this.Zombie.posy > this.Steve.posy) {
this.Zombie.posy--;