Skip to content

Instantly share code, notes, and snippets.

View kgao's full-sized avatar

Kevin Gao kgao

View GitHub Profile
@kgao
kgao / .block
Last active February 16, 2017 21:47
Test circle piano demo
license: gpl-3.0
height: 960
border: no
@kgao
kgao / .block
Last active September 27, 2017 19:05
Forced-directed Tree
border: no
height: 640
license: gpl-3.0
@kgao
kgao / timing.js
Last active March 3, 2017 20:16
Pure browser JS for calculating certain resource performance from client.
function calculate_load_times() {
// select running mode: log on/off
var log = true;
// input url pattern to detect
var url_pattern = "http://ds.microsoft.com/api/";
// Check performance support - TODO: crossbrowser test
if (performance === undefined) {
if(log) console.log("= Calculate Load Times: performance NOT supported");
return;
@kgao
kgao / gist:39dcf5d0f9adbd68b829c059b57d08ba
Created September 27, 2017 19:01
Crowd Sourcing Platform
https://github.com/gsbDBI/news_crowdsourcer
@kgao
kgao / macOS
Last active April 25, 2020 03:57
mac dev tips
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
///: A MapKit based Playground
import PlaygroundSupport
import UIKit
class ReverseGeocodingViewController: UIViewController {
// MARK: - Properties
@kgao
kgao / basic-auth
Created May 14, 2020 19:21
Basic Auth
var express = require('express'),
router = express.Router(),
basicAuth = require('basic-auth');
router.use(function (req, res, next) {
console.log(req.method + req.url);
next();
});
var auth = function (req, res, next) {