This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RED="\e[31m" | |
ENDCOLOR="\e[0m" | |
sudo -v | |
echo -e "${RED}Run auto clean${ENDCOLOR}" | |
sudo apt autoclean -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# R3tr0Boi 2023 | |
# Function to display usage information | |
function show_usage { | |
echo "Usage: $0 [-k] [-h]" | |
echo "Options:" | |
echo " -k Keep the container at the end (do not remove)" | |
echo " -h Display this help screen" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
pygame.init() | |
pygame.joystick.init() | |
joystick = pygame.joystick.Joystick(0) | |
joystick.init() | |
while True: | |
for event in pygame.event.get(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_EDITOR | |
using UnityEngine; | |
public class Multiline : MonoBehaviour { | |
[Multiline(50)] public string notes; | |
} | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Allows you to turn off auto recompile and gives you the option to compile on demand and, if wanted, enters play mode | |
using UnityEditor; | |
using UnityEditor.Compilation; | |
using UnityEngine; | |
namespace Editor { | |
public class CompilationWindow : EditorWindow { | |
private static bool autoRefresh; | |
private bool enterPlaymode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
using UnityEngine.UI; | |
namespace Tools { | |
/// <summary> | |
/// Easy animator for simple sprite animations | |
/// Theres also a editor integration, you can find here: https://gist.github.com/R3tr0BoiDX/1607500b036531e17dadaa7e6255818d | |
/// </summary> | |
public class SimpleAnimator : MonoBehaviour { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_EDITOR | |
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.UI; | |
namespace Tools { | |
[CustomEditor(typeof(SimpleAnimator))] //find here: https://gist.github.com/R3tr0BoiDX/d84e91a03d020f2169d92446f1ffb857 | |
public sealed class SimpleAnimatorEditor : Editor { | |
private SimpleAnimator anim; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
namespace Tools { | |
/// <summary> | |
/// Addendum to krockot's original task manager - https://github.com/krockot/Unity-TaskManager | |
/// Added possibility to pool a bunch of tasks together, so they can be started, stopped,... together | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: | |
description: 'Synchronize the on/off state of 2 entities' | |
domain: automation | |
input: | |
entity_1: | |
name: First entity | |
selector: | |
entity: | |
entity_2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float fract(float x) { return x - (int) x; } | |
float mix(float a, float b, float t) { return a + (b - a) * t; } | |
float step(float e, float x) { return x < e ? 0.0f : 1.0f; } | |
float constrain(float x, float low, float high) { return ((x) < (low) ? (low) : ((x) > (high) ? (high) : (x))); } | |
float min(float a, float b) { return (a > b) ? b : a; } |
NewerOlder