Skip to content

Instantly share code, notes, and snippets.

View tur11ng's full-sized avatar
🤘

Theodoros Symeonidis tur11ng

🤘
View GitHub Profile
@tur11ng
tur11ng / roofline-model-plotter.py
Last active December 12, 2023 14:11
A script for easily plotting roofline models.
import argparse
import matplotlib.pyplot as plt
import numpy as np
def create_roofline_model(peak_performance, peak_bandwidth, my_operational_intensities=None, output_file_path=None):
operational_intensities = np.logspace(-1, 4, num=100)
performance = np.minimum(peak_performance, peak_bandwidth * operational_intensities)
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
Display *d = NULL;
d = XOpenDisplay(NULL);
Window w;
XEvent e;
import praw
import re
import requests
import random
from io import BytesIO
from functools import cmp_to_key
from collections import namedtuple
from math import sqrt, ceil
from datetime import datetime
import PIL
from sys import argv
import re
use = """
python3 mipsstacksaver.py [OPTION] filename
OPTIONS:
-m: merges the output to the input file
-s: prints the output to the standard output
Example use in source file:
myroutine:
@tur11ng
tur11ng / adapter.h
Last active May 29, 2023 16:32
Helper for porting Arduino code to AT91
#include <fcntl.h>
#include <header.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>