Skip to content

Instantly share code, notes, and snippets.

@dwolrdcojp
dwolrdcojp / change-password.zig
Created April 22, 2024 13:01
Utilizing Zig Errors for sending unsuccessful response?
const std = @import("std");
const time = std.time;
const zap = @import("../zap/zap.zig");
const pg = @import("pg");
const Conn = pg.Conn;
const StatusCode = zap.StatusCode;
const database = @import("../db/database.zig");
const Result = database.Result;
const http_utils = @import("../utils/http_utils.zig");
const HttpResponse = http_utils.HttpResponse;
@dwolrdcojp
dwolrdcojp / fio_tls_build_context.c
Last active April 12, 2024 23:11
Fix fio build context for certifcates
/** Called when the library specific data for the context should be built */
static void fio_tls_build_context(fio_tls_s *tls) {
fio_tls_destroy_context(tls);
/* TODO: Library specific implementation */
/* create new context */
tls->ctx = SSL_CTX_new(TLS_method());
SSL_CTX_set_mode(tls->ctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
/* see: https://caniuse.com/#search=tls */
SSL_CTX_set_min_proto_version(tls->ctx, TLS1_2_VERSION);
@dwolrdcojp
dwolrdcojp / utils.module.css
Created November 18, 2022 19:24
Next JS Blog App CSS
.heading2Xl {
font-size: 2.5rem;
line-height: 1.2;
font-weight: 800;
letter-spacing: -0.05rem;
margin: 1rem 0;
}
.headingXl {
font-size: 2rem;
@dwolrdcojp
dwolrdcojp / layout.module.css
Created November 18, 2022 19:23
Next JS Blog App CSS
.container {
max-width: 36rem;
padding: 0 1rem;
margin: 3rem auto 6rem;
}
.header {
display: flex;
flex-direction: column;
align-items: center;
@dwolrdcojp
dwolrdcojp / global.css
Created November 18, 2022 19:23
Next 13 - Blog App CSS
.heading2Xl {
font-size: 2.5rem;
line-height: 1.2;
font-weight: 800;
letter-spacing: -0.05rem;
margin: 1rem 0;
}
.headingXl {
font-size: 2rem;