Skip to content

Instantly share code, notes, and snippets.

@RedaOps
RedaOps / crud_webserver.asm
Created December 21, 2023 23:43
CRUD (only GET and POST) HTTP webserver written in assembly (NASM) for AMD x86-64
[BITS 64]
global _start
%define AF_INET 0x2
%define SOCKET_BACKLOG 0x0
%define O_RDONLY 0x0
%define O_WRONLY 0x1
%define O_CREAT 0q100
struc sockaddr_in
@RedaOps
RedaOps / part1.rs
Created December 5, 2023 21:57
AoC 2023 - Day 5 (multithreaded)
// Not easiest solution, designed to showcase rust's multithreading capabilities
use std::{
collections::HashMap,
sync::{mpsc::Sender, Arc},
thread,
};
type IntervalHashmap = HashMap<InputType, Vec<[u64; 3]>>;
@RedaOps
RedaOps / polkadot_payout.py
Created October 15, 2020 15:09
Polkadot Hackathon [ADVANCED CHALLENGE] REST APIs - Read An Account's Pending Payouts
#!/usr/bin/python3
## Hackathon: Hello World! by Polkadot
## Author @tudorog - GitHub
## Challenge: [ADVANCED CHALLENGE] REST APIs - Read An Account's Pending Payouts
import requests
SIDECAR_API = "http://127.0.0.1:8080"
ALLOWED_METHODS = ["post", "get"]
@RedaOps
RedaOps / discrete.py
Created December 19, 2019 17:54
Discrete Fourier Transform in python with numpy
def DFT(y):
#Initialize empty array to store resulting points in frequency space
fy = np.zeros((len(y)), dtype="float")
for i in range(int(len(y)/2)): #only compute until nyquist limit
fy[i] = 0
a = 0
b = 0
for j in range(len(y)):
#Use euler's formula