Skip to content

Instantly share code, notes, and snippets.

View thealexcons's full-sized avatar

Alex thealexcons

View GitHub Profile
@thealexcons
thealexcons / semaphore.cpp
Last active March 14, 2022 09:32
Atomic CAS counting semphore
#include <atomic>
#include <thread>
#include <emmintrin.h>
class Semaphore {
public:
explicit Semaphore(uint32_t init_value);
void acquire();
void release();
@thealexcons
thealexcons / jwt_golang_example.go
Last active April 16, 2023 03:04
JSON Web Tokens in Go
package main
import (
"io/ioutil"
"log"
"strings"
"net/http"
"encoding/json"
"fmt"
"time"