Skip to content

Instantly share code, notes, and snippets.

View harieamjari's full-sized avatar

Al-buharie harieamjari

View GitHub Profile
@harieamjari
harieamjari / driver.py
Created March 31, 2023 20:35
render obj file
import png
from ctypes import *
"""
struct vec3D {
double x, y, z;
};
/* A triangle is composed of 3D vertices */
struct triangle3D {
struct vec3D *vertex[3];
@harieamjari
harieamjari / lwering.c
Last active March 2, 2023 03:06
RING-LWE block (8 bit) based cipher.
/* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or distribute
* this software, either in source code form or as a compiled binary,
* for any purpose, commercial or non-commercial, and by any means.
*
* In jurisdictions that recognize copyright laws, the author or authors of
* this software dedicate any and all copyright interest in the software to
* the public domain. We make this dedication for the benefit of the public
* at large and to the detriment of our heirs and successors. We intend
@harieamjari
harieamjari / ringlew.c
Last active March 1, 2023 16:04
Minimal ring-lwe encryption
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define M 256
#define P 2048
/* Possible 256 values from 0 to 255*/
#define V 256
@harieamjari
harieamjari / notch10000.c
Created February 15, 2023 13:03
Notch filter transfer function
/* Notch filter at 10000Hz */
#include <stdio.h>
#include <complex.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
int main(int argc, char *argv[]){
assert(argc == 2);
@harieamjari
harieamjari / Makefile
Last active August 31, 2022 01:48
Convolutional reverb in C
LDFLAGS = -lm
CFLAGS = -O3
main: main.c defs.o
defs.o: ir.raw out.raw
$(LD) -r -b binary $^ -o $@
#include <stdio.h>
#include <string.h>
#include <assert.h>
int main(int argc, char *argv[]){
assert(argc == 3);
char *file_name = argv[1];
char *html_title = argv[2];
FILE *fpin = stdin;
\documentclass[12pt]{article}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{graphicx, chemfig, hyperref}
\title{Physics \\
Activity \#2: What's the matter?}
\author{Al-buharie Amjari, STEM-A 12}
\makeatletter % from: https://tex.stackexchange.com/a/101263/134144
\tikzset{
dot diameter/.store in=\dot@diameter,
@harieamjari
harieamjari / .gitignore
Last active December 20, 2021 13:48
Letter SCC
*.aux
*.log
t.pdf
@harieamjari
harieamjari / pdfa.pdf
Last active November 19, 2021 14:57
pdfa
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@harieamjari
harieamjari / nonpdfa.pdf
Last active November 19, 2021 14:50
nonpdfa
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.