Skip to content

Instantly share code, notes, and snippets.

View peterhellberg's full-sized avatar
💙
Coding Go

Peter Hellberg peterhellberg

💙
Coding Go
View GitHub Profile
@peterhellberg
peterhellberg / .gitignore
Last active October 3, 2024 14:37
Variant of the Olive.c example flag_jp.c 🇯🇵 in Zig ⚡, this time generating the Swedish flag 🇸🇪
zig-out
.zig-cache
@peterhellberg
peterhellberg / zigout.diff
Created October 2, 2024 17:53
Diff of changes to have https://github.com/tsoding/zigout build with a current version of Zig ⚡
diff --git a/.gitignore b/.gitignore
index 4a0641e..3389c86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-zig-cache/
-zig-out/
\ No newline at end of file
+.zig-cache/
+zig-out/
@peterhellberg
peterhellberg / gtksourceview-4.md
Last active October 1, 2024 13:06
Making GtkSourceView based apps looks slightly better under Pop!_OS

pop-dark.xml

Screenshot from 2024-10-01 13-54-01

<?xml version="1.0" encoding="UTF-8"?>
<style-scheme id="pop-dark" name="Pop! - Dark" version="1.0">
  <author>Peter Hellberg</author>
  <_description>Pop! based on Coldark color scheme.</_description>
@peterhellberg
peterhellberg / Makefile
Last active October 1, 2024 13:13
AI Snake implementation based on https://www.youtube.com/watch?v=_UR3bi5xyaY
CC=zig cc
CFLAGS = -Wall -Wextra -Werror
INCLUDES = -I/usr/include/SDL2/
LIBS = -lSDL2
SRCS = aisnake.c
OBJS = $(SRCS:.c=.o)
MAIN = aisnake
$(MAIN): $(OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LIBS)
@peterhellberg
peterhellberg / w4on2-under-Linux.md
Last active September 26, 2024 18:42
w4on2 under Linux

w4on2 under Linux

git clone [email protected]:JerwuQu/w4on2.git
cd w4on2
cargo build --release

Note

There has been some minor changes in Zig ⚡,

@peterhellberg
peterhellberg / Jellybeans.ron
Last active September 24, 2024 15:59
Jellybeans theme for COSMIC terminal emulator
(
name: "Jellybeans",
foreground: "#E6E6CD",
background: "#141414",
cursor: "#FFB371",
bright_foreground: "#E6E6CD",
dim_foreground: "#E6E6CD",
normal: (
black: "#353534",
red: "#D35737",
@peterhellberg
peterhellberg / README.md
Last active September 20, 2024 11:51
razer-blade-14-2022-wifi

Razer Blade 14 (2022) WiFi

Razer Blade 14 (2022)

Problem

Running Linux on this machine isn't painless, specifically the wireless interface isn't being brought up by default.

Instructions

@peterhellberg
peterhellberg / go.mod
Created September 19, 2024 13:44
Example of github.com/tursodatabase/libsql-client-go/libsql usage
module experiments/libsql/libsql-example
go 1.23.0
require (
github.com/tursodatabase/libsql-client-go v0.0.0-20240902231107-85af5b9d094d
modernc.org/sqlite v1.33.1
)
require (
@peterhellberg
peterhellberg / build.zig
Last active September 16, 2024 08:02
HTTP GET request using Zig ⚡ 0.14.0-dev.1210+54e48f7b7
const std = @import("std");
pub fn build(b: *std.Build) void {
const exe = b.addExecutable(.{
.name = "whatthecommit",
.root_source_file = b.path("whatthecommit.zig"),
.target = b.standardTargetOptions(.{}),
.optimize = b.standardOptimizeOption(.{}),
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.