Skip to content

Instantly share code, notes, and snippets.

View lawrence-laz's full-sized avatar
👋
Hi there!

Laurynas Lazauskas lawrence-laz

👋
Hi there!
  • Lithuania, Vilnius
View GitHub Profile
@mlugg
mlugg / incremental.md
Last active March 23, 2025 01:19
Incremental compilation overview

Zig Compiler: Incremental Compilation

A few ground rules:

  • Values in the InternPool are immutable. The meaning of a given Index never changes.
  • The only kind of "exception" to this is that the namespace of types may change. The namespace index is constant, but the contents of that namespace can change while the type lives at the same Index.
  • Incremental compilation works at the level of single units of semantic analysis (AnalUnit). During semantic analysis, every AnalUnit registers "dependencies" on various things ("dependees"). On each incremental update, these dependencies are used to figure out what to re-analyze.
  • An incremental update may analyze more AnalUnits than are necessary, but it will never analyze the
@permutationlock
permutationlock / build.zig
Last active March 31, 2024 22:19
Run gdb on test step using build.zig
const std = @import("std");
const builtin = @import("builtin");
const Builder = std.build.Builder;
pub fn build(b: *Builder) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const main_tests = b.addTest(.{
.root_source_file = .{ .path = "main.zig" },
@xkr47
xkr47 / libera.irssi
Last active January 25, 2025 18:48
How to add the libera.chat network to irssi
Replace all <....> parts with your specific details
/network add -nick <nick> libera
/server add -network libera -auto -ssl irc.libera.chat 6697
/connect libera
/query NickServ
register <password> <email>
<copypaste line from email>
/network add -autosendcmd "" -sasl_username <user> -sasl_password <pass> -sasl_mechanism PLAIN libera
/channel add -auto <channel> libera
@kprotty
kprotty / ParkingLot.zig
Last active October 5, 2024 09:17
Small & Fast synchronization primitives for Zig
pub fn ParkingLot(comptime Config: type) type {
return struct {
pub const Lock: type = Config.Lock;
pub const Event: type = Config.Event;
pub const nanotime: fn() u64 = switch (@hasDecl(Config, "nanotime")) {
true => Config.nanotime,
@sebmarkbage
sebmarkbage / Infrastructure.js
Last active February 26, 2025 13:57
SynchronousAsync.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
}
if (pending.has(url)) {
throw pending.get(url);
}
@bzgeb
bzgeb / PlayerPrefsSerializer.cs
Created September 27, 2013 19:27
Player Prefs Serializer
/**
* @file PlayerPrefsSerializer.cs
* @brief Code snippet from UnityForum (http://forum.unity3d.com/threads/72156-C-Serialization-PlayerPrefs-mystery)
* @author mindlube+FizixMan
* @version 1.0
* @date 2012-06-15
*/
using UnityEngine;
using System;
@banaslee
banaslee / XGH - de-de.txt
Last active April 14, 2025 05:43
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Quelle: http://gohorseprocess.wordpress.com
Übersetzung ursprünglich von https://gist.github.com/Neffez/f8d907ba8289f14e23f3855011fa4e2f
1. Ich denke, also ist es nicht XGH.
In XGH wird nicht gedacht, es wird das erste gemacht, was in den Sinn kommt. Es gibt auch keine zweite Option, die erste ist schneller.
2. Es gibt 3 Wege ein Problem zu lösen: den richtigen Weg, den falschen Weg und den XGH Weg, welcher exakt wie der falsche ist, aber schneller.