Skip to content

Instantly share code, notes, and snippets.

View SpaghettDev's full-sized avatar
:shipit:
doing stuff

SpaghettDev SpaghettDev

:shipit:
doing stuff
View GitHub Profile
@SpaghettDev
SpaghettDev / cpp-func-args-parser.py
Created May 3, 2024 17:34
Scrapped C++ function arguments parser.
from re import findall, sub
CPP_TYPE_SPECIFIERS = ("unsigned", "signed")
CPP_DATA_TYPES = ("bool", "char", "short", "int", "long")
CPP_TYPE_QUALIFIERS = ("const", "volatile")
def format_parameters(parameters: str) -> dict[str, str]:
"""Formats a functions's parameters.
TODO: maybe, just maybe, dont use regex?
@SpaghettDev
SpaghettDev / layer.hpp
Last active December 17, 2023 15:12
An FLalertLayer than actually registers touch events within nested CCMenus (Geometry Dash)
#include <cocos2d.h>
#include <gd.h>
class Layer : public gd::FLAlertLayer
{
public:
CCMenu* m_pMenu{};
void onEnter() override
{
@SpaghettDev
SpaghettDev / range.js
Created August 29, 2023 14:21
Python-like range function in Javascript.
/**
* Python-like range function
*
* @param start {Number} Start value, inclusive, if end isn't provided, start is end
* @param end {Number|null} End value, exclusive, defaults to null
* @param step {Number} Step value, default to 1
* @returns {Array} [start, start+step, start+step*2, ..., end - 1]
*/
const range = (start, end=null, step=1) => {
@SpaghettDev
SpaghettDev / radio_stations.cpp
Created November 4, 2022 12:10
All GTA 5 radio stations (including hidden ones).
// Taken from https://gist.github.com/Sainan/e290bef8b482005a01f3444d3341ac5f
// and https://web.archive.org/web/20211024160434/https://pastebin.com/Kj9t38KF.
std::vector<std::string> radio_stations{
"RADIO_11_TALK_02", // Blaine County Radio
"RADIO_12_REGGAE", // The Blue Ark
"RADIO_13_JAZZ", // Worldwide FM
"RADIO_14_DANCE_02", // FlyLo FM
"RADIO_15_MOTOWN", // The Lowdown 9.11
"RADIO_20_THELAB", // The Lab