Skip to content

Instantly share code, notes, and snippets.

View neogeek's full-sized avatar
👋
Open for work.

Scott Doxey neogeek

👋
Open for work.
View GitHub Profile
const scaleLinear = (domain, range, value) => {
const sortedRange = range.slice().sort();
return Math.min(Math.max(range[0] + ((range[1] - range[0]) / 100) * ((value - domain[0]) / (domain[1] - domain[0]) * 100), sortedRange[0]), sortedRange[1]);
};
@neogeek
neogeek / README.md
Created April 28, 2017 01:51
Convert Image for Use with Vuforia

Convert Image for Use with Vuforia

$ convert image.png -depth 4 -colorspace gray -define png:color-type=0 -define png:bit-depth=8 image-target.png
using UnityEngine;
using System.Collections;
public static class CustomExtensions
{
public static void EditKeyframeValue(this AnimationCurve animationCurve, int key, float value)
{
Keyframe[] keys = animationCurve.keys;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.XR.iOS;
public class ARKitObjectController : MonoBehaviour
{
#if UNITY_EDITOR
using System.IO;
using UnityEditor;
public class CreateAssetBundles
{
[MenuItem("Assets/Build AssetBundles")]
static void BuildAllAssetBundles()
{
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
public class LoadSceneFromAssetBundle : MonoBehaviour
{
[SerializeField]
private string assetBundleUrl;
[].slice.call(document.querySelectorAll('#files .file.open'))
.filter(elem => elem.querySelectorAll('.hidden-diff-reason, .data.empty').length == 1)
.map(elem => elem.parentNode.removeChild(elem));
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!13 &1
InputManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Axes:
- serializedVersion: 3
m_Name: Oculus_CrossPlatform_PrimaryIndexTrigger
descriptiveName:
# Setup Unity Project with .gitignore
setupunity() {
git init
curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/Unity.gitignore
git add .
git commit -m "Initial commit."
}
using System.Linq;
using UnityEditor;
using UnityEngine;
public static class Unity2DComponents
{
[MenuItem("GameObject/2D Object/Box", false, 0)]
private static void Create2DCube()
{