Skip to content

Instantly share code, notes, and snippets.

@sakim
sakim / gist:6989459
Created October 15, 2013 10:12
Unity3D: Load FBX prefab and create a gameobject from it.
Object prefab = Resources.Load("Prefabs/prefab1"); // Assets/Resources/Prefabs/prefab1.FBX
GameObject t = (GameObject) Instantiate(prefab, new Vector3(0, 0, 0), Quaternion.identity);
@sakim
sakim / uwsgi.conf
Last active December 21, 2015 12:09
Upstart script for uWSGI.
description "uwsgi instance"
start on (filesystem and net-device-up IFACE=lo) or runlevel [2345]
stop on runlevel [06]
respawn
umask 022
env LC_ALL=en_US.UTF-8
env LANG=en_US.UTF-8
@sakim
sakim / HUDFPS.cs
Created July 2, 2013 10:02
Unity3D: FramePerSecond for UILabel of NGUI
using UnityEngine;
using System.Collections;
public class HUDFPS : MonoBehaviour {
// Attach this to a UILabel to make a frames/second indicator.
//
// It calculates frames/second over each updateInterval,
// so the display does not keep changing wildly.
//
@sakim
sakim / app.rb
Last active December 17, 2015 08:39 — forked from troelskn/app.rb
Gollum wiki access control. Modifications require authentication.
require 'gollum/app'
require 'digest/sha1'
class App < Precious::App
User = Struct.new(:name, :email, :password_hash)
before /^\/(edit|create|delete|livepreview|revert)/ do authenticate! ; end
helpers do
def authenticate!