Skip to content

Instantly share code, notes, and snippets.

View pixelpicosean's full-sized avatar
🏠

Sean Bohan pixelpicosean

🏠
View GitHub Profile
@andrewrk
andrewrk / build.zig
Created February 20, 2023 16:20
sprinkling a little zig into a C project to help with debugging
const std = @import("std");
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
// Standard optimization options allow the person running `zig build` to select
@lobre
lobre / zig_type_system.md
Last active June 16, 2025 21:56
Zig type system illustrated using ascii diagrams

Zig Type System

Zig aims to be a simple language. It is not easy to define what simple exactly means, but zig is also a low-level programming language that aims for c-compatibility. To reach this goal, it needs good semantics in its type system so that developers have a complete toolbox to manipulate data.

So types in zig are composable, but this can become rapidly overwhelming. See those examples. Are you able to understand them at a glance, as soon as you read them?

*const ?u8
?*const u8
*const [2]u8
@rasmusmerzin
rasmusmerzin / build.zig
Last active May 4, 2023 07:34
ABI Zig 🔗 Typescript
// see https://gitlab.com/merzin/mono/-/tree/mono/abi
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
const mode = b.standardReleaseOptions();
const lib = b.addSharedLibrary("index", "index.zig", b.version(0, 0, 0));
lib.setBuildMode(mode);
lib.setTarget(.{ .cpu_arch = .wasm32, .os_tag = .freestanding });
lib.setOutputDir("zig-out");
@GuillaumeDua
GuillaumeDua / Concept-based polymorphism in modern Cpp.md
Last active July 4, 2025 08:43
Concept-based polymorphism in modern C++

Concept-based polymorphism in modern C++

Date 05-05-2021 - 10-17-2023
Revision R3
Author Guillaume Dua
Reviewers Loïc Joly, Antoine Morrier
@ConorJOHanlon
ConorJOHanlon / RPi_I2C_driver.py
Created April 10, 2021 15:47 — forked from DenisFromHR/RPi_I2C_driver.py
RaspberryPi I2C LCD Python stuff
# -*- coding: utf-8 -*-
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
@doctor-g
doctor-g / godot-ci.yml
Last active August 25, 2022 15:57
GitHub workflow specification for publishing Godot Engine HTML5 projects to GitHub Pages
# Workflow to publish Godot HTML5 games to GitHub Pages
#
# Make sure your project is configured for Web export
# to the path `build/web`.
name: 'Publish to GitHub Pages'
env:
GODOT_VERSION: 3.2.2 # Remember to manually set image to this version below.
shader_type canvas_item;
uniform sampler2D spritesheet; // Should be a slice image as exported from Magica Voxel
uniform int slice_count = 1; // The number of slices
uniform vec2 camera_vec = vec2( 1., 1. ); // Recomend using (1,1) or (1,1.5)
uniform float camera_ang = 0.0; // change this to change the view angle of the object
const vec2 center = vec2( 0.5 );
bool scale_and_rotate_with_offset( inout vec2 uv, vec2 sxy, float ang, vec2 cent, vec2 offset )
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active July 10, 2025 09:05
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@Wizermil
Wizermil / build_harfbuzz_freetype2_emscripten.sh
Last active February 23, 2024 03:27
Script to compile harfbuzz + freetype static library for emscripten
#!/bin/bash
FREETYPE_VERSION="2.10.0"
HARFBUZZ_VERSION="2.4.0"
ROOT_DIR=$(pwd)
WORKER=$(getconf _NPROCESSORS_ONLN)
BUILD_DIR_FREETYPE2="build/emscripten/freetype2"
BUILD_DIR_HARFBUZZ="build/emscripten/harfbuzz"
@beardicus
beardicus / .block
Last active March 19, 2024 21:44
Paper.js Vector Erase
license: mit
border: yes
height: 640