Skip to content

Instantly share code, notes, and snippets.

View Becavalier's full-sized avatar
🤏
Breaking through every day ...

Jason Yu Becavalier

🤏
Breaking through every day ...
View GitHub Profile
@binji
binji / add.wat
Last active September 21, 2017 18:39
Simple WebAssembly Example
;; Convert this to add.wasm by running:
;;
;; wat2wasm add.wat -o add.wasm
;;
(module
(func (export "add") (param i32 i32) (result i32)
get_local 0
get_local 1
i32.add))
@binji
binji / Bulk.md
Last active May 18, 2018 20:38
Bulk Memory Operations

Bulk Memory Operations

Motivation

Some people have mentioned that memcpy and memmove functions are hot when profiling some WebAssembly benchmarks. Some examples:

I've been looking at perf profiles for wasm unity benchmark a bit recently and see that some

@kripken
kripken / hello_world.c
Last active January 17, 2024 12:15
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}
@Saul-Mirone
Saul-Mirone / MVVM.js
Last active May 6, 2024 05:27
A simple mvvm
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 August 1, 2016 13:29 — forked from mshwery/app.js
Gulp + Browserify + requiring .html templates + Knockout web components
var ko = require('knockout');
ko.components.register('simple-name', require('./components/simple-name/simple-name.js'));
ko.applyBindings({ userName: ko.observable() });
anonymous
anonymous / stripe_oauth_deauthorize.php
Created January 29, 2016 10:13
[Stripe] PHP sample to disconnect an account from a platform
<?php
$apiKey = 'sk_test_...'; // your platform's secret API key
$clientId = 'ca_...'; // your platform's client_id
$accountId = 'acct_...'; // the ID of the account to deauthorize
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,

Writing template strings in Markdown

With template strings coming to ES6, the backtick (`) means something in Markdown and in JavaScript. If you write this:

To display a message, write `alert(`hello world!`)`.

it'll render like this:

To display a message, write alert(hello world!).

@kevincennis
kevincennis / v8.md
Last active May 6, 2024 05:25
V8 Installation and d8 shell usage

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
    • $ nano ~/.zshrc
    • Add path=('/path/to/depot_tools' $path)