Skip to content

Instantly share code, notes, and snippets.

🤖
*bleep*

Sergey Rubanov chicoxyzzy

🤖
*bleep*
View GitHub Profile
View WebAssembly_Moscow_links.md
@chicoxyzzy
chicoxyzzy / nvm-node-nightlies.md
Last active Mar 28, 2020
Installing Node Nightlies via nvm
View nvm-node-nightlies.md

You can install Node Nightlies/RCs via nvm using NVM_NODEJS_ORG_MIRROR environment variable.

Install latest Node RC

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc/ nvm i node

Install latest Node.js Nightly

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm i node
@chicoxyzzy
chicoxyzzy / results
Created Jan 19, 2017
Benchmarking for loops
View results
Now using node v4.7.2 (npm v2.15.11)
// v8 4.5.103.43 (Node.js 4.7.2)
forVar_______: 2ms
forLet_______: 13ms
forOfVar_____: 66ms
forOfLetConst: 64ms
forEachVar___: 15ms
forEachLet___: 21ms
View hello.wast
This file has been truncated, but you can view the full file.
(module
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$ji (func (param i32) (result i64)))
(type $FUNCSIG$viii (func (param i32 i32 i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
View hello.rs
fn main() {
println!("Hello, Emscripten!");
}
View hello.js
/*
* Copyright 2015 WebAssembly Community Group participants
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View hello.asm.js
Module["asm"] = (function(global, env, buffer) {
'almost asm';
var HEAP8 = new global.Int8Array(buffer);
var HEAP16 = new global.Int16Array(buffer);
var HEAP32 = new global.Int32Array(buffer);
var HEAPU8 = new global.Uint8Array(buffer);
var HEAPU16 = new global.Uint16Array(buffer);
var HEAPU32 = new global.Uint32Array(buffer);
@chicoxyzzy
chicoxyzzy / noncoercible.js
Last active Jul 30, 2020
Non-coercible objects
View noncoercible.js
function nonCoercible(val) {
if (val == null) {
throw TypeError('nonCoercible shouldn\'t be called with null or undefined');
}
const res = Object(val);
res[Symbol.toPrimitive] = () => {
throw TypeError('Trying to coerce non-coercible object');
}
return res;
};
View install.md

Setup new Mac from scratch

Install latest Xcode

The download/install takes a while so start it first. When it finishes downloading you will still need to run it to complete installation.

iTerm2

Really the nicest choice for a terminal on OSX right now.

Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
You can’t perform that action at this time.