Skip to content

Instantly share code, notes, and snippets.

@mminer
mminer / Marquee.cs
Last active January 27, 2024 10:32
Simple Unity script to create a scrolling marquee.
using UnityEngine;
public class Marquee : MonoBehaviour
{
public string message = "Where we're going, we don't need roads.";
public float scrollSpeed = 50;
Rect messageRect;
void OnGUI ()
@darktable
darktable / MiniJSON.cs
Created November 30, 2011 23:08
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
{
"status": "success",
"search_nag": {},
"code": 0,
"bookmark": "b28xMDB8MDQ0NWZiOTBjNzNiODlkOTQ1ZTk3ZjY0ZTBhYjU0YjM0ZDYyNDg3NjU3ZWQ3OGJmZjI4ZTliZGRmODBlMzJlNQ==",
"debug_data": {
"query_data": {}
},
"message": "ok",
"data": [
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active January 25, 2025 15:00
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active March 20, 2025 20:23
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

diff -ruN snes9x-1.53-src.orig/macosx/mac-cart.mm snes9x-1.53-src/macosx/mac-cart.mm
--- snes9x-1.53-src.orig/macosx/mac-cart.mm 2011-04-24 22:38:10.000000000 +0900
+++ snes9x-1.53-src/macosx/mac-cart.mm 2014-12-06 15:06:35.000000000 +0900
@@ -214,7 +214,7 @@
FSRef ref;
Boolean reply;
char name[PATH_MAX + 1];
-#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT
+#if defined(MAC_LEOPARD_TIGER_PANTHER_SUPPORT) || defined(MAC_YOSEMITE_SUPPORT)
IBNibRef customNib;
@andyman
andyman / WebLocationChecker.cs
Created January 1, 2015 20:27
Simple script for Unity to check the domain that the web player is hosted on, and redirect it to the proper location if it is not in the list of domains. It does nothing if it is not a web player build.
using UnityEngine;
using System.Collections;
using System.Text;
/** Add this script to an object in the first scene of your game.
* It doesn't do anything for non-webplayer builds. For webplayer
* builds, it checks the domain to make sure it contains at least
* one of the strings, or it will redirect the page to the proper
* URL for the game.
*/
@thebeardphantom
thebeardphantom / .gitignore
Last active April 9, 2017 13:08
Unity GitIgnore
# Ignore everything
/*
/*/
# Inverse ignore some stuff
!/Assets/
!/ProjectSettings/
!.gitignore
# OS Stuff
@ronkorving
ronkorving / GetSystemLanguage.mm
Created January 28, 2015 07:20
Extracting iOS system language for Unity in Assets/Plugins/iOS/GetSystemLanguage.mm
#include "UnityAppController.h"
/*
* This Plug in will set a "systemLanguage" string key in PlayerPrefs with the system language code.
*/
@interface GetSystemLanguage : UnityAppController
@end
@implementation GetSystemLanguage