Skip to content

Instantly share code, notes, and snippets.

View crappygraphix's full-sized avatar
📦
💩

Chris Johnston crappygraphix

📦
💩
View GitHub Profile
@crappygraphix
crappygraphix / example.hs
Last active April 24, 2019 17:58
Instance of Show causing infinite loops
-- Potential infinite loop
instance Show VersionStatus where
show PrivatePreview = "Private Preview"
show PublicPreview = "Public Preview"
show x = show x
-- Not an infinite loop
instance Show VersionStatus where

Keybase proof

I hereby claim:

  • I am crappygraphix on github.
  • I am crappygraphix (https://keybase.io/crappygraphix) on keybase.
  • I have a public key ASCYX0RzCWuxQPExttNpJ-4b5fdhgKRlaDhncYIHNfJbNQo

To claim this, I am signing this object:

@crappygraphix
crappygraphix / ListenToInput.cs
Created October 12, 2016 02:52
Naive way to track swipes and taps. Just attach to a UI Element.
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
public enum MovementAction{
None,
Tap,
SwipeLeft,
SwipeRight,
SwipeUp,
@crappygraphix
crappygraphix / PrefabTransformCopy.cs
Last active September 24, 2016 13:23
Copy prefab instance's transform to the root prefab asset and vice versa.
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
public class PrefabTransformCopy : ScriptableObject {
/*
* Select an instance of a prefab in scene view.
* Click the gear in the transform panel of the inspector.
* Selecting "Write to Prefab" will write the transformation
* values from this scene object into the parent prefab.
@crappygraphix
crappygraphix / main_test
Last active August 29, 2015 14:04
Main() function in Unity3d C# Script
using UnityEngine;
using System.Collections;
public class SillyTest : MonoBehaviour {
void Main(){
Debug.Log("Main: Interesting");
}
void OnEnable(){