Skip to content

Instantly share code, notes, and snippets.

@s-macke
s-macke / hello.c
Last active August 28, 2023 06:30
Hello world example by using an headerless implementation of the WASI interface. The only dependency is clang
/*
* This code is a headerless implementation of the WASI interface in C and prints "Hello World!.
* You only need clang and the llvm linker.
*
* compile with
* clang -Os -nostdlib --target=wasm32 -Wl,--allow-undefined hello.c -o hello.wasm
*
* run with
* https://runno.dev/wasi
* Just upload hello.wasm
pragma solidity ^0.4.0;
import "SafeMath.sol";
import "IERC20Token.sol";
/**
* @dev Implements a capped token sale using a second-price auction.
*
* @author Nick Johnson <arachnid@notdot.net>
*
@raxoft
raxoft / cmwc.asm
Last active August 2, 2022 14:29
Fast quality CMWC random number generator for Z80 I have created to weed out the crap RNGs out there. 32+10 bytes, 146..149 T cycles, period 253*2^59, which is more than 2^66 or 10^20.
; 8-bit Complementary-Multiply-With-Carry (CMWC) random number generator.
; Created by Patrik Rak in 2012, and revised in 2014/2015,
; with optimization contribution from Einar Saukas and Alan Albrecht.
; See http://www.worldofspectrum.org/forums/showthread.php?t=39632
org 40000
call rnd ; BASIC driver
ld c,a
ld b,0