Skip to content

Instantly share code, notes, and snippets.

View Fep310's full-sized avatar
🏠
Working from home

Felipe Fep310

🏠
Working from home
  • Brazil
  • 10:16 (UTC -03:00)
  • X @fep310
View GitHub Profile
@adammyhre
adammyhre / MainToolbarButtons.cs
Created December 28, 2025 13:08
Unity 6.3 Custom Main Toolbar
using UnityEditor;
using UnityEditor.Toolbars;
using UnityEngine;
using UnityEngine.UIElements;
public class MainToolbarButtons {
[MainToolbarElement("Project/Open Project Settings", defaultDockPosition = MainToolbarDockPosition.Middle)]
public static MainToolbarElement ProjectSettingsButton() {
var icon = EditorGUIUtility.IconContent("SettingsIcon").image as Texture2D;
var content = new MainToolbarContent(icon);
@d7samurai
d7samurai / .readme.md
Last active January 27, 2026 19:11
Minimal D3D11 bonus material: fullscreen triangle

Minimal D3D11 bonus material: fullscreen triangle

image

Basic setup for rendering a fullscreen triangle - as opposed to a fullscreen quad. This is a triangle that extends past the screen boundaries so that it covers it all, with the excess getting clipped away. The use case for this is typically doing a full screen pass for composition or post processing effects etc (though nowadays you might go for a compute shader instead).

Generally a triangle is preferred over a quad because the geometry is simpler (fewer vertices / shader invocations) and it eliminates the quad’s internal diagonal split. Since pixel shading runs in 2×2 pixel units (incidentally also referred to as "quads"), units that straddle the diagonal will do redundant work on pixels that gets masked out and discarded; both triangles pay this cost along the split, each discarding work tha

@adammyhre
adammyhre / InspectorLock.cs
Last active January 14, 2026 04:33
Lock Inspector Icon and Transform Constrain Proportion Icon in Unity
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Toggles the Inspector lock state and the Constrain Proportions lock state.
/// </summary>
public static class LockInspector {
static readonly MethodInfo flipLocked;
static readonly PropertyInfo constrainProportions;
@Redoishi
Redoishi / AMyCommand.java
Last active July 21, 2022 19:22
Create a minecraft command without plugin.yml
package your.package;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.*;
import org.bukkit.plugin.java.JavaPlugin;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;