Skip to content

Instantly share code, notes, and snippets.

@ChevyRay
ChevyRay / qoi.rs
Created November 24, 2021 22:49
QOI - Quote OK Image Format (Rust Port)
const INDEX: u8 = 0x0;
const RUN_8: u8 = 0x40;
const RUN_16: u8 = 0x60;
const DIFF_8: u8 = 0x80;
const DIFF_16: u8 = 0xc0;
const DIFF_24: u8 = 0xe0;
const COLOR: u8 = 0xf0;
const MASK_2: u8 = 0xc0;
const MASK_3: u8 = 0xe0;
@randompherret
randompherret / quantity_unit.php
Last active September 21, 2024 03:24
Script to import conversion factors into grocy
<?php
$apiaccess =[
"url" => "https://grocy.yourdomain.tld/api",
"key" => "1234password"
];
$quantity_units = [
"Cup" => [
"name" => "Cup",
"description" => "",
"name_plural" => "Cups"
@17cupsofcoffee
17cupsofcoffee / main.rs
Created September 6, 2020 19:10
Simple crash logging in Tetra
fn run() -> tetra::Result {
ContextBuilder::new("My Game", 1280, 720)
.build()?
.run(GameState::new)
}
fn report_crash(err: TetraError) {
let mut crash_log = File::create("./crash_log.txt").unwrap();
write!(
pub struct VecGrid<T> {
data: Vec<T>,
width: usize,
height: usize,
}
impl<T> VecGrid<T> {
pub fn new(width: usize, height: usize) -> VecGrid<T> {
VecGrid {
data: Vec::with_capacity(width * height),
shader_type spatial;
uniform vec4 tint : hint_color = vec4(1, 1, 1, 1);
uniform float specularity = 0;
uniform float metallic = 0;
uniform float roughness = 0;
uniform vec4 transmission : hint_color;
uniform sampler2D texture_1 : hint_albedo;
uniform float tex_1_opacity = 1;
uniform float tex_1_hue = 1;
@brunosxs
brunosxs / savenload.gd
Last active July 9, 2020 22:30
Godot Quick Tips 02: Simple save and load methods for godot engine with dir and file handling
# Created by BrunoSXS
# LICENSED UNDER MIT
var save_slot = 0 # Just like classic JRPs, change the slot to save in a different place
var current_save_game # This is the contents of the save file, for now we just declare it
var default_save = {"money":0,"powers":null} # The default save contents, if there is no save file to load, then, the current_save_game gets its contents from this variable and then creates a save file with it
func _ready():
current_save_game = load_game(save_slot) if typeof(load_game(save_slot)) == TYPE_DICTIONARY else default_save # This is the first loading, when the game starts.
@Calinou
Calinou / build_javascript.bat
Last active July 8, 2023 23:22
Compile Godot for HTML5 easily (from Windows)
:: This script must be run from a Windows system with the Emscripten SDK
:: installed and configured. 7-Zip and MinGW also need to be installed.
:: Place this script at the root of your Godot Git clone.
:: CC0 1.0 Universal
set threads=%NUMBER_OF_PROCESSORS%
:: Set MinGW path
set PATH=%PROGRAMFILES%\mingw-w64\x86_64-6.2.0-posix-seh-rt_v5-rev0\mingw64\bin\;%PATH%
@sheepandshepherd
sheepandshepherd / rangeIterator.gd
Created February 19, 2016 00:18
Example of a custom iterator in GDScript
class RangeIterator:
var current
var end
var change
func stop():
if change > 0:
return current >= end
else:
return current <= end
@lukas-h
lukas-h / license-badges.md
Last active April 20, 2025 12:09
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)