Skip to content

Instantly share code, notes, and snippets.

Avatar

Aggam Rahamim AggamR

View GitHub Profile
View gist:c48ec588879e1bb0c1259b9037afa99a
# 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 Jul 23, 2021
a simple include for hash tables in c++
View hashtable.hpp
#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 Jul 15, 2021
get ms fonts from a windows 10 iso
View getMsFontsIso.sh
#!/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 Mar 31, 2021
a module for polybar to show mic volume
View polybar-mic-vol-module
[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 Mar 26, 2021
a script to automatically backup all files listed in the `/home/aggam/backups/foldersToBackup` file
View backup.sh
#!/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 Feb 22, 2021
sqrt in TASM MS-DOS assembly. doesn't print result - just keeps it in memory.
View sqrt.asm
;Aggam Rahamim
IDEAL
MODEL small
STACK 100h
DATASEG
; --------------------------
; Your variables here
; --------------------------
smaller db 0
final db 0 ; final result
@AggamR
AggamR / primes.c
Created Feb 12, 2021
Finding prime numbers with C
View primes.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) {