Skip to content

Instantly share code, notes, and snippets.

@LiJohnson
LiJohnson / index.html
Created December 6, 2022 10:07
zYjQyLK
<canvas id="canvas" width=600 height=400></canvas>
<div id="pad">
<button data-x=0 data-y=-1>⬆️</button>
<button data-x=0 data-y=1>⬇️</button>
<button data-x=-1 data-y=0>⬅️</button>
<button data-x=1 data-y=0>➡️</button>
<button data-x=-1 data-y=-1>↖️</button>
<button data-x=1 data-y=-1>↗️</button>
<button data-x=-1 data-y=1>↙️</button>
@LiJohnson
LiJohnson / .gitconfig
Last active August 29, 2015 14:13
git cmd
[alias]
st = status -sb
co = checkout
br = branch
br-merged = branch --merged
br-no-merged = branch --no-merged
mg = merge
ci = commit
ds = diff --staged
dt = difftool
@LiJohnson
LiJohnson / 0_reuse_code.js
Created June 14, 2014 00:38
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
/**
* core code from http://threejs.org/examples/canvas_geometry_birds.html
* edit by lcs
* date 2013-07-11 16:45:02
*/
(function($){
if(!$)return;
var isSuportCanvas = function(){ var c = document.createElement("canvas") ; return !!(c.getContext && c.getContext("2d")); };
if( !isSuportCanvas() ){return;}