Skip to content

Instantly share code, notes, and snippets.

View gabrielhamel's full-sized avatar
🦀
I'm a rustacean

Gabriel Hamel gabrielhamel

🦀
I'm a rustacean
View GitHub Profile
@gabrielhamel
gabrielhamel / database.tf
Created November 26, 2023 18:36
Aurora Postgresql serverless Terraform module
resource "random_password" "random_password_for_root_user" {
length = 32
special = false
}
resource "aws_secretsmanager_secret" "secret_db_root_password" {
name = "${var.project}-db-root-password"
}
resource "aws_secretsmanager_secret_version" "db_branching_root_password_value" {
@gabrielhamel
gabrielhamel / url.test.ts
Last active August 29, 2023 09:08
Validate NextJS url by reading the Page API directory
import { describe, expect, test } from "vitest";
import { url as urlWithoutRoot } from "@/utils/url";
const url = (path: string) =>
urlWithoutRoot(path, "src/utils/url/__tests__/pages");
describe("Check if url exist", () => {
test("Index at the root", () => {
expect(url("/")).toEqual("/");
});
@gabrielhamel
gabrielhamel / main.c
Created October 26, 2022 15:42
Float analyser
#include <stdio.h>
#include <unistd.h>
#include <strings.h>
void my_put_char(char c)
{
write(1, &c, 1);
}
void my_put_nbr_base(int nb, const char *base)
@gabrielhamel
gabrielhamel / Observable.h
Last active September 22, 2021 13:10
Observable template C++
#ifndef CPP_OBSERVABLE_H
#define CPP_OBSERVABLE_H
#include <unordered_map>
#include <functional>
namespace Design {
typedef unsigned long long Subscriber;
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "My custom Gitlab runner"
url = "https://gitlab.com"
token = "<runner_token>"
@gabrielhamel
gabrielhamel / GDB-VSCode
Last active December 14, 2024 15:08
VSCode configuration for GDB debugging with cmake
Put all files into .vscode
- Build: Ctrl+Shift+B
- Launch: Ctrl+F5