Skip to content

Instantly share code, notes, and snippets.

View idoqo's full-sized avatar

Michael Okoko idoqo

View GitHub Profile

Rust Module System

The rust compiler makes little/no assumptions about the structure of your project. You’re required to construct your entire module tree yourself. To make our work easy, it provides us with some building blocks for this construction

The rust module systems works similar to modern filesystems. There’s a parent & some children. That said, rust has a unique way of doing everything you already know, so I’ll advice you approach this note on a blank state and try to draw parallels later.

@donjajo
donjajo / id.c
Created June 13, 2019 22:08
Simple replica of `id` command
#include <stdio.h>
#include <pwd.h>
#include <unistd.h>
#include <stdlib.h>
#include <grp.h>
#include <string.h>
void main( int argc, char *argv[] ) {
struct passwd *user;
struct group *group;
@briandeheus
briandeheus / punk.py
Last active April 1, 2022 02:53
Don't be a punk, punk
import binascii
import struct
class Punk(object):
_END_CHUNK_TYPE = 'IEND'
_PUNK_CHUNK_TYPE = 'puNk'
_MAX_BYTES = 2147483647
_chunks = dict()