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).
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; |
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; | |
} |
NOTE: this gist is outdated, refer to this repository instead - https://github.com/ghaiklor/iterm-fish-fisher-osx
'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 |
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 |
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 |
/** | |
* Size of one chunk when requesting with Range | |
* @type {Number} | |
* @private | |
*/ | |
const CHUNK_SIZE = 204800; | |
/** | |
* Concat two ArrayBuffers | |
* @param {ArrayBuffer} ab1 |
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, |