Skip to content

Instantly share code, notes, and snippets.

View Canadadry's full-sized avatar

Jerome Canadadry

View GitHub Profile
@Canadadry
Canadadry / regexp.go
Last active April 10, 2026 09:09
Rob pike regex matcher in go
// Match reports whether regexp matches anywhere in text.
func Match(regexp, text string) bool {
if regexp != "" && regexp[0] == '^' {
return matchHere(regexp[1:], text)
}
for {
if matchHere(regexp, text) {
return true
}
if text == "" {
@Canadadry
Canadadry / build.h
Last active September 21, 2025 07:30
build system in c for c a header only file
#ifndef BUILD_H
#define BUILD_H
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/stat.h>
#include <dirent.h>
#include <glob.h>
package main
import (
"fmt"
"time"
)
func Mux(funcs []func(string)) chan string {
ch := make(chan string)
childrens := GetChannelsWriterForFuncs(funcs)
@Canadadry
Canadadry / UnReadable.c
Last active October 14, 2019 14:59
This is an unreadable c file... What can this program print ?
#include <stdio.h>
/* auteur inconnu */
long a=10000,b,c=8400,d,e,f[8401],g;
main()
{