Skip to content

Instantly share code, notes, and snippets.

View realkotob's full-sized avatar

Kotob realkotob

View GitHub Profile
@th0ma5w
th0ma5w / easing.py
Created March 31, 2014 01:32
Easing Equations in Python (orig by Robert Penner)
# ported from http://www.gizma.com/easing/
# by http://th0ma5w.github.io
#
# untested :P
import math
linearTween = lambda t, b, c, d : c*t/d + b
@rje
rje / SelectPrefabsOfType.cs
Last active November 29, 2024 02:58
Small unity utility to find all prefab objects that have a given component on them
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Reflection;
public class SelectPrefabsOfType : EditorWindow {
[MenuItem("Window/Prefab Finder")]
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active April 9, 2025 09:08
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
# Aliases
alias g='git'
#compdef g=git
alias gst='git status'
#compdef _git gst=git-status
alias gd='git diff'
#compdef _git gd=git-diff
alias gdc='git diff --cached'
@brunosxs
brunosxs / create_timer.gd
Last active April 22, 2022 20:02
Godot Quick Tips 01: The create_timer() helper for waiting X seconds
# Available only in the 2.2 legacy branch and posterior versions
func _ready():
# The old way:
print("HELLO") # Code before the yield
# Setting up the yield:
var t = Timer.new() # Create a new Timer node
t.set_wait_time(5.5) # Set the wait time
add_child(t) # Add it to the node tree as the direct child
@atomius0
atomius0 / PixelPerfectScaling.gd
Created March 12, 2018 16:29
Pixel-Perfect scaling script, ported to Godot 3.
# original code by CowThing: https://github.com/godotengine/godot/issues/6506
# port to Godot 3 and bugfixes by atomius.
# usage:
# set this script as AutoLoad (Singleton enabled)
#
# in the project settings:
# [display]
# set 'window/size/width' and 'window/size/height' to your desired render resolution.
# set 'window/size/test_width' and 'window/size/test_height' to the initial window size.
@Einlander
Einlander / scene_debug.gd
Last active February 3, 2021 20:04
A super useful script for fps games. Attach it to the root node in your scene. Provides an FPS counter, fullscreen toggle, exits the game, and reloads the scene.
# Simple Utility Script
# Traps Mouse Cursor and hides it.
# ESCAPE to quit game
# F5 to reload current scene
# F9 to toggle collision shape dispay. Scene MUST be reloaded
# F10 to toggle fps Display
# F11 to switch from windowed to fullscreen
# F12 to take screenshot
#
# Works great for fps games
extends RayCast2D
# If this is use to disable collisions
export(bool) var disable_collisions = false;
# What to set/remove collisions against
export(NodePath) var physics_path
var physics_object
func _ready():
shader_type spatial;
render_mode unshaded;
render_mode cull_disabled;
uniform float depth_distance = 1.0;
@NovemberDev
NovemberDev / godot_async_scene_loader.gd
Last active March 12, 2025 16:00
Asynchronously loads scenes in godot
# Loads a scene in the background using a seperate thread and a queue.
# Foreach new scene there will be an instance of ResourceInteractiveLoader
# that will raise an on_scene_loaded event once the scene has been loaded.
# Hooking the on_progress event will give you the current progress of any
# scene that is being processed in realtime. The loader also uses caching
# to avoid duplicate loading of scenes and it will prevent loading the
# same scene multiple times concurrently.
#
# Sample usage:
#