Skip to content

Instantly share code, notes, and snippets.

View t301000's full-sized avatar

林士立 t301000

  • 育林國中
  • New Taipei City
View GitHub Profile
[{"name":"posts","color":"Red","position":{"x":100,"y":99},"increment":true,"timestamp":true,"softdelete":true,"column":[{"name":"title","type":"string","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":true,"guarded":false,"visible":false,"hidden":false,"colid":"c58","order":0},{"name":"content","type":"text","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":true,"guarded":false,"visible":false,"hidden":false,"colid":"c66","order":1}],"relation":[],"seeding":[[{"colid":"c58","content":"post 1"},{"colid":"c66","content":"test seed"}],[{"colid":"c58","content":"post 2"},{"colid":"c66","content":"swssss"}]]}]
@t301000
t301000 / ArrayAccessExample.php
Last active August 29, 2015 14:24
ArrayAccess example from php.net
<?php
class obj implements arrayaccess {
private $container = array();
//設定 $container
public function __construct() {
$this->container = array(
"one" => 1,
"two" => 2,
"three" => 3,
@t301000
t301000 / CategoriesTableSeeder.php
Last active August 29, 2015 14:25
無窮分類列表範例
<?php
use Illuminate\Database\Seeder;
class CategoriesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
@t301000
t301000 / Category.php
Last active August 29, 2015 14:25
無窮分類列表 ver 2
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
// 定義 self relation,用來處理子分類
@t301000
t301000 / PjaxMiddleware.php
Created October 12, 2015 03:49 — forked from JeffreyWay/PjaxMiddleware.php
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware
@t301000
t301000 / 0_reuse_code.js
Created November 26, 2015 15:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@t301000
t301000 / app.component.html
Last active May 31, 2017 09:45
簡易計數器範例
<app-counter-button [step]="-2" (changed)="change($event)"></app-counter-button>
{{ counter }}
<app-counter-button [step]="5" (changed)="change($event)"></app-counter-button>
@t301000
t301000 / color-plate.component.html
Created June 3, 2017 08:42
20170531 作業實做參考
<div class="color"
[ngStyle]="{'background-color': myStyle}"
(click)="picked.emit(myStyle)"></div>
<div *ngIf="show; else edit" class="tweak">
<input type="range" min="0" max="255" [(ngModel)]="r">
<span style="color: red">{{ r }}</span><br />
<input type="range" min="0" max="255" [(ngModel)]="g">
<span style="color: green">{{ g }}</span><br />
<input type="range" min="0" max="255" [(ngModel)]="b">
@t301000
t301000 / app.component.css
Last active June 4, 2017 03:00
20170531 作業實做參考
.main {
width: 100%;
height: 200px;
border: 1px solid gray;
margin-bottom: 20px;
}
(function(){
var a;
a = b = 3;
})();
/*
a => 為 function 的區域變數,IIFE 執行完回收,ReferenceError: a is not define
b => 未用 var 宣告,所以會在 window 添加 b 屬性,其值為 3,IIFE 執行完依然存在
*/