Skip to content

Instantly share code, notes, and snippets.

View Luukdegram's full-sized avatar

Luuk de Gram Luukdegram

  • The Netherlands
  • 08:27 (UTC +02:00)
View GitHub Profile
@Luukdegram
Luukdegram / main.zig
Created January 30, 2021 10:59
Example server
const std = @import("std");
const net = std.net;
pub const io_mode = .evented;
pub fn main() anyerror!void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const alloc = &gpa.allocator;
@Luukdegram
Luukdegram / async.zig
Created August 3, 2020 18:38
Creates a tcp server that clients can connect and write to. Client's messages appear in stderr.
const std = @import("std");
const network = @import("network.zig");
pub const io_mode = .evented;
pub fn main() anyerror!void {
const allocator = std.heap.page_allocator;
try network.init();
defer network.deinit();
@Luukdegram
Luukdegram / finder.sh
Created March 22, 2016 09:27
Finds a pattern within files from given directory
grep -rnw '/path/to/somewhere/' -e "pattern"
@Luukdegram
Luukdegram / static-unpackker.sh
Created March 22, 2016 09:18
Shell script to unpack all static libraries within current directory
for i in *.a; do
$(ar -x $i)
done