Skip to content

Instantly share code, notes, and snippets.

View jakerieger's full-sized avatar
🎯
Focusing

Jake Rieger jakerieger

🎯
Focusing
  • Cleveland, OH
View GitHub Profile
source_dirs=(dir1 dir2 dir3)
total=0
root_dir=$(pwd)
for dir in "${source_dirs[@]}"; do
full_dir="$root_dir/$dir"
cd $full_dir
cpp_lines=$(find . -name '*.cpp' | xargs -I {} cat {} | wc -l)
@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 / 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>
@Niakr1s
Niakr1s / cmake_windows_icon.txt
Created November 23, 2019 19:55
How to add icon to cmake app in windows
1. Put app.ico in directory.
2. Create app.rc in same directory with one line:
IDI_ICON1 ICON DISCARDABLE "app.ico"
3. Run command (Warning: it's app.o, not app.res, how it is mentioned in other manuals!)
windres app.rc -o app.o
4. add_executable(app
...
@arrieta
arrieta / lexer.cpp
Last active May 19, 2025 16:19
Simple C++ Lexer
// A simple Lexer meant to demonstrate a few theoretical concepts. It can
// support several parser concepts and is very fast (though speed is not its
// design goal).
//
// J. Arrieta, Nabla Zero Labs
//
// This code is released under the MIT License.
//
// Copyright 2018 Nabla Zero Labs
//