Skip to content

Instantly share code, notes, and snippets.

View daybrush's full-sized avatar
😀
HAHAHAHAHAHA

Daybrush (Younkue Choi) daybrush

😀
HAHAHAHAHAHA
View GitHub Profile
!function(t,e){"object"==typeof exports&&"object"==typeof module?
module.exports=e():"function"==typeof define&&define.amd?define("Scene",[],e):"object"==typeof exports?
exports.Scene=e():t.Scene=e()}(window,function(){
return function(t){
var e={};function r(i){
if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}
return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.r=
function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?
function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){
return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";r.r(e);var i={};
@daybrush
daybrush / rollup_bundle.js
Created October 4, 2018 10:58
rollup_bundle
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():
"function"==typeof define&&define.amd?define(e):t.Scene=e()}(this,function(){
@daybrush
daybrush / ast.js
Last active October 7, 2018 09:12
babel/parser
import {parse} from "@babel/parser";
const code = `function a(b) {
const c = 1;
}`;
const ast = parse(code, {
sourceType: "module"
});
@daybrush
daybrush / prototypeminify.js
Last active October 7, 2018 13:07
prototypeminify.js
var Item = /*#__PURE__*/ function () {
function Item() {}
var __proto = Item.prototype;
__proto.a = function () {}
__proto.b = function () {}
__proto.c = function () {}
return Item;
}();
@daybrush
daybrush / class.js
Last active October 7, 2018 13:08
class transpile
Class Item {
a() {}
b() {}
c() {}
}
// tsc transpile
var Item = /*#__PURE__*/ function () {
function Item() {}
Item.prototype.a = function () {}
@daybrush
daybrush / traverse.js
Last active October 7, 2018 13:20
traverse
import traverse from "@babel/traverse";
traverse(ast, {
FunctionDeclaration: function (path) {
// path.node (FunctionDeclaration)
// path.node.id (Identifier)
console.log(path.node.id.name);
},
});
import t from "@babel/types";
left.object = t.identifier("__proto");
import traverse from "@babel/traverse";
import t from "@babel/types";
traverse(ast, {
FunctionDeclaration: function (path) {
// path.node(FunctionDeclaration)
path.insertAfter(t.variableDeclaration("var", [
t.variableDeclarator(
t.identifier("__proto"),
t.memberExpression(t.identifier("Item"), t.identifier("prototype"))
var Scene_extends = (undefined && undefined.__extends) || (function () {
// Duplicate code
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
@daybrush
daybrush / rollup.js
Created October 18, 2018 09:52
use rollup to merge modules.
var TRANSFORM = "trasnform";
var ANIMATION = "animation";
var DIRECTION_LEFT = 1;
var ALTERNATE_REVERSE = "alternate-reverse";
TRASNFORM;
ANIMATION;
DIRECTION_LEFT;
ALTERNATE_REVERSE;