Skip to content

Instantly share code, notes, and snippets.

View Chigozie-Gerald's full-sized avatar

Chigozie Ijomah Chigozie-Gerald

View GitHub Profile
@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",