Skip to content

Instantly share code, notes, and snippets.

View tatelax's full-sized avatar

Tate McCormick tatelax

View GitHub Profile
@tatelax
tatelax / convex-cast.js
Created July 18, 2025 21:17
PlayCanvas Convex Cast 2.0
/**
* Convex Cast
* https://forum.playcanvas.com/t/playcanvas-physics-extension/13737
*
* Change log:
*
* 2.0 - Move initialization to first use instead of at parse time to
* support latest version of Ammo and PlayCanvas. Fixed bug where rotation
* was being set on wrong transform.
*
@tatelax
tatelax / gist:287d10935bc34693228426a65552945d
Created June 28, 2025 03:44
fxtwitter share button for X
// ==UserScript==
// @name fxtwitter Share Button for X (Styled + Snackbar + Hover)
// @namespace http://tampermonkey.net/
// @version 2.0
// @description Adds a compact 'fxtwitter' button next to Share on X tweets with hover effect and clipboard notification. Clean layout, Safari-safe.
// @author You
// @match https://twitter.com/*
// @match https://x.com/*
// @grant none
// @run-at document-idle
@tatelax
tatelax / firebase-scheduled-functions-emulator.js
Last active May 22, 2025 01:48
Emulate Firebase Functions
// Provide database URL and database name where specified
// Provide file location for your function
const express = require("express");
const admin = require("firebase-admin");
const functions = require("firebase-functions/v2");
const cron = require("node-cron");
const app = express();
@tatelax
tatelax / depthbutton.swift
Created December 3, 2024 23:19
SwiftUIDepthButton
import SwiftUI
struct DepthButton: View {
var body: some View {
GeometryReader { geometry in
let size = min(geometry.size.width, geometry.size.height)
VStack {
ZStack {
// Outer circle
// check for 'real' null
if (ReferenceEquals(obj, null)) {
}
// check for 'real' not-null
if (ReferenceEquals(obj, null) == false) {
}
// check for 'unity' null
if (obj == false) {
@tatelax
tatelax / BuildCLI.cs
Created October 13, 2021 02:11
Build CLI
namespace Scripts.Utils.BuildMaker.Editor
{
public static class BuildCLI
{
// Called via editor in batchmode command line arguments
public static void Build()
{
string[] args = System.Environment.GetCommandLineArgs();
string buildProfile = null;
@tatelax
tatelax / example.jenkinsfile
Created October 12, 2021 16:20
A basic Jenkinsfile for Unity projects
pipeline {
agent {
node {
label 'windows'
}
}
environment {
VERSION = readFile(file: "game/Assets/StreamingAssets/version.txt").trim()
}
stages {
@tatelax
tatelax / Option.cs
Last active September 22, 2021 17:43
fholm's Option<T>
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public struct Option<T> : IEquatable<Option<T>> {
T _value;
bool _hasValue;
public T Value {
[MethodImpl(MethodImplOptions.AggressiveInlining)]