Skip to content

Instantly share code, notes, and snippets.

@dabeaz
dabeaz / README.txt
Created October 15, 2019 20:10
PyCon India 2019, Code from Keynote Presentation by @dabeaz
Code from PyCon India 2019 Keynote Talk
David Beazley (https://www.dabeaz.com)
======================================
This code is presented "as is" and represents what was live-coded
during my closing keynote presentation at PyCon India, Chennai,
October 13, 2009. I have made no changes to the files.
Requires: Python 3.6+, numpy, pygame
@cellularmitosis
cellularmitosis / README.md
Last active April 26, 2026 12:36
QEMU PowerPC G4 OS X Tiger (10.4) setup

Blog 2020/5/7

<- previous | index | next ->

QEMU PowerPC G4 OS X Tiger (10.4) setup

EDIT 2024/12/1: I updated a few of these commands to work with qemu 9.x.

@brettcannon
brettcannon / config.site
Last active February 2, 2022 22:49
WASI-SDK w/ CPython
cross_compiling=yes
ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no
@peterargue
peterargue / find_events.sh
Created July 5, 2022 18:29
Search for events from start height to latest using flow-cli
#!/bin/bash
EVENT=flow.AccountContractAdded
START=32795233
END=$(flow blocks get latest -n mainnet -o json | jq '.height')
echo "Start: ${START}"
echo "End: ${END}"
echo "Event: ${EVENT}"
for (( i=${START}; i<=${END}; i += 251 )); do
@Heath123
Heath123 / tutorial.md
Last active February 9, 2025 21:45
w2c2 + AssemblyScript tutorial

w2c2 + AssemblyScript tutorial

This tutorial shows you how to make a simple Hello World work with AssemblyScript and w2c2. For this example we will create a simple print function in C and pass it through to AssemblyScript, and try to explain the concepts behind how it works.

Step 1 - Write and compile the AssemblyScript file

Create a file called hello.ts with the following content:

print("Hello, world!")

Now if you try to compile it with asc -o hello.wasm hello.ts, you will get this error:

ERROR TS2304: Cannot find name 'print'.
protocol NullaryFunction {
associatedtype Result
func callAsFunction() -> Result
}
protocol ExpressionResult {
associatedtype Expression: NullaryFunction where Expression.Result == Self;
}
typealias Expr<T: ExpressionResult> = T.Expression