Skip to content

Instantly share code, notes, and snippets.

@prime31
prime31 / curry-potjiekos.recipe
Created August 28, 2015 18:44
MEAT Curry Potjiekos recipe
INSERT-MEAT-TYPE-HERE Curry Potjiekos
Ingredients
2 lb INSERT-MEAT-TYPE-HERE
2 T oil
1 onions, chopped
3 - 6 cloves garlic, crushed
2 - 3 inches ginger, crushed
@prime31
prime31 / Sriracha Sauce
Created February 9, 2014 02:19
Sriracha Sauce recipe
Ingredients:
- 1.5 lbs of hot peppers. Mix and match whatever you want: jalepenos, anaheims, haberneros, etc. If you can get at least 0.5 lb ripened red I recommend doing so but if you cant all green peppers works as well. If you don't want it too hot don't add all the seeds.
- 8 T honey (preferably local, raw honey. If you don't really worry about what you eat you can use suger/brown sugar)
- 6 cloves of garlic
- 3 t salt
- 1/2 cup vinegar (preferably raw Apple Cider vineger. If you don't really worry about what you eat you can use white vinegar)
void Awake()
{
var chinese = "我是一个中国人的一句";
Debug.Log( "chinese: " + chinese );
}
@prime31
prime31 / Loading turn-based matches comparison
Last active August 29, 2015 13:58
One example (of many, many examples) that shows the difference in API design between Apple and Google. This example shows the code required to load a list of turn based matches.
// Apple API for loading all your turn-based matches
[GKTurnBasedMatch loadMatchesWithCompletionHandler:^( NSArray *matches, NSError *error )
{
// there is either an error or a result. nice and simple.
if( error )
log( "print a useful error: " + error );
else
log( "the matches are here: " + matches );
}];
@prime31
prime31 / AndroidManifest.xml
Created October 13, 2014 19:27
AndroidManifest.xml example for testing Twitter changes
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
@prime31
prime31 / TransitionKit demo scene code
Created November 8, 2014 01:05
TransitionKit demo scene code. The basic idea is that the transitionWithDelegate method takes in an object that handles the transitions. This can be a standard class or a MonoBehaviour subclass (so that you can modify properties in the inspector) as in the third button. Transitions can change scenes if they want to or just obscure the current sc…
void OnGUI()
{
if( GUILayout.Button( "Fade to Scene" ) )
{
var scene = Application.loadedLevel == 0 ? 1 : 0;
TransitionKit.transitionWithDelegate( new FadeTransition( Color.black, 0.5f, 0.2f, scene ) );
}
if( GUILayout.Button( "Pixelate to Scene with Random Scale Effect" ) )
@prime31
prime31 / USPS sucks the big one.markdown
Last active August 29, 2015 14:13
Avoid USPS at all costs. They will do anything and everything to not pay an insurance claim even when their own records show that they did not deliver the package.

Me: sent package with insurance and delivery confirmation to zipcode AAAAAA

USPS: delivered package to zipcode BBBBBB to a different person than was on the shipping label

Me: filed a claim with USPS in an attempt to get the package retrieved and sent to the person it was addressed to

USPS: closed the claim saying the package was "delivered"

Me: appealed the claim detailing that the package was indeed delivered but TO THE WRONG ADDRESS

@prime31
prime31 / gist:2ee96f1473f425302ab7
Created January 29, 2015 19:01
Unity 5 changes the pause parameter from bool to int so the UnityPause declaration must be changed to account for this. The below declaration covers both Unity 4 and 5.
#if UNITY_VERSION < 500
void UnityPause( bool pause );
#else
void UnityPause( int pause );
#endif
@prime31
prime31 / WhitsMenuItem.cs
Created February 6, 2015 06:06
MenuItem example
public class WhitsMenuItem : MonoBehaviour
{
[UnityEditor.MenuItem( "Whits Menu/Create ScriptableObject...", false, 10 )]
static void blahBlah()
{
// right here create your ScriptableObject
}
}
@prime31
prime31 / ZestyTweenExample.cs
Last active August 29, 2015 14:19
Example showing how the core of ZestKit can be used completely outside of the tween library. It can be used to animate anything any way you want in just a few lines of code. The core Zest methods are all available external to the library.
IEnumerator doMoveTween( Vector3 from, Vector3 to, float duration, EaseType easeType )
{
var elapsedTime = 0f;
while( elapsedTime < duration )
{
// either an ease function or an animation curve can be used here
transform.position = Zest.ease( easeType, from, to, elapsedTime, duration );
elapsedTime += Time.deltaTime;
yield return null;