Skip to content

Instantly share code, notes, and snippets.

@Mashpoe
Mashpoe / OpenSimplexNoise.hpp
Last active July 7, 2024 06:35 — forked from Markyparky56/OpenSimplexNoise.hpp
OpenSimplex Noise Refactored for C++
#pragma once
/*******************************************************************************
OpenSimplex Noise in C++
Ported from https://gist.github.com/digitalshadow/134a3a02b67cecd72181
Originally from https://gist.github.com/KdotJPG/b1270127455a94ac5d19
Optimised by DigitalShadow
This version by Mark A. Ropper (Markyparky56)
*******************************************************************************/
#include <array>
#include <vector>
@Mashpoe
Mashpoe / include-filter
Created April 21, 2023 08:34
File Explorer include folder filter query
NOT ext:.h AND NOT kind:folders
@Mashpoe
Mashpoe / friend.cpp
Created November 13, 2022 08:27
Hide private members from a friend class
#include <iostream>
// forward declare Foo so we can make it a friend of FooPrivate
class Foo;
// allows us to hide instance members from friends of Foo,
// but still allows Foo itself to access them.
class FooPrivate
{
private:
@Mashpoe
Mashpoe / download-audio-only.bat
Created July 31, 2022 01:56
YouTube video downloader scripts for Windows (place these in a folder with youtube-dl.exe)
@echo off
set /p Input=Enter YouTube video URL:
@echo on
youtube-dl -f bestaudio -o "output-audio-only/%%(title)s-%%(id)s.%%(ext)s" %Input%
@echo off
set /p DUMMY=Press ENTER to continue...
@Mashpoe
Mashpoe / RunMinecraftServer.bat
Last active June 13, 2022 23:20
Starts up a Minecraft server and restarts it whenever it crashes. If you type "stop" in the server console, the server will close without restarting.
@echo off
:loop
java -jar server.jar nogui
echo ERROR CODE: %errorlevel%
if not %errorlevel%==0 goto :loop
@Mashpoe
Mashpoe / main.c
Last active August 13, 2024 17:31
ASCII Tesseract Rotation C Program
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <windows.h>
// width and height of screen
#define ww 100
#define wh 50
void clr(CHAR_INFO* d)