Skip to content

Instantly share code, notes, and snippets.

View andy5995's full-sized avatar

Andy Alt andy5995

View GitHub Profile
@marcinwol
marcinwol / dir_tree_read.cpp
Last active April 1, 2023 22:09
An example showing how to find all paths in a given folder and its sub folders using fts_read function.
#include <errno.h>
#include <string.h>
#include <fts.h>
#include <iostream>
#include <vector>
using namespace std;
@andy5995
andy5995 / BOOGERS.BAS
Created November 2, 2018 20:11
source code for BOOGERS by Mitch Teich 1982
1 REM NOTHING
2 REM
3 REM
5 REM DATNOIDS Copyright (c) 1982 By Casey Roche
8 REM
9 SCREEN 0,0,0
10 KEY OFF:WIDTH 80:COLOR 0,1,0:CLS:PLAY"mb":COLOR 4,0:LOCATE 24,1:PRINT" "+STRING$(78,219):SOUND 1000,1:PRINT" 000000 0000 00000000 00 00 000000 00000000 000000 00000":SOUND 2000,1
80 PRINT" 0222220 022220 02222220 02 20 02222220 02222220 0222220 0222220":SOUND 1000,1:PRINT" 02 20 02 20 22 020 20 02 20 22 02 20 0220 ":SOUND 2000,1
120 PRINT" 02 20 02 20 22 0220 20 02 20 22 02 20 0220 ":SOUND 1000,1:PRINT" 02 20 02222220 22 0202020 02 20 22 02 20 0220 ":SOUND 2000,1
160 PRINT" 02 20 02 20 22 02 0220 02 20 22 02 20 0220":SOUND 1000,1:PRINT" 02 20 02 20 22 02 020 02 20 22 02 20 0220":SOUND 2000,1
/* Getopt for GNU.
Copyright (C) 1987-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.
Patches to this file should be submitted to both projects.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
@andy5995
andy5995 / gist:ea3409d35036e16f9954918bcd27ffa6
Last active June 30, 2019 18:03
rm.c (GNU coreutils 8.26)
/* 'rm' file deletion utility for GNU.
Copyright (C) 1988-2016 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@sl5net
sl5net / local.cfg
Last active July 13, 2022 01:59
local.cfg
UserRatingBackup = "1075"
adaptivefps.menu = "43.59925842285156"
adaptivefps.session = "24.601099014282227"
autociv.data.mute = "%7B%7D"
autociv.data.playerReminder = "%7B%22jews%22%3A%22Warning%3AleftAlwaysInSeconds%22%2C%22ELBOTIJA%22%3A%22Warning%3AleftAlwaysInSeconds%22%2C%22._%22%3A%22Warning%3AleftAlwaysInSeconds%22%2C%22todolomeo%22%3A%22Warning%3AleftAlwaysInSeconds%22%2C%22yasa.baris%22%3A%22Warning%3AleftAlwaysInSeconds%22%2C%22Higgs%22%3A%22Warning%3AleftAlwaysInSeconds%22%7D"
autociv.data.playersBox = "%7B%22selected_column%22%3A%22rating%22%2C%22selected_column_order%22%3A-1%7D"
autociv.gamesetup.countdown.enabled = "false"
autociv.gamesetup.countdown.time = "5"
autociv.lobby.chat.subject.hide = "true"
autociv.lobby.gamelist.showHostName = "true"
@Jammyjamjamman
Jammyjamjamman / get_foldersizes.ps1
Last active May 7, 2022 20:37
Basic powershell script to get folder sizes in current dir (depth 1).
Get-ChildItem -Directory | ForEach-Object {
echo "Folder: $($_.Name)"
echo "Size: $((Get-ChildItem $_.Name -Recurse | Measure-Object -Property Length -Sum).Sum/(1024*1024*1024))GiB"
echo ""
}
@Jammyjamjamman
Jammyjamjamman / bash_stuff.sh
Last active January 8, 2023 21:33
bash_stuff.sh
#!/bin/sh
# Credits to Andy5995 for finding many (currently all) of these commands.
# commands for indenting C code with 2 spaces
indent -ci2 -bl -bli0 -nut -npcs *.c *.h
# If you make a script from this command...
indent -ci2 -bl -bli0 -nut -npcs $1 $2
# build with openssl
@Jammyjamjamman
Jammyjamjamman / gh-actions-configuring.yml
Created May 13, 2022 21:34
some snippets for github actions
# Cancel workflow if new workflow in same group is in progress.
# https://docs.github.com/en/enterprise-cloud@latest/actions/using-jobs/using-concurrency
name: Build
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
# allow only certain types of pull_request.
pull_request:
types: [ opened, reopened, synchronize ]
@Jammyjamjamman
Jammyjamjamman / Makefile
Last active June 23, 2022 20:40
Dead simple makefile (in this case for building openssl bins).
# CC = gcc # Optional. Will use system default if not given here e.g. gcc or clang.
CFLAGS = -g -Wall -fanalyzer $(shell pkg-config --cflags openssl)
LIBS=$(shell pkg-config --libs openssl)
LDFLAGS = $(LIBS)
bins = decrypt_file encrypt_file
all: $(bins)
clean:
@for file in $(bins); do \