Skip to content

Instantly share code, notes, and snippets.

View AggamR's full-sized avatar

Aggam Rahamim AggamR

View GitHub Profile
# This is fizzbuzz in one line
# I was bored in python class, enjoy
for x in [ list(['FizzBuzz'] + [i]*2 + ['Fizz', i] + ['Buzz', 'Fizz'] + [i]*2 + ['Fizz'] + [i]*2 + ['Fizz'] + [i]*2)[i % 15] for i in range(0, 500) ]: print(x)
@AggamR
AggamR / hashtable.hpp
Created July 23, 2021 11:23
a simple include for hash tables in c++
#include <string>
#define CAPACITY 100
// copied from the internet (thanks internet)
unsigned long hash_function(std::string str) {
unsigned long i = 0;
for (int j=0; j < str.length(); j++)
i += str.at(j);
return i % CAPACITY;
@AggamR
AggamR / getMsFontsIso.sh
Created July 15, 2021 15:38
get ms fonts from a windows 10 iso
#!/bin/bash
echo -e "Hello! this is a shell script to help you get microsoft fonts straight from a Windows 10 ISO. \nThis can be used for any language."
[ "$EUID" -ne 0 ] && echo "Please run this script as root."
[ ! -x "$(command -v 7z)" ] && echo "You need 7z installed in order for the scipt to run"
echo enter iso file path:
read ISOPATH
@AggamR
AggamR / polybar-mic-vol-module
Created March 31, 2021 08:52
a module for polybar to show mic volume
[module/mic-volume]
type = custom/script
exec = echo "Mic Vol 🎙️: $(amixer sget Capture | grep "Front Left" | sed -n 2p | awk '{ print $5 }')"
interval = 2
@AggamR
AggamR / backup.sh
Created March 26, 2021 15:04
a script to automatically backup all files listed in the `/home/aggam/backups/foldersToBackup` file
#!/bin/bash
[ -d /home/aggam/backups/folders$(date '+%d%B%Y') ] && rm -rf /home/aggam/backups/folders$(date '+%d%B%Y')
while read p; do
echo $p
mkdir /home/aggam/backups/folders$(date '+%d%B%Y')
cp -r $p /home/aggam/backups/folders$(date '+%d%B%Y')
done </home/aggam/backups/foldersToBackup
@AggamR
AggamR / sqrt.asm
Last active January 15, 2023 19:06
sqrt in TASM MS-DOS assembly. doesn't print result - just keeps it in memory.
;Aggam Rahamim
IDEAL
MODEL small
STACK 100h
DATASEG
; --------------------------
; Your variables here
; --------------------------
smaller db 0
final db 0 ; final result
@AggamR
AggamR / primes.c
Created February 12, 2021 15:34
Finding prime numbers with C
#include <stdio.h>
int main( int argc, char *argv[]) {
if (argc < 2)
printf("must supply argument - range");
int devisors = 0, num, devisor, largest, range = atoi(argv[1]);
for (num = 7; num < range; num += 2) {