This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import gi | |
gi.require_version('Gst', '1.0') | |
from gi.repository import Gst, GLib | |
import numpy as np | |
from collections import deque | |
if len(sys.argv) != 3: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
HVML (Higher-order Virtual Machine Language) Implementation | |
The runtime memory consists of a vector of ports (represented as Terms), where each port has: | |
- A 3-bit tag indicating the type of node it connects to | |
- A location value pointing to where that node's ports begin in memory | |
Memory Model | |
----------- | |
A port represents a wire connected to a node's main port. The tag indicates the type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to clone AUR package | |
clone_package() { | |
if [ -d ~/aur/"$1" ]; then | |
echo "Package '$1' already exists." | |
else | |
git clone "https://aur.archlinux.org/$1.git" ~/aur/"$1" | |
echo "Package '$1' cloned successfully." | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from PIL import ImageFilter | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.io.wavfile import write | |
threshold = 200 | |
# Open image and convert to numpy array | |
img = Image.open("matterhorn.png") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
# Define your GitHub username and organization name | |
YOUR_USERNAME="pepijndevos" | |
ORG_NAME="SciML" | |
# Iterate through the organization's repositories | |
REPO_LIST=$(gh repo list $ORG_NAME --json name --limit 1000 --no-archived) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ControlSystems | |
using Plots | |
# calculate the inertia from bifilar pendulum experiment | |
# https://www.youtube.com/watch?v=IdhV3lphRcc | |
L = 1.8 # length of the pendulum | |
D = 0.18 # distance between the wires | |
b = D/2 | |
g = 9.81 # graviational constant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import amaranth *) | |
(defn domain [domain #* expr] (domain.__iadd__ expr)) | |
(defmacro mwhen [m condition #* body] | |
`(do | |
(with [(m.If ~condition)] | |
~body))) | |
(defmacro mif [m condition pos neg] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import minipb | |
import zlib | |
value = (('string_value', 'U'), | |
('float_value', 'f'), | |
('double_value', 'd'), | |
('int_value', 't'), | |
('uint_value', 'T'), | |
('sint_value', 'z'), | |
('bool_value', 'b')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os | |
import re | |
import subprocess | |
import mmap | |
def patch(filename : str, bytes): | |
subprocess.run(["cp",filename, filename + '_patched']) | |
with open(filename + "_patched", "r+b") as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -ex | |
ORIGINAL="fox.jpg" | |
OG_SHIRT="#224e2b" | |
OG_PANTS="#9f6e4e" | |
function rand { | |
echo $(($1 + ($RANDOM % ($2 - $1)))); | |
} | |
mkdir -p tiles |
NewerOlder