This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NativeModule.prototype.compile = function() { | |
var source = NativeModule.getSource(this.id); | |
source = NativeModule.wrap(source); | |
this.loading = true; | |
try { | |
const fn = runInThisContext(source, { | |
filename: this.filename, | |
lineOffset: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Size of one chunk when requesting with Range | |
* @type {Number} | |
* @private | |
*/ | |
const CHUNK_SIZE = 204800; | |
/** | |
* Concat two ArrayBuffers | |
* @param {ArrayBuffer} ab1 |
- Let’s Build A Simple Interpreter
- Let's Build a Compiler, by Jack Crenshaw
- Project: A Programming Language
- Understanding Compiler Optimization - Chandler Carruth - Opening Keynote Meeting C++ 2015
- Adventures in JIT compilation
- Juozas Kaziukėnas - Building An Interpreter In RPython - PyCon 2016
- Anders Hejlsberg on Modern Compiler Construction
- Build Your Own Lisp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Statistical profiling result from isolate-0x101804a00-v8.log, (107 ticks, 1 unaccounted, 0 excluded). | |
[Shared libraries]: | |
ticks total nonlib name | |
53 49.5% /usr/local/bin/node | |
47 43.9% /usr/lib/system/libsystem_kernel.dylib | |
2 1.9% /usr/lib/system/libsystem_malloc.dylib | |
1 0.9% /usr/lib/system/libsystem_platform.dylib | |
1 0.9% /usr/lib/system/libsystem_c.dylib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Statistical profiling result from isolate-0x101804a00-v8.log, (7436 ticks, 1 unaccounted, 0 excluded). | |
[Shared libraries]: | |
ticks total nonlib name | |
7431 99.9% /usr/local/bin/node | |
2 0.0% /usr/lib/system/libsystem_malloc.dylib | |
1 0.0% /usr/lib/system/libsystem_platform.dylib | |
[JavaScript]: | |
ticks total nonlib name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// The purpose of this example is to show | |
// how you can block the event loop with JavaScript. | |
// There is 3 routes | |
// / respond with Hello, World text | |
// /block uses JavaScript while for 5 seconds | |
// /non-block uses setTimeout for 5 seconds | |
// Do the following |
NOTE: this gist is outdated, refer to this repository instead - https://github.com/ghaiklor/iterm-fish-fisher-osx
- Download and install iTerm2 (it has better color fidelity than the built in Terminal).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ROW = 3010; | |
const COLUMN = 3019; | |
const FIRST_CODE = 20151125; | |
const TARGET_INDEX = ((Math.pow(ROW + COLUMN - 1, 2) + ROW + COLUMN - 1) / 2) - ((ROW + COLUMN - 1) - COLUMN); | |
let result = FIRST_CODE; | |
for (var i = 1; i < TARGET_INDEX; i++) { | |
result = (result * 252533) % 33554393; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Combinatorics = require('./combinatorics'); | |
const fs = require('fs'); | |
const INPUT = fs.readFileSync('./input.txt', 'utf-8').split('\n').map(Number); | |
const TOTAL_SUM = INPUT.reduce((total, x) => total + x, 0); | |
const GROUP_WEIGHT = TOTAL_SUM / 4; | |
const VALID_PACKAGES = []; | |
for (var i = 1; VALID_PACKAGES.length === 0; i++) { | |
var combination = Combinatorics.combination(INPUT, ++i); | |
var cmb; |