Skip to content

Instantly share code, notes, and snippets.

View emctoo's full-sized avatar

xg emctoo

View GitHub Profile
@paulosuzart
paulosuzart / main.zig
Last active September 26, 2025 04:12
Simple fetching starred items from github
//! A simple test that creates a http client, fetches the first page of starred items for a given user
//! and prints each repo with their topics, as well as each language and the amount of repos for that language.
//! Sample output:
//! Repo name is gluesql/gluesql ({ database, nosql, rust, schemaless, sql, storage, webassembly, websql })
//! Repo name is efugier/smartcat ({ ai, chatgpt, cli, command-line, command-line-tool, copilot, llm, mistral-ai, unix })
//! Repo name is regolith-labs/steel ({ solana })
//! Language Rust: 13 repos
//! Language Zig: 2 repos
//! Language Jupyter Notebook: 1 repos
//! Language HTML: 1 repos
@kprotty
kprotty / faa_vs_cas.zig
Last active November 30, 2025 17:17
Updated to Zig 0.13 (+ fix stdev compute)
const std = @import("std");
const builtin = @import("builtin");
pub fn main() !void {
try bench(struct {
pub const name = "FAA";
pub fn inc(counter: *std.atomic.Value(usize), current: usize, rng: *u32) usize {
_ = rng;
_ = current;
@sorki
sorki / libvirt.nix
Created May 11, 2022 13:13
libvirt with statically configured bridge
# Module for configuring libvirt with static NixOS networking
# instead of using libvirt managed bridge.
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.virtualisation.libvirtd.networking;
v6Enabled = cfg.ipv6.network != null;
v6PLen = toInt (elemAt (splitString "/" cfg.ipv6.network) 1);
@kassane
kassane / std_log.md
Last active January 18, 2026 14:59 — forked from leecannon/std_log.md
Quick overview of Zig's `std.log`

A simple overview of Zig's std.log for Zig v0.12.0 or higher

Logging functionality that supports:

  • If a log message should be printed is determined at comptime, meaning zero overhead for unprinted messages (so just leave the code peppered with debug logs, but when it makes sense scope them; so downstream users can filter them out)
  • Scoped log messages
  • Different log levels per scope
  • Overrideable log output (write to file, database, etc.)
  • All the standard std.fmt formatting magic

Basic Usage:

@pdalpra
pdalpra / starship.nix
Created February 23, 2022 16:48
fun with configuring starship in Nix home-manager
{ pkgs, lib, ... }:
with lib;
with builtins;
let
isRustFile = path: type:
hasSuffix ".rs" path && type == "regular" && path != "mod.rs";
mergeAllAttrSets = attrsSets:
foldl' (recursiveUpdate) {} attrsSets;
# Install these packages (use your favorite AUR tool here)
yay -S minikube kubectl docker-machine-driver-kvm2 libvirt qemu-headless ebtables
# Get libvirt going
sudo systemctl enable libvirtd.service
sudo usermod -a -G libvirt $(whoami)
# This fix thanks to http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/
sudo virsh net-autostart default
@mtds
mtds / lvn.md
Last active December 26, 2025 00:29
Linux Virtual Networking

Virtual Networking on Linux

In the Linux Kernel, support for networking hardware and the methods to interact with these devices is standardized by the socket API:

                +----------------+
                |   Socket API   |
                +-------+--------+
                        |
User space              |
@TeknoVenus
TeknoVenus / Useful Programs.md
Last active December 17, 2024 16:17
Useful programs

My useful utilities and favourite programs to make everyday life that bit easier

Most of these are Windows based, but some are cross-platform. They are mainly free tools, but paid ones have been marked accordingly. Freemium tools have a free version but have a full version for a price. Tools are in no particular order

Utilities

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active February 3, 2026 16:07
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@chrismccord
chrismccord / upgrade.md
Last active September 5, 2025 05:27
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs: