Skip to content

Instantly share code, notes, and snippets.

View amr3k's full-sized avatar
🏠
Working from home

A̴m̴r̴ ع̲مِےـرۅ amr3k

🏠
Working from home
View GitHub Profile
@amr3k
amr3k / clone_all_gists.sh
Last active April 18, 2021 02:47
How to clone all gists owned by user
curl -s "https://api.github.com/users/USER_NAME/gists?per_page=1000" | jq -r ".[].git_pull_url" | xargs -L1 git clone
@amr3k
amr3k / ERPNext13-manual-installation-guide.md
Last active June 27, 2022 21:19
ERPNext manual installation guide (Debian 11 VPS)

Installation instructions

Feel free to Add/modify anything

Here we are using digitalocean Debian 11 droplet ($5/month)

Quick notes

We are going to use these emojis

@amr3k
amr3k / Quicksand_Light_Regular.json
Created July 20, 2022 03:46
Floating word assets
{"glyphs":{"0":{"ha":817,"x_min":83,"x_max":733,"o":"m 408 -14 q 226 53 299 -14 q 119 235 154 121 q 83 486 83 349 q 119 738 83 625 q 226 919 154 851 q 408 986 299 986 q 591 919 519 986 q 698 738 663 851 q 733 486 733 625 q 698 235 733 349 q 591 53 663 121 q 408 -14 519 -14 m 408 44 q 556 101 497 44 q 645 258 615 158 q 675 486 675 358 q 645 715 675 615 q 556 872 615 815 q 408 928 497 928 q 260 872 319 928 q 172 715 201 815 q 142 486 142 615 q 172 258 142 358 q 260 101 201 158 q 408 44 319 44 z "},"1":{"ha":504,"x_min":35,"x_max":338,"o":"m 308 0 q 288 8 296 0 q 279 28 279 17 l 279 908 l 293 900 l 81 760 q 65 754 72 754 q 44 765 53 754 q 35 785 35 775 q 50 808 35 800 l 293 968 q 306 973 300 972 q 317 972 311 974 q 332 963 326 971 q 338 944 338 956 l 338 28 q 329 8 338 17 q 308 0 321 0 z "},"2":{"ha":763,"x_min":83,"x_max":693,"o":"m 665 56 q 685 47 676 56 q 693 28 693 39 q 685 8 693 15 q 665 0 676 0 l 129 0 q 106 6 117 0 q 94 29 94 13 q 101 47 94 38 l 428 411 q 555 578 514 504 q 596 713 596 653 q 535 871 596 81
@amr3k
amr3k / style.css
Created October 9, 2022 08:39
Flatpickr RTL
.flatpickr-calendar .dayContainer,
.flatpickr-calendar .flatpickr-weekdaycontainer {
flex-direction: row-reverse;
}
.flatpickr-month {
height: 32px;
}
.flatpickr-prev-month {
left: auto !important;
@amr3k
amr3k / script.ts
Created October 15, 2022 10:33
[Arabic] Stringify numbers
export function stringifyNumber(num: number, gender: 'male' | 'female' = 'male') {
const special = {
male: ['', 'الأول', 'الثاني', 'الثالث', 'الرابع', 'الخامس', 'السادس', 'السابع', 'الثامن', 'التاسع', 'العاشر', 'الحادي عشر', 'الثاني عشر', 'الثالث عشر', 'الرابع عشر', 'الخامس عشر', 'السادس عشر', 'السابع عشر', 'الثامن عشر', 'التاسع عشر'],
female: ['', 'الأولى', 'الثانية', 'الثالثة', 'الرابعة', 'الخامسة', 'السادسة', 'السابعة', 'الثامنة', 'التاسعة', 'العاشرة', 'الحادية عشر', 'الثانية عشر', 'الثالثة عشر', 'الرابعة عشر', 'الخامسة عشر', 'السادسة عشر', 'السابعة عشر', 'الثامنة عشر', 'التاسعة عشر']
};
const deca = ['عشرون', 'ثلاثون', 'أربعون', 'خمسون', 'ستون', 'سبعون', 'ثمانون', 'تسعون'];
if (num < 20) return special[gender][num];
if (num % 10 === 0) return 'ال' + deca[Math.floor(num / 10) - 2];
return special[gender][num % 10] + ' و' + 'ال' + deca[Math.floor(num / 10) - 2];
}
@amr3k
amr3k / GLSL-Noise.md
Created January 2, 2023 23:35 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@amr3k
amr3k / Nextcloud-solution.md
Created January 30, 2023 05:48
[SOLVED] Nextcloud cron job issue with docker

If you setup nextcloud with docker-compose, and you find a warning with the background jobs not being executed for x days, just add this cron job to your host os.

You can replace nextcloud with your nextcloud container name, you can check it with docker ps

*/5 * * * * docker exec -u www-data nextcloud php cron.php
@amr3k
amr3k / index.ts
Created December 19, 2023 06:46
Javascript debounce function
/**
* Debounces a function by delaying its execution until a certain amount of time has passed without any further calls.
* @param {Function} func - The function to be debounced.
* @param {number} delay - The delay in milliseconds.
* @returns {Function} - The debounced function.
*/
function debounce(func: Function, delay: number): Function {
let timeout: ReturnType<typeof setTimeout>;
return function (...args: any[]) {
clearTimeout(timeout);
@amr3k
amr3k / Fix Broken EDID Guide.md
Last active October 29, 2024 17:43 — forked from hinell/Fix Broken EDID Guide.md
Guide how to achieve better resolution with broken EDID. Two methods are used: xorg.conf config and kernel params.

Fix Broken EDID Guide

This guide outlines replacement of the broken EDID metadata file for the device in Linux Operating Systems.

Last-Modified: Sunday, April 11, 2021

• • •