Skip to content

Instantly share code, notes, and snippets.

View jakerieger's full-sized avatar
🎯
Focusing

Jake Rieger jakerieger

🎯
Focusing
View GitHub Profile
@jakerieger
jakerieger / TokyoNight-WindowsTerminal.json
Created April 14, 2024 04:03
Tokyo Night Windows Terminal Color Scheme
{
"background": "#24283B",
"black": "#414868",
"blue": "#7AA2F7",
"brightBlack": "#565F89",
"brightBlue": "#448CFF",
"brightCyan": "#4AD4FF",
"brightGreen": "#87FFEC",
"brightPurple": "#9F6DFF",
"brightRed": "#F76373",
@jakerieger
jakerieger / source_line_count.py
Created February 16, 2024 08:19
Count lines of code in directory
'''
Counts the total number of lines in all text files of
a specified directory, filtered by extension
Ex.
$ python3 source_line_count.py ~/Code/DataStructures ".c,.h"
'''
import sys
import os
@jakerieger
jakerieger / dir_clean.py
Created January 23, 2024 07:59
Directory Cleanup Script
# EXAMPLE
'''
rootDir = "F:"
keepItems = ['some_file.txt', 'some_directory']
Will delete everything in 'F:' that isn't in 'keepItems'
'''
import pathlib
from pathlib import WindowsPath
@jakerieger
jakerieger / symlink_tool.py
Created January 23, 2024 07:54
Symlink Tool
@jakerieger
jakerieger / AVX2vScalar.c
Created January 11, 2024 05:50
Simple SIMD vs Scalar Benchmark in C
#include <stdio.h>
#include <stdint.h>
#include <immintrin.h>
#define ARRAY_SIZE 8
// Returns processor timestamp
// Used to benchmark direct CPU cycles
uint64_t rdtsc() {
unsigned int lo, hi;
@jakerieger
jakerieger / binarysearch.js
Created March 18, 2021 02:01
Binary Search
/**
** -- Assumes a storted list (ascending) as input
**/
function binarySearch(inputArray, token) {
if (token > inputArray[inputArray.length - 1]) {
console.log('Not found');
return;
}
@jakerieger
jakerieger / Dropdown.vue
Created November 18, 2020 00:57
This is a customizable dropdown component for Vuejs
<template>
<div class="custom-select-wrapper">
<div class="custom-select">
<div class="custom-select__trigger"><span>{{ options[0].name }}</span>
<div class="arrow"></div>
</div>
<div class="custom-options">
<span v-for="option in options" v-bind:key="option.id" :class="{ 'custom-option selected': option.id == 0, 'custom-option': option.id !== 0 }">{{ option.name }}</span>
</div>
</div>
var seen = {}
$('table tr').each(function() {
var txt = $(this).text()
if (seen[txt])
$(this).remove()
else
seen[txt] = true
})
@jakerieger
jakerieger / Haskell Cheatsheet.hs
Last active April 29, 2024 13:17
A cheat sheet for the Haskell programming language. Roughly commented.
import Data.List
import System.IO
-- Int: -2^63 to 2^63
minInt = minBound :: Int
maxInt = maxBound :: Int
-- Integer: no range
-- Double: up to 11 points of precision