Skip to content

Instantly share code, notes, and snippets.

View svidovich's full-sized avatar
📡
Dear Jim I don't even know what a front-end web framework is

Samuel Vidovich svidovich

📡
Dear Jim I don't even know what a front-end web framework is
View GitHub Profile
@svidovich
svidovich / README.md
Last active August 29, 2021 21:14
Testing Some Open Source Libraries

Before you run any of the test files, run chmod +x build_venv.sh && ./build_venv.sh to get all of the necessary packages in a virtual environment. Then, source venv/bin/activate to activate it.

@svidovich
svidovich / dataset_xor.py
Last active August 31, 2021 02:03
XOR Two Datasets with Python Sets
import random
import time
def generate_big_list(size) -> list:
big_list = list()
for _ in range(size):
big_list.append(random.randint(1, size * 2))
return big_list
import random
import time
from typing import Tuple
def generate_big_list_and_big_set(size) -> Tuple[list, set]:
big_list = list()
big_set = set()
for _ in range(size):
@svidovich
svidovich / list_dedupe.py
Created August 28, 2021 16:55
Testing List Deduplication
import random
import time
def generate_big_list(size) -> list:
big_list = list()
for _ in range(size):
big_list.append(random.randint(1, 100))
return big_list
@svidovich
svidovich / lru_sample.py
Last active August 28, 2021 16:55
Testing LRU Caches with Tuple Lookups
import random
import time
from functools import lru_cache
def generate_big_tuple(size) -> tuple:
big_list = list()
for i in range(size):
big_list.append(i * random.randint(1, 1000))
return tuple(big_list)
@svidovich
svidovich / find_best_darts.py
Last active July 20, 2021 01:45
Code for "Extraordinarily Bland Analysis of a Game of Darts"!
from typing import List
dartboard = [
20,
1,
18,
4,
13,
6,
10,
@svidovich
svidovich / explore_weather_data.py
Created July 12, 2021 22:02
Code for "Hastily Constructed Precipitation Analysis"
#!/usr/bin/env python3
import argparse
import csv
import datetime
import matplotlib.pyplot as plot
from typing import Dict, List
@svidovich
svidovich / pyspark.md
Last active March 5, 2021 02:59
PySpark Jupyter Notebook Tutorial: Copy & Paste

You, too, can learn PySpark right on your Linux ( or other Docker-compatible ) Desktop with a few short, easy steps!

Before we begin, make sure you have docker installed. Here's the official documentation: https://docs.docker.com/get-docker/

Got that done? Good! Let's get started.

First let's get our bashrc set up so that we can just use a command instead of remembering complicated docker flags. Nobody likes those.

echo 'alias pyspark-jupyter="docker run -it --rm -p 8888:8888 jupyter/pyspark-notebook"' >> ~/.bashrc
@svidovich
svidovich / description.md
Last active February 9, 2021 01:25
Recovering Windows Product Keys from Registry Files

THIS IS A UTILITY FOR GETTING PRODUCT KEYS FROM REGISTRY FILES ON A COMPUTER THAT DOES NOT RUN, NOT FROM A RUNNING MACHINE

Recently, a friend of mine was building a computer and had lost his product key. He couldn't boot the old computer, but his partitions were intact.

So, I went searching for a way to pull the registry keys from the partition so I could get his keys back. He had tried produkey, etc. but I thought I could give it another shot.

He zipped up his C:\Windows\system32\config folder and sent it to me, so I grepped around looking for product keys. As it would turn out, they generally live in a file aptly called SOFTWARE.

I wandered around looking for tools and found one that could decrypt keys, but not one that could open just... files. So, I found a library called python-registry that could open up files, and from there it was pretty simple.

@svidovich
svidovich / opencl_tutorial_1.md
Created November 25, 2019 03:04
OpenCL Notes