Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / O2minipop.ino
Created March 17, 2016 21:24
// O2 Minipops rhythm box (c) DSP Synthesizers 2016
// Free for non commercial use
// http://janostman.wordpress.com
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
@axic
axic / README.md
Last active December 15, 2021 03:14
ewasm “WRC20” token contract coding challenge

ewasm “WRC20” token contract coding challenge

This document describes a simple contract in pseudocode and gives a couple of test cases for it.

The challenge is designed to be fairly easy to implement in a language of choice, compiled to wasm and interacted with. It is loosely based on the ERC20 token standard, named "WRC20", where the W stands for WebAssembly.

External interface

The contract has two features:

@tjmehta
tjmehta / dataview-polyfill.js
Created April 5, 2016 00:05
DataView (and ArrayBuffer) polyfill that works in any engine (including old IE).
void function(global){
if ('DataView' in global && 'ArrayBuffer' in global) {
return;
}
var hide = (function(){
// check if we're in ES5
if (typeof Object.getOwnPropertyNames === 'function' && !('prototype' in Object.getOwnPropertyNames)) {
var hidden = { enumerable: false };
Script::Script() {
}
Script::~Script() {
}
void Script::Initialize(char* src) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
@frekele
frekele / Jenkinsfile
Created August 4, 2016 06:18
Jenkinsfile pipelineTriggers - TimerTrigger periodic run the aws-update-my-dynamic-ip.sh script.
#!groovy
MAIL_FROM = 'noreply-jenkins@myhost.io'
MAIL_TO = 'jenkins@myhost.io'
GITHUB_PROTOCOL = 'https'
GITHUB_USER_NAME = 'my-github-user'
GITHUB_USER_EMAIL = 'jenkins@myhost.io'
GITHUB_REPO = 'github.com/my-user/my-repository'
GITHUB_PROJECT_URL = "${GITHUB_PROTOCOL}://${GITHUB_REPO}"
@calebsander
calebsander / base64.wast
Created July 17, 2018 23:16
base-64 encode and decode in WASM
(module
;; Memory layout
;; 0 - 63: lookup
;; 64 - 186: revLookup
;; 187 - : input, followed by output
(global $INPUT (export "INPUT") i32 (i32.const 187))
(memory (export "memory") 1)
(data (i32.const 0) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
(func (export "init")
(local $i i32)
(module
(global $gasUsed (mut i64) (i64.const 0))
(func $useGas (param $gas i64)
get_global $gasUsed
get_local $gas
i64.add
set_global $gasUsed
)
(global $cb_dest (mut i32) (i32.const 0))