Skip to content

Instantly share code, notes, and snippets.

@GarethJones
GarethJones / MiniJson.cs
Created January 12, 2012 17:32
MiniJson Flash Unity version
// using UnityEngine;
using System;
using System.Collections;
using System.Text;
/* Based on the JSON parser from
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* I simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
@brysgo
brysgo / ndb_json.py
Created January 6, 2012 21:47
(THIS IS REALLY OLD AND OUTDATED) A port of the app engine json serializer for NDB.
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@AngryAnt
AngryAnt / SurveillanceCameraController.cs
Created December 18, 2011 14:09
An example of a four-split camera setup where one camera can be brought to front. UNTESTED.
using UnityEngine;
using System.Collections;
enum CameraIdentity
{
None,
One,
Two,
Three,
@jstanden
jstanden / gist:1489447
Last active May 15, 2024 20:47
Simplex Noise in C# for Unity3D - Adapted from James Livingston's MinePackage: http://forum.unity3d.com/threads/minepackage-minecraft-starter-package.69573/
using UnityEngine;
using System.Collections;
public class SimplexNoiseGenerator {
private int[] A = new int[3];
private float s, u, v, w;
private int i, j, k;
private float onethird = 0.333333333f;
private float onesixth = 0.166666667f;
private int[] T;
@JosephLaurino
JosephLaurino / OBJ.cs
Created December 5, 2011 19:47
obj file loader for Unity3D
// this code is from http://www.everyday3d.com/blog/index.php/2010/05/24/loading-3d-models-runtime-unity3d/
// which was released under the MIT license
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
public class OBJ : MonoBehaviour {
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@azeitler
azeitler / ColoredMaterialCache.cs
Created November 23, 2011 17:57
Colored Material Cache
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// manages instances of the same material with random colors
/// if a Material+Color combination does not yet exist it will be created
/// if the combination has been created before it will be returned from the cached
/// </summary>
public static class ColoredMaterialCache {
@azeitler
azeitler / CodeUtil.Unity.cs
Created November 13, 2011 02:14
C# Method Generation for Deep-Copy of any Class
using UnityEngine;
using UnityEditor;
public static class CodeUtilUnity {
[MenuItem("Tools/Test: CreateCopyMethod (Transform)")]
public static void TestCreateCopyMethod () {
Debug.Log (CreateCopyMethod (typeof(Transform), true));
}
}
@pamelafox
pamelafox / email_logger.py
Created September 15, 2011 17:52
Email Logging for App Engine
#!/usr/bin/env python
#
# based on XMPPLoggingHandler, Copyright 2011 Calvin Rien,
# based on ExceptionRecordHandler, Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@mumoshu
mumoshu / Unity+WebSocket.cs
Created August 31, 2011 16:13
Unity+WebSocket.cs
using UnityEngine;
using System.Collections;
using SuperWebSocket.Client;
using System;
public class Net : MonoBehaviour {
private string lastMessage = string.Empty;
public static string serverURI = "ws://192.168.100.196:12345/channels/0?userId=1";
public static WebSocket webSocket = new WebSocket(serverURI, "basic");