Skip to content

Instantly share code, notes, and snippets.

@belzecue
belzecue / MatchRectSize.gd
Created November 2, 2022 14:07 — forked from jasonwinterpixel/MatchRectSize.gd
Godot Match Rect Size
tool
extends Node
class_name MatchRectSize
onready var parent := get_parent() as Control
export(NodePath) var target_control
onready var target := get_node(target_control) as Control
export var match_x := true
export var match_y := true
extends Camera
"""
Space/Enter - capture cursor
Escape - free cursor
WASDQE - move
Shift - fast movement
Ctrl - slow movement
"""
@belzecue
belzecue / Camera.gd
Created October 24, 2022 12:15 — forked from Garmelon/Camera.gd
Godot perspecive projection shaders
extends TextureRect
export var sensitivity: Vector3 = Vector3(0.005, 0.005, TAU/4)
var euler: Vector3 = Vector3.ZERO
func _init() -> void:
sensitivity.x *= -1
func _input(event: InputEvent) -> void:
if event.is_action_pressed("ui_cancel"):
@belzecue
belzecue / screenshot.gd
Created October 7, 2022 13:09 — forked from GK-GreyGhost/screenshot.gd
Create a folder in the format year-month-day and save the screenshot
func screenshot():
var img = get_viewport().get_texture().get_data()
img.flip_y()
var dir:Directory = Directory.new()
var now = OS.get_date()
var folder:String = 'user://screenshots/%s-%s-%s' % [now.year,now.month,now.day]
dir.make_dir_recursive(folder)
img.save_png(folder+'/%d.png' % OS.get_unix_time())

Google Drive Sync Wine Scripting

This is a set of scripts that help running Google Drive Backup and Sync under Wine, with multiple Google accounts.

Each account is given its own Wine prefix (a separate wine configuration).

To install, run install-gdrive-sync google_account

List the accounts set up in ~/.config/gdrive-accounts

shader_type canvas_item;
uniform mat4 TRANSFORM;
uniform vec2 DEPTH;
uniform bool REPEAT_X;
uniform bool REPEAT_Y;
uniform bool FLIP;
void fragment() {
// Create the matrix. A workaround is used to modify the matrix's W column
@belzecue
belzecue / RandomWallpaper.cs
Created April 2, 2022 10:55 — forked from EricJ2190/RandomWallpaper.cs
Random Windows Wallpaper
/* Selects a random image from a folder and makes it the desktop wallpaper.
* usage: RandomWallpaper.exe [c:\path\to\wallpapers]
* If the path is omitted, the current directory is used.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
// Derived from Unity built-in shader source.
// https://raw.githubusercontent.com/chsxf/unity-built-in-shaders/0c7940740e75340009bbed453e2b198e294e4bab/Shaders/DefaultResourcesExtra/Skybox-Panoramic.shader
Shader "Skybox/Dual Panoramic" {
Properties{
_Tint1("Tint Color 1", Color) = (.5, .5, .5, .5)
_Tint2("Tint Color 2", Color) = (.5, .5, .5, .5)
[Gamma] _Exposure1("Exposure 1", Range(0, 8)) = 1.0
[Gamma] _Exposure2("Exposure 2", Range(0, 8)) = 1.0
_Rotation1("Rotation1", Range(0, 360)) = 0
@belzecue
belzecue / queue.gd
Created March 2, 2022 16:09 — forked from ViteFalcon/queue.gd
Thread-safe circular buffer queue
extends Node
var array
var size
var start = 0
var end = -1
var mutex = Mutex.new()
signal item_removed
@belzecue
belzecue / wordle.md
Created February 2, 2022 06:09 — forked from huytd/wordle.md
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode: