Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Thinking on TWVM 🤔

Jason Yu Becavalier

💭
Thinking on TWVM 🤔
View GitHub Profile
@Becavalier
Becavalier / UglifyJS.TreeTransformer.js
Last active Apr 11, 2019
The basic usage of "UglifyJS.TreeTransformer".
View UglifyJS.TreeTransformer.js
const UglifyJS = require('uglify-js');
var symbolTable = {};
var binaryOperations = {
"+": (x, y) => x + y,
"-": (x, y) => x - y,
"*": (x, y) => x * y
}
var constexpr = new UglifyJS.TreeTransformer(null, function(node) {
if (node instanceof UglifyJS.AST_Binary) {
@Becavalier
Becavalier / v8.md
Created Nov 23, 2017 — forked from kevincennis/v8.md
V8 Installation and d8 shell usage
View v8.md

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • sudo nano ~/.bash_profile
    • Add export PATH=/path/to/depot_tools:"$PATH" (it's important that depot_tools comes first here)
@Becavalier
Becavalier / Parser.js
Created Feb 7, 2017 — forked from Saul-Mirone/MVVM.js
A simple mvvm
View Parser.js
class Register {
constructor() {
this.routes = []
}
regist(obj, k, fn) {
const _i = this.routes.find(function(el) {
if((el.key === k || el.key.toString() === k.toString())
&& Object.is(el.obj, obj)) {
return el
@Becavalier
Becavalier / app.js
Created Aug 1, 2016 — forked from mshwery/app.js
Gulp + Browserify + requiring .html templates + Knockout web components
View app.js
var ko = require('knockout');
ko.components.register('simple-name', require('./components/simple-name/simple-name.js'));
ko.applyBindings({ userName: ko.observable() });