Skip to content

Instantly share code, notes, and snippets.

Avatar

Mosseab Chakrani zerefdev

View GitHub Profile
@zerefdev
zerefdev / check_env.ts
Last active Nov 8, 2022
Nest.js: check if all used environment variables are defined in .env before building.
View check_env.ts
import { createReadStream } from 'node:fs';
import { readdir } from 'node:fs/promises';
import { resolve } from 'node:path';
let envFileContent = '';
createReadStream('.env')
.on('data', (chunk) => {
envFileContent += chunk.toString();
})
.on('end', () => {
@zerefdev
zerefdev / mongo_backup.sh
Created May 11, 2021
MongoDB Backup Script
View mongo_backup.sh
#!/bin/sh
BACKUP_NAME=mongo_backup_`date +"%d-%m-%Y"`.gz
DB=db_name
USER=db_user
PASS=db_password
echo "Dumping MongoDB $DB database to compressed archive"
mongodump --db $DB --username=$USER --password=$PASS --archive=$HOME/backups/$BACKUP_NAME --gzip
View apidoc.code-snippets
{
"apidoc boilerplate": {
"scope": "javascript, typescript",
"prefix": "apidoc",
"body": [
"/**",
" * @api {$1} /$2/$3 $4",
" * @apiVersion 1.0.0",
" * @apiName $1-$3",
" * @apiGroup $2",
@zerefdev
zerefdev / appearance.ts
Last active Oct 15, 2020
[TS] GTA:V Character Appearance Interface
View appearance.ts
export interface Appearance {
sex: number;
face: Face;
faceFeatures: FaceFeature;
hair: Hair;
hairOverlay: number;
headOverlay: HeadOverlay;
}
View permissions.js
const colors = require('./colors');
const { PERMISSIONS } = require('./constants');
/**
*
* @param {*} msg Message
* @param {*} cmd Command label
*/
const checkPermissions = (msg, cmd) => {
const botPermissions = msg.channel.permissionsOf(msg.channel.client.user.id);
const userPermissions = msg.channel.permissionsOf(msg.author.id);
View GTA V NOTIFICATION COLORS
~r~ = Red
~b~ = Blue
~g~ = Green
~y~ = Yellow
~p~ = Purple
~o~ = Orange
~c~ = Grey?
~m~ = Darker Grey
~u~ = Black
~n~ = New Line
View v1868 Weapon Data.json
{
"2725352035": {
"HashKey": "WEAPON_UNARMED",
"NameGXT": "WT_UNARMED",
"DescriptionGXT": "WTD_UNARMED",
"Name": "Unarmed",
"Description": "",
"Group": "GROUP_UNARMED",
"ModelHashKey": "",
"DefaultClipSize": 0,
View gist:9bfa38cdddd1b43917ce323c1f229809
export const HairOverlaysMale = {
0: { collection: 'mpbeach_overlays', overlay: 'FM_Hair_Fuzz' },
1: { collection: 'multiplayer_overlays', overlay: 'NG_M_Hair_001' },
2: { collection: 'multiplayer_overlays', overlay: 'NG_M_Hair_002' },
3: { collection: 'multiplayer_overlays', overlay: 'NG_M_Hair_003' },
4: { collection: 'multiplayer_overlays', overlay: 'NG_M_Hair_004' },
5: { collection: 'multiplayer_overlays', overlay: 'NG_M_Hair_005' },
6: { collection: 'multiplayer_overlays', overlay: 'NG_M_Hair_006' },
7: { collection: 'multiplayer_overlays', overlay: 'NG_M_Hair_007' },
8: { collection: 'multiplayer_overlays', overlay: 'NG_M_Hair_008' },
View gist:69d63d33024af934b2360ac13deb4c5d
export const maleHairNames = [
'Close Shave',
'Buzzcut',
'Faux Hawk',
'Shaved Sides Slicked Back',
'Raised Front Same Length',
'Col De Sacs and Long Back',
'Close Shave and Loose Mohawk',
'Ponytail',
'Corn Rows',
View gist:bc6f6e4e8c30ea37d938a6bc84ff8e08
const StructureGroup: [
{
label: 'Nose Width',
key: 'nosewidth',
value: 0,
min: -1,
max: 1,
increment: 0.1,
id: 0
},