Skip to content

Instantly share code, notes, and snippets.

View Chigozie-Gerald's full-sized avatar

Chigozie Ijomah Chigozie-Gerald

View GitHub Profile
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mycompany.broombookings.com;
# logging: Please add DirectAdmin root below
# logging: Please add DirectAdmin logging below
@Chigozie-Gerald
Chigozie-Gerald / gist:91573fce963880b61afea0151b45050f
Created July 13, 2024 09:38
Broom bookings NGINX config for Public
# nextjs files at specified port with process managed by pm2
location ^/(service|cart|services|checkout)($|/|\?.*) {
proxy_pass http://127.0.0.1:6060;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@Chigozie-Gerald
Chigozie-Gerald / error.json
Created November 17, 2023 09:43
Settings Error JSON
{
"message": "Unable to create lockable file: /var/www/cleanbee-laravel/storage/framework/cache/data/23/9f/239fa360217c7e67867b1fe5005ad5bb81f28ba0. Please ensure you have permission to create files in this location.",
"exception": "Exception",
"file": "/var/www/cleanbee-laravel/vendor/laravel/framework/src/Illuminate/Filesystem/LockableFile.php",
"line": 73,
"trace": [
{
"file": "/var/www/cleanbee-laravel/vendor/laravel/framework/src/Illuminate/Filesystem/LockableFile.php",
"line": 43,
"function": "createResource",
@Chigozie-Gerald
Chigozie-Gerald / translate.ts
Created August 2, 2023 15:54
A typescript snippet I use in supporting multi-lang functionalities for not so big websites
/** Example json containing translate strings and variables */
const json = {
"The house costs {{amount}} and not {{amount}}": {
en: "The house costs {{amount}} and not {{amount}}",
fr: "La maison coûte {{amount}} et non {{amount}}",
},
};
type locale = "en" | "fr";
type translation_variables = "{{amount}}" | "{{...whatever}}";
@Chigozie-Gerald
Chigozie-Gerald / numberToText.js
Created September 14, 2022 07:48
Script to get text in Lithuanian language from a number (Javascript)
// According to https://gist.github.com/tadas-subonis/6e23811db350a440cd47e2e5dd40e2cb
const numToText = (num) => {
const units = [
"",
"vienas",
"du",
"trys",
"keturi",
"penki",
@Chigozie-Gerald
Chigozie-Gerald / numberToText.ts
Last active February 22, 2024 00:36
Script to get text in Lithuanian language from a number (Typescript)
// According to https://gist.github.com/tadas-subonis/6e23811db350a440cd47e2e5dd40e2cb
const numToText = (num: number) => {
const units = [
"",
"vienas",
"du",
"trys",
"keturi",
"penki",