Skip to content

Instantly share code, notes, and snippets.

View rafaelcn's full-sized avatar
🎯
Work work

Rafael Campos Nunes rafaelcn

🎯
Work work
View GitHub Profile
@rafaelcn
rafaelcn / authentication.go
Created October 20, 2022 22:19
Working token issuing
package main
import (
"encoding/json"
"fmt"
"log"
"os"
"time"
"github.com/smallstep/certificates/api"
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/json"
"fmt"
"log"
"os"
"time"
@rafaelcn
rafaelcn / nvidia.go
Created July 1, 2022 21:53
A program to start other programs using the GPU
package main
// keep in mind that applications using OpenGL needs the -gl flag to be
// correctly executed with the GPU. If that doesn't work add the -w flag as I
// noticed in some applications to make it work when -gl alone was not enough.
import (
"bytes"
"flag"
"fmt"
@rafaelcn
rafaelcn / sleep_sort.cpp
Last active March 11, 2018 16:51
Sleep sort
// Not platform dependent
#include <iostream>
#include <chrono>
#include <array>
#include <thread>
void print(int n, std::chrono::seconds s) {
std::this_thread::sleep_for(s);