Skip to content

Instantly share code, notes, and snippets.

<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
@bluehaoran
bluehaoran / machine.js
Last active May 13, 2021 02:38
Generated by XState Viz: https://xstate.js.org/viz
const drawingStateMachineDef = Machine({
id: 'appDrawing',
initial: 'inactive',
states: {
inactive: {
on: {
START_DRAW: 'drawing',
SELECT_ANNOTATION: 'showingSavedAnnotationCard',
}
},
@bluehaoran
bluehaoran / machine.js
Last active March 29, 2021 04:11
Generated by XState Viz: https://xstate.js.org/viz
const drawingStates = {
id: 'appDrawingModes',
initial: 'preDrawing',
states: {
preDrawing: {
on: {
LEFT_CLICK_CANVAS: 'drawingPoint',
}
},
drawingPoint: {
@bluehaoran
bluehaoran / machine.js
Last active March 26, 2021 00:28
Generated by XState Viz: https://xstate.js.org/viz
const drawingStates = {
id: 'appDrawingModes',
initial: 'preDrawing',
states: {
preDrawing: {
on: {
CANCEL: 'cancelDrawing',
LEFT_CLICK_CANVAS: 'drawingPoint',
}
@bluehaoran
bluehaoran / machine.js
Created March 25, 2021 09:49
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@bluehaoran
bluehaoran / goto-sublime
Created August 21, 2018 04:44 — forked from kendellfab/goto-sublime
Add mouse click `goto definition` in sublime text 3.
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
<?php
// Another file for handling lots of Json. There might be a better separator than '.'.
// Convert:
// ['x' => 'y',
// 'z' => ['a',
// 'b',
// 'c'=>'c']]
// into
// ['x' => 'y',
// 'z.0' => 'a',
@bluehaoran
bluehaoran / AbstractThing.php
Last active May 20, 2016 02:22
Allows automatic creation of child objects, as per Javascript.
<?php
/**
* Usage:
* $something = new GenericThing();
* $something->somethingsChild->size = 20;
* json_encode($something);
*
* No errors! No warnings! Json neatly created!
*/
@bluehaoran
bluehaoran / anf-schema.json
Last active February 11, 2017 18:42
Describes the Apple Native Format (ANF) schema for Apple News. (WIP)
{
"$schema" : "http://json-schema.org/schema#",
"id" : "https://gist.github.com/bluehaoran/283aecb77e1cb30cd835#file-anf-schema-json",
"title" : "ANF article.json Schema",
"description" : "Captures the ANF format described here: https://developer.apple.com/library/ios/documentation/General/Conceptual/Apple_News_Format_Ref/index.html",
"type" : "object",
"properties" : {
"version" : {"type": "string"},
"identifier" : {"type": "string"},
"title" : {"type": "string"},