Skip to content

Instantly share code, notes, and snippets.

View gligneul's full-sized avatar

Gabriel de Quadros Ligneul gligneul

View GitHub Profile
@gligneul
gligneul / colorlog.go
Last active December 27, 2023 20:15
colorlog.go
// Copyright (c) Gabriel de Quadros Ligneul
// SPDX-License-Identifier: Apache-2.0 (see LICENSE)
// This module implements a colored log handler for log/slog.
//
// For more details on a custom handler implementation, check:
// - https://github.com/golang/example/tree/master/slog-handler-guide
package colorlog
import (
@gligneul
gligneul / services.go
Last active September 25, 2023 22:49
// Example of a simple supervisor that start multiple services in different goroutines
package main
import (
"context"
"fmt"
"time"
)
// service.go
@gligneul
gligneul / mcjit.cpp
Created January 19, 2016 01:49
LLVM MCJIT Code Samples (Working!)
/*
* LLVM 3.5 code sample using MCJit
*
* To compile, execute on terminal:
* clang++ -o mcjit mcjit.cpp `llvm-config --cxxflags --ldflags --libs all --system-libs`
*/
#include <iostream>
#include <memory>