Notes and resources for WebAssembly in general.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import srfi-1 | |
(chicken format) | |
(chicken random) | |
(chicken string)) | |
(define-constant *NAULAS* 150) | |
(define-constant *NCLIENTES* 100) | |
(define-constant *NFUNCS* 10) | |
(define-constant *NINSTRS* 80) | |
(define-constant *NVENDAS* 40) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env run-cargo-script | |
use std::process::Command; | |
use std::thread::sleep; | |
use std::time::Duration; | |
fn main() { | |
let phonemes: Vec<&str> = vec!["[[&]]", "[[&/]]", "[[a]]", "[[&~]]", "[[&U~]]", "[[E]]", | |
"[[e]]", "[[y]]", "[[i]]", "[[i/]]", "[[O]]", "[[o]]", "[[u]]", | |
"[[U]]", "[[EU]]", "[[w]]", "[[x]]", "[[R]]", "[[s#]]"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# How to use: | |
# 1. `sh sizeof.sh` | |
# 2. ???? | |
# 3. PROFIT!!! | |
cat << EOF | cc -Wall -Wextra -pedantic -O3 -static -o sizeof -x c - && | |
#include <stdio.h> | |
#define issigned(type) ((type)(0-1)>0) | |
#define umaxof(t) (((0x1ULL<<((sizeof(t)*8ULL)-1ULL))-1ULL)|(0xFULL<<((sizeof(t)*8ULL)-4ULL))) | |
#define smaxof(t) (((0x1ULL<<((sizeof(t)*8ULL)-1ULL))-1ULL)|(0x7ULL<<((sizeof(t)*8ULL)-4ULL))) |
I hereby claim:
- I am siiky on github.
- I am siiky (https://keybase.io/siiky) on keybase.
- I have a public key ASAuLV0mwDoACs_isYrXr2g9_tygNmad1ejatjrQxguUZwo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(asm)] | |
#![feature(lang_items)] | |
#![crate_type = "staticlib"] | |
#![no_std] | |
const GPIO_BASE: u32 = 0x3F200000; // base address for Pi 2 and Pi 3 | |
fn sleep(value: u32){ | |
for _ in 1..value { | |
unsafe { asm!("");} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(non_ascii_idents)] | |
fn main() { | |
std::env::args().nth(1) | |
.ok_or(format!("Usage: {} FILE", std::env::args().next().unwrap())) // File name | |
.and_then(|filename| { | |
std::fs::File::open(&filename) | |
.map_err(|e| (&e as &std::error::Error).description().to_string()) | |
}).map(|f| (f, String::new())) | |
.map(|(mut f, mut s)| ((&mut f as &mut std::io::Read).read_to_string(&mut s), s)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(non_ascii_idents)] | |
use std::io::{Write, BufRead, BufReader}; | |
use std::process::exit; | |
use std::fs::File; | |
fn main() { | |
let args : Vec<_> = std::env::args().collect(); | |
if args.len() != 2 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Display the colors available in a terminal. | |
for color in range(0, 256): | |
for i in range(0, 1): | |
print("\033[38;5;%sm%03s\033[m" % (str(color), str(color)), end=' ') | |
if color % 10 == 0: | |
print() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################ | |
# palette: (almost) | |
# http://www.colourlovers.com/palette/1718713/Monokai | |
# | |
# converted to xterm256 code with: | |
# https://gist.github.com/MicahElliott/719710 | |
############################################################ | |
# LIGHT_CLAY 233 | |
# CLAY 232 | |
# PINK 197 |