Skip to content

Instantly share code, notes, and snippets.

View romgerman's full-sized avatar
🥔
botato

romgerman

🥔
botato
View GitHub Profile
@romgerman
romgerman / editor_inspector.gd
Created December 2, 2025 14:18
Godot 4.5.1 editor inspector spacing addon
extends EditorInspectorPlugin
var custom_sb: StyleBoxFlat
func _init() -> void:
custom_sb = StyleBoxFlat.new()
custom_sb.bg_color = Color.TRANSPARENT
custom_sb.corner_radius_top_left = 2
custom_sb.corner_radius_bottom_left = 2
custom_sb.corner_radius_top_right = 2
@romgerman
romgerman / anim.gd
Last active July 29, 2024 10:54
Animation function for Godot 4
extends Node
## Animation function
## [br]
## [param start_props] Sets values to properties on init. $ means "set property to initial value of node"
## [br]
## [param end_props] Sets properties for tweening
## [br]
## [param options] Global tween options such as duration, delay, parallel and trans
## [br]
@romgerman
romgerman / MonoBehaviourSingleton.cs
Created April 16, 2023 17:39 — forked from rickyah/MonoBehaviourSingleton.cs
MonoBehaviour Singleton
using System;
using UnityEngine;
/// <summary>
/// This is a generic Singleton implementation for Monobehaviours.
/// Create a derived class where the type T is the script you want to "Singletonize"
/// Upon loading it will call DontDestroyOnLoad on the gameobject where this script is contained
/// so it persists upon scene changes.
/// </summary>
/// <remarks>

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@romgerman
romgerman / example.js
Created July 6, 2019 14:55
Sequencing async functions with callbacks
utils.sequence([
(ready) => connection.query(createPersonTableSQL, (error, results, fields) => {
ready()
}),
(ready) => connection.query(createPortfolioTableSQL, (error, results, fields) => {
ready()
}),
(ready) => connection.query(createDebtTableSQL, (error, results, fields) => {
ready()
}),
@romgerman
romgerman / cooldown.cs
Created April 24, 2019 17:35
Untested cmd cooldown class for Rust (game)
static class CmdCooldown {
public static Dictionary<string, Dictionary<IPlayer, TimeSpan>> Players = new Dictionary<string, Dictionary<IPlayer, TimeSpan>>();
public static bool CanUse(IPlayer player, TimeSpan cooldown, [CallerMemberName] string name = null)
{
if (!Players.ContainsKey(name))
{
Players.Add(name, new Dictionary<IPlayer, TimeSpan>());
return true;
}
@romgerman
romgerman / style.scss
Created March 27, 2019 09:00
A more clean look for Nexus Vortex Mod Manager
#main-window-pane {
background: none;
}
.btn-menu-minimize {
padding: 6px;
}
#main-nav-sidebar #main-nav-container>:not(:last-child) {
box-shadow: none;
@romgerman
romgerman / ValveKeyValue.cpp
Last active October 5, 2023 13:20
Simple Valve Key Values parser in C++
#include "ValveKeyValue.h"
using namespace Parsers;
#include <exception>
#include <cctype>
ValveKeyValue::Token ValveKeyValue::LexNext()
{
bool readingValue = false;
@romgerman
romgerman / ValveKeyValues.YAML-tmLanguage
Created November 13, 2017 11:34
Simple KeyValues highlighting for Sublime Text 3. Save to "Packages\User" folder, then open and press F7 to compile
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Valve Key Values
scopeName: text
fileTypes: []
uuid: c8ad0af6-a42c-4008-8737-36156bb81f61
patterns:
- name: comment
match: '\/\/.*'
@romgerman
romgerman / DarkFlat.qss
Last active September 14, 2017 14:24
Dark "Flat" theme for OBS based on Dark theme
/******************************************************************************/
/* Copyright (C) 2014-2015 by Philippe Groarke <[email protected]> */
/* */
/* */
/* 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 2 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */