Skip to content

Instantly share code, notes, and snippets.

View delasy's full-sized avatar

Aaron Delasy delasy

View GitHub Profile
@delasy
delasy / gist:e15f3ec5971a7ca33d9dac713ad83100
Last active January 4, 2025 07:47
Check files in current folder start with a certain content (Node.js)
const fs = require("node:fs");
const path = require("node:path");
const banner = `<text-goes-here>`;
const exclusions = ["Dockerfile", "build"];
function traverseFolder (folderPath) {
const realFolderPath = fs.realpathSync(folderPath);
const entries = fs.readdirSync(realFolderPath, { withFileTypes: true });
@delasy
delasy / main.c
Created January 6, 2025 04:48
Find all files/folders case-insensitively matching search criteria
// cc main.c -o main.out
// ./main.out <path>
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
#include <dirent.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>