Skip to content

Instantly share code, notes, and snippets.

@Estecka
Estecka / painting-datagen.sh
Last active June 19, 2024 17:07
CLI script to automatically create a painting datapack from a texture pack.
#!/bin/bash
set -eu -o pipefail
IFS=''
if [[ $# -le 0 ]]
then
cat >&2 <<EOF
Generates a painting datapack for Minecraft 1.21, using an unzipped texturepack as source.
The paintings' asset_id will be derived from their variant ID, and all paintings will be added to the placeable tag.
@Estecka
Estecka / valgrind.sh
Created February 9, 2021 16:26
Valgrind for 42 projects.
#!/bin/bash
EXEC=./a.out # Put your executable's path here.
LOG=valgrind
valgrind \
--tool=memcheck \
--leak-check=full \
--leak-resolution=high \
--track-origins=yes \
@Estecka
Estecka / jscli.js
Last active October 20, 2020 07:38
Tiny Javascript Command Line Interface for NodeJS
console.log("Welcome, master");
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: true
});
rl.on('line', function(line){
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_memory.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abaur <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/08/04 17:01:03 by abaur #+# #+# */
/* Updated: 2019/08/07 10:25:44 by abaur ### ########.fr */
/* */
@Estecka
Estecka / rawstring.c
Created January 16, 2020 14:05
Converts the first few characters of a string into an int, for easier comparison.
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* .stringToInt.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abaur <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/16 14:15:40 by abaur #+# #+# */
/* Updated: 2020/01/16 14:25:04 by abaur ### ########.fr */
/* */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteAlways]
[RequireComponent(typeof(RectTransform))]
public class SubCanvasScaler : MonoBehaviour {
public enum ScalingMode {
Stretch,
MatchHeight,
@Estecka
Estecka / Typewriter.cs
Created June 28, 2019 10:19
Write/erase a text one caracter after another.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using TMPro;
public class Typewriter : MonoBehaviour {
static readonly string format = @"{0}<alpha=#00>{1}</color>{2}";
@Estecka
Estecka / DepthMask.shader
Last active June 27, 2019 12:59
An invisible shader that still masks everything behind it
Shader "Estecka/Depth Mask" {
SubShader {
Tags { "RenderType" = "Opaque" }
Blend Zero One
Pass{}
}
}
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
namespace Estecka.EsteckaEditor {
[CustomPropertyDrawer(typeof(TimeCodeAttribute))]
public class TimeCodeDrawer : PropertyDrawer{
@Estecka
Estecka / AngryCSVParser.cs
Last active September 2, 2020 14:28
AngryCSVparser.cs
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Estecka {
/// <summary>
/// A parser for those CSV with quoted newlines that tend to mess up other parsers.
/// </summary>
static public class AngryCSVParser {
static char escapeCharacter = '\\';