Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Coding Magic

Kristen ikriz

👨‍💻
Coding Magic
View GitHub Profile
@ikriz
ikriz / MyStateMachine.cs
Created Oct 24, 2011 — forked from AngryAnt/MyStateMachine.cs
A simple state machine using a dictionary of delegates indexed by an enum.
View MyStateMachine.cs
using UnityEngine;
using System.Collections.Generic;
public class MyStateMachine : MonoBehaviour
{
public delegate void StateHandlerDelegate ();
public enum MyStateType
@ikriz
ikriz / ComponentLib_Thermistor2.pde
Created Nov 29, 2011 — forked from 100ideas/ComponentLib_Thermistor2.pde
Mystery Thermistor A B C coefficients (Steinhart-hart model)
View ComponentLib_Thermistor2.pde
/*
* http://arduino.cc/playground/ComponentLib/Thermistor2
*
* Inputs ADC Value from Thermistor and outputs Temperature in Celsius
* requires: include <math.h>
* Utilizes the Steinhart-Hart Thermistor Equation:
* Temperature in Kelvin = 1 / {A + B[ln(R)] + C[ln(R)]3}
* where A = 0.001129148, B = 0.000234125 and C = 8.76741E-08
*
* These coefficients seem to work fairly universally, which is a bit of a
@ikriz
ikriz / gist:8952257
Last active Aug 29, 2015
Method to Split YUV Planes
View gist:8952257
void SplitYUVPlanes(int width, int height, unsigned char *data, int size, unsigned char *yuvInput[3])
{
// live input *data is YUV444 Packed
// Conversion from 444 Packed -> 444 Planar
int index = 0;
int srcStride = size;
// need to flip image from bottom-up to top-down
int revheight = height - 1;
@ikriz
ikriz / Webcam.cs
Last active Jan 24, 2019
Webcam Script to display Webcam Textures [http://www.ikriz.nl/2011/12/23/unity-video-remake/]
View Webcam.cs
using UnityEngine;
public class Webcam : MonoBehaviour
{
public MeshRenderer[] UseWebcamTexture;
private WebCamTexture webcamTexture;
void Start()
{
View PostBuildTrigger.cs
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
public static class PostBuildTrigger
{
private static DirectoryInfo targetdir;
private static string buildname;
private static string buildDataDir;
View UnityDiffuseLightmap.shader
Shader "Diffuse Lightmap" {
Properties {
_MainTex ("Texture 1", 2D) = "white" {}
}
SubShader {
Tags { "RenderType" = "Opaque" }
Pass {
@ikriz
ikriz / EnumFlagAttribute.cs
Last active Feb 24, 2017 — forked from ChemiKhazi/EnumFlagAttribute.cs
Unity3d property drawer for automatically making enums flags into mask fields in the inspector.
View EnumFlagAttribute.cs
using UnityEngine;
public class EnumFlagAttribute : PropertyAttribute
{
public string enumName;
public EnumFlagAttribute() {}
public EnumFlagAttribute(string name)
{
@ikriz
ikriz / EnableMacros.cs
Last active Aug 29, 2015
Unity 4.x Editor Macro's
View EnableMacros.cs
using UnityEditor;
using UnityEditorInternal;
public class EnableMacros : Editor {
[MenuItem ("Window/Macros")]
static void Init () {
MacroWindow win = (MacroWindow)EditorWindow.CreateInstance<MacroWindow>();
win.Show();
}
}
@ikriz
ikriz / keybase.md
Created Jun 30, 2017
Keybase Verification
View keybase.md

Keybase proof

I hereby claim:

  • I am ikriz on github.
  • I am ikriz (https://keybase.io/ikriz) on keybase.
  • I have a public key ASD-KA1MidhC1bkpW8qeINNLO8wPLsdW2gBfLcVAvOz80Qo

To claim this, I am signing this object:

View gist:332f51acdffd99d3a4775b025eda0033
# NMEA to GPX converter
# Peter Pearson
# version 0.11
import csv
import sys
import time
from time import strftime
def convert_dms_to_dec(value, dir):