Skip to content

Instantly share code, notes, and snippets.

View Zorono's full-sized avatar
😌
I may be slow to respond.

John Magdy Lotfy Kamel Zorono

😌
I may be slow to respond.
View GitHub Profile
@jakub-g
jakub-g / javascript-to-typescript-cheatsheet.md
Last active February 14, 2024 00:50
Migrate/convert JavaScript to TypeScript cheatsheet

Relevant official docs

Migrating NodeJS CJS files (require, module.exports)

First steps

  1. Rename the file from .js to .ts
  2. Change module.exports = to export =
  3. Change all exports.foobar = to export const foobar =
  4. Update top-level require calls to static import.
@airglow923
airglow923 / sources.list-focal
Last active April 23, 2025 14:26
Ubuntu Mirrors sources.list for Focal (20.04), Hirsute (21.04), Impish (21.10) and Jammy (22.04)
deb https://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
deb-src https://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
deb https://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
deb-src https://archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
deb https://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
deb-src https://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
deb https://archive.ubuntu.com/ubuntu focal-proposed main restricted universe multiverse
@AnisahTiaraPratiwi
AnisahTiaraPratiwi / Calculator1.py
Created March 20, 2021 10:05
Most hard drives are divided into sectors of 512 bytes each. Our disk has a size of 16 GB. Fill in the blank to calculate how many sectors the disk has. Note: Your result should be in the format of just a number, not a sentence.
disk_size = 16*1024*1024*1024
sector_size = 512
sector_amount = (((16*1024*1024*1024)/512))
print(sector_amount)
@rromanv
rromanv / ._ Node.js Project with ES6 + Babel 7 + ESLint + Airbnb + Prettier.md
Last active February 14, 2024 00:44 — forked from vukhanhtruong/._README.md
Setup Javascript / Nodejs Project with ES6 + Babel 7 + ESLint + Airbnb + Prettier

Project Setup

Create a directory and run the following command.

npm init 

For this tutorial, I will be adding an index.js file to the src folder, and this will be our entry point. Our file directory should look like this.

@spr2-dev
spr2-dev / pattern_matching.md
Last active November 13, 2025 20:20
A quick beginner guide on Lua pattern matching

Lua Pattern Matching Cheat Sheet

Table Of Contents

  1. What's a pattern ?
  2. Positional characters
  3. Common matching characters
  4. Ranges, character sets and logic
  5. Quantifiers
  6. Capture groups
  7. Examples
@alwynallan
alwynallan / Makefile
Last active October 5, 2025 17:08
Hardware PWM Controller for the Raspberry Pi 4 Case Fan
CC = gcc
RM = rm -f
INSTRUMENT_FOR_PROMETHEUS := false
ifeq ($(INSTRUMENT_FOR_PROMETHEUS),true)
CFLAGS = -Wall -DINSTRUMENT_FOR_PROMETHEUS
LIBS = -lbcm2835 -lprom -lpromhttp -lmicrohttpd
else
CFLAGS = -Wall
#define FILTERSCRIPT
#include <a_samp>
#include <colandreas>
new pBall;
new
Float:InGameX = 0.7,
Float:InGameY = 0.525,
@triangletodd
triangletodd / update_discord.sh
Created December 5, 2020 04:29
Update Discord on Debian
#!/usr/bin/env bash
set -e
trap "{ rm -f $tmpfile; }" EXIT
tmpfile="$(mktemp)"
main() {
curl -Lo "$tmpfile" 'https://discord.com/api/download?platform=linux'
sudo dpkg -i "$tmpfile"
@lovromazgon
lovromazgon / mute_twist.sh
Last active March 13, 2024 11:02
Mute Twist thread
#!/bin/bash
# Mutes a Twist thread for some time (30 minutes by default).
#
# Usage:
# ./mute_twist.sh <email> <password> <thread ID> [<minutes>]
EMAIL=$1
PASSWORD=$2
THREAD_ID=$3
MINUTES=${4:-30}