Skip to content

Instantly share code, notes, and snippets.

Avatar

Shane Celis shanecelis

View GitHub Profile
@shanecelis
shanecelis / PriorityPhysicsRaycaster.cs
Last active Jul 5, 2019
Prioritized raycaster for casting against 3D Physics components. https://twitter.com/shanecelis/status/1146822575978373120
View PriorityPhysicsRaycaster.cs
/* Original code[1] Copyright (c) 2019 Shane Celis[2]
Licensed under the MIT License[3]
This comment generated by code-cite[4].
[1]: https://gist.github.com/shanecelis/5379ed7c634222dc979e09e728ef0a6c
[2]: https://github.com/shanecelis
[3]: https://opensource.org/licenses/MIT
[4]: https://github.com/shanecelis/code-cite
*/
@shanecelis
shanecelis / Renamer.cs
Last active Jun 10, 2019
Unity utility to rename game objects for use as headers in the scene hierarchy.
View Renamer.cs
/* Original code[1] Copyright (c) 2019 Shane Celis[2]
Licensed under the MIT License[3]
[1]: https://gist.github.com/shanecelis/557b30f46b534a80047b9f2969a94c6e
[2]: https://github.com/shanecelis
[3]: https://opensource.org/licenses/MIT
*/
using UnityEngine;
using UnityEditor;
@shanecelis
shanecelis / MyPhysicsRaycaster.cs
Last active Jun 5, 2019
A fix for Unity's PhysicsRaycaster that would throw NullReferenceExceptions when Max Ray Intersections is not zero.
View MyPhysicsRaycaster.cs
// https://bitbucket.org/Unity-Technologies/ui/raw/9f418c4767c47d0c71f1727eb42a9a9024e9ecc0/UnityEngine.UI/EventSystem/Raycasters/PhysicsRaycaster.cs
using UnityEngine.UI;
using System;
using System.Collections.Generic;
using System.Reflection;
namespace UnityEngine.EventSystems
{
/// <summary>
/// Simple event system using physics raycasts.
@shanecelis
shanecelis / PreviewGUIEditor.cs
Last active May 7, 2019
Show the `ToString()` of a MonoBehavior in the preview GUI. https://twitter.com/shanecelis/status/1123263828983201794
View PreviewGUIEditor.cs
/* Original code[1] Copyright (c) 2019 Shane Celis[2]
Licensed under the MIT License[3]
This comment generated by code-cite[4].
[1]: https://gist.github.com/shanecelis/b012b573139ae83d40d93f6b402ab492
[2]: https://github.com/shanecelis
[3]: https://opensource.org/licenses/MIT
[4]: https://github.com/shanecelis/code-cite
*/
@shanecelis
shanecelis / StackBag.cs
Created Mar 20, 2019
A heterogeneously typed stack that preserves O(1) for Push<T>(T o) and Pop<T>() and maintains order for Push(object o) and Pop().
View StackBag.cs
/* Original code Copyright (c) 2019 Shane Celis[1]
Licensed under the MIT License[2]
Original code posted here[3].
This comment generated by code-cite[4].
[1]: https://github.com/shanecelis
[2]: https://opensource.org/licenses/MIT
[3]: https://github.com/shanecelis/push-forth-dotnet/
@shanecelis
shanecelis / SecretSanta.cs
Last active Nov 22, 2018
Solves a SecretSanta constraint problem using CatSAT; works in Unity because I'm lazy.
View SecretSanta.cs
/* Original code Copyright (c) 2018 Shane Celis[1]
Licensed under the MIT License[2]
Original code posted here[3].
This comment generated by code-cite[4].
[1]: https://twitter.com/shanecelis
[2]: https://opensource.org/licenses/MIT
[3]: https://gist.github.com/shanecelis/b88808f5198832dd5f3dd2015017f0ec
@shanecelis
shanecelis / toothless-ransomware.txt
Created Oct 28, 2018
Toothless ransomware I got with the subject line: "$email password is $password"
View toothless-ransomware.txt
Below is a scary spam message I got. Luckily, I use an email forwarding service,
so I knew it was for a comically old account. However, the password was accurate
at the time. The email states that they have my password and have compromised
not only it but my computer as well and that they have a Black Mirror-esque
image of me that they will release unless I pay a Bitcoin ransom. It is
bullshit, but it still made my heart race to read it.
I'm posting this here so that others can search and find it. These people have a
list of emails and passwords and are trying to somehow scare you into giving
them money. It's a different kind of ransomware, but this one has no teeth. It
@shanecelis
shanecelis / ReservoirSampler.cs
Created Oct 26, 2018
Keep a fixed-size sample of some stream of inputs. Each item has a uniform probability of being kept.
View ReservoirSampler.cs
/* Original code Copyright (c) 2018 Shane Celis[1]
Licensed under the MIT License[2]
[1]: https://twitter.com/shanecelis
[2]: https://opensource.org/licenses/MIT
*/
using System;
using System.Collections.Generic;
/**
@shanecelis
shanecelis / lucerna-relay.cpp
Created Sep 21, 2018
A Magic Maker example project
View lucerna-relay.cpp
/*
Copyright (c) 2018 Seawisp Hunter, LLC
Licensed under the MIT license.
*/
/*
Lucerna Relay
A Magic Maker[1] example project
View NumericalMethods.cs
/* Original code Copyright (c) 2018 Shane Celis[1]
Licensed under the MIT License[2]
Original code posted here[3].
This comment generated by code-cite[4].
[1]: https://github.com/shanecelis
[2]: https://opensource.org/licenses/MIT
[3]: https://gist.github.com/shanecelis/976f901fab5eebd3d68b479181999f01
You can’t perform that action at this time.