Skip to content

Instantly share code, notes, and snippets.

View LazieKat's full-sized avatar

Ahmad Ziad Zain Aldeen LazieKat

  • Ontario
  • 04:13 (UTC -05:00)
View GitHub Profile
@LazieKat
LazieKat / wab.py
Created April 29, 2020 03:11
WhatsApp Activity Poller
import re, codecs
def output_results(f, r):
'''
Write contents of result dicttionary to file after sorting
Params:
f - file handler to write to
r - results dictionary
'''
@LazieKat
LazieKat / triFind.py
Last active April 15, 2020 19:50
Find the number of triamgles possible in a graph
#### Graph object
class Graph:
def __init__(self, lines: str):
'''
Intilize a graph with at least one line
Params:
lines -- a string with lines to initilize
'''
self.lines = dict()
@LazieKat
LazieKat / ytd.py
Created January 6, 2020 00:30
Command line YouTube downloader
from pytube import YouTube, Playlist
import argparse, os, time, pathlib
def video_dl(url, resolution, is_progressive, is_adaptive, is_only_audio, path, numbered, prefix):
print('Fetching ...', end='\r')
for i in range(6):
try:
video = YouTube(url, on_progress_callback=progress)
except:
@LazieKat
LazieKat / tetris.m
Created October 31, 2019 17:12
Tetris written in MATLAB
% Initialize
global piece pieces_types all_pieces running interface plane max_column max_row score blocks
max_row = 23; max_column = 15;
plane = zeros(max_row,max_column);
interface = figure; initialize_window();
load_pieces();
running = true;
score = 0;
blocks = 0;
@LazieKat
LazieKat / random-group-generator.py
Created October 31, 2019 17:04
Generate a random group of specific size from entries
import random, sys
entry_number = -1
entries= []
number_of_groups = 0
def add_entry():
global entry_number, entries
@LazieKat
LazieKat / det.c
Last active October 15, 2019 15:32
Calculate the determinante of an n-by-n matrix
// calculate x^y
float power(float x, int y){
if(y == 1) return x;
return x * power(x, --y);
}
// int d is the size of the square matrix
// float m[d][d] is the actual 2D array
float det(int d, float m[d][d]){
@LazieKat
LazieKat / la.py
Created September 21, 2019 17:49
A simple Langton's ant written in python
import pygame, time, numpy
class grid:
def __init__(self, dimentions):
self.dimentions = dimentions
self.plane = numpy.zeros([dimentions,dimentions])
def changeColor(self, cellPosition):
self.cellPosition = cellPosition
@LazieKat
LazieKat / reddit-video-parser.py
Last active October 31, 2019 17:07 — forked from DarkPointer/app.py
Parse, download and merge reddit video and audio
#!/usr/bin/python3
############ Imports
import re, requests, tempfile, argparse, ffmpy
import urllib.request
############ Parser function
def parseRedditVideo(link: str, outPath: str):