Skip to content

Instantly share code, notes, and snippets.

View TheWaWaR's full-sized avatar
🌀
Focusing

LingFeng TheWaWaR

🌀
Focusing
View GitHub Profile
@profelis
profelis / Makefile
Last active July 14, 2023 07:06
how to build hashlink on MacBook with M1/arm cpu
LBITS := $(shell getconf LONG_BIT)
MARCH ?= $(LBITS)
PREFIX ?= /usr/local
INSTALL_DIR ?= $(PREFIX)
INSTALL_BIN_DIR ?= $(PREFIX)/bin
INSTALL_LIB_DIR ?= $(PREFIX)/lib
INSTALL_INCLUDE_DIR ?= $(PREFIX)/include
LIBS=fmt sdl ssl openal ui uv mysql

聊聊 Cardano 的八卦

今年(2021)9/12 这一天 Cardano 迎来了一次对于 Cardano 来说史上最大的更新 Alonzo,支持智能合约并推出 Plutus 等一些列用于在 Cardano 上开发智能合约的工具,当然了,在此之前,Alonzo Testnet 早已经于 5/21 上线进行测试。作为市值前十的链之一,如此重大的利好怎能不吸引来一群认为是发现了财富密码的开发者呢,因此 Cardano 社区并不缺少先锋

背景

编程模型

大部分程序员更熟悉的都是类 Ethereum account model 这样的编程模型,而 Cardano 采用的是一种受 UTXO 启发的 EUTXO(Extended Unspend Output Transaction) ,虽然大抵都知道 BTC 的 UTXO 概念,但估计没有多少人想象过 general UTXO 的模型是怎样的。

@TheSpydog
TheSpydog / fna-wasm-instructions.md
Last active May 3, 2024 12:57
How to build your FNA game for WebAssembly

How to build your FNA game for WebAssembly

WARNING: This process is EXTREMELY experimental and not officially supported yet!

Thanks to the ongoing work on .NET WebAssembly support, it is now possible to build FNA games for the web!

If you decide to give this a try, be sure to tell us about it in the FNA Discord! I'm happy to help if you run into problems or have any further questions that are not answered here.

The Basics

@ityonemo
ityonemo / test.md
Last active May 5, 2024 15:42
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@kprotty
kprotty / ThreadPool.zig
Last active March 20, 2024 16:12
simple http server compatible with wrk for linux using epoll
const std = @import("std");
const system = switch (std.builtin.os.tag) {
.linux => std.os.linux,
else => std.os.system,
};
const ThreadPool = @This();
max_threads: u16,
counter: u32 = 0,
@HenningTimm
HenningTimm / rust_mem_profiling.md
Last active May 4, 2024 03:48
Memory profiling Rust code with heaptrack in 2019
@josephg
josephg / README.md
Last active March 7, 2024 06:58
Getting Zig compiling to WASM

In case anyone else wants to play with Zig on webassembly, here's what you need to do to make it work on a mac today.

1. Get LLVM 7 compiled with webassembly support.

You'll need LLVM to output to the WASM target. This has just been added by default in trunk, so if LLVM >7 is available, you might be able to just brew install llvm.

If you have wasm support already you should see:

$ llc --version
@sipa
sipa / golomb_loss.md
Last active July 30, 2023 18:25
Minimizing the redundancy in Golomb Codes Sets
@KodrAus
KodrAus / Profile Rust on Linux.md
Last active November 14, 2023 17:19
Profiling Rust Applications

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.