Skip to content

Instantly share code, notes, and snippets.

View regou's full-sized avatar

Dogeek regou

View GitHub Profile
@regou
regou / gl_utils.js
Last active September 6, 2020 02:46
Test WebGL in jest
const THREE = global.THREE = require('three');
const headlessGl = require("gl");
const pngStream = require('three-png-stream');
const fs = require('fs');
const path = require('path');
const looksSame = require('looks-same');
const width = 400;
const height = 300;
@regou
regou / browserify.sh
Created June 6, 2014 04:57
Browserify Bash Script
#!/bin/sh
#npm install watchify -g
shellpath=`dirname $0`
watchify $shellpath"/local-modules/main.js" -d -o $shellpath"/bundle.js" -v
@regou
regou / module define
Last active August 29, 2015 13:57
通用模块写法
(function(window, module, define) {
'use strict';
var context=function(require){
//edit here
return moduleOnto;
@regou
regou / Custom event
Last active February 17, 2017 14:05
Custom event polyfill
var Event={
// Trigger a new event
trigger: function(eventType, data, bubbles, cancelable) {
var event = new CustomEvent(eventType, {
detail: data,
bubbles: !!bubbles,
cancelable: !!cancelable
});
// Make sure to trigger the event on the given target, or dispatch it from