Skip to content

Instantly share code, notes, and snippets.

@sakim
sakim / gist:6989459
Created Oct 15, 2013
Unity3D: Load FBX prefab and create a gameobject from it.
View gist:6989459
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 Dec 21, 2015
Upstart script for uWSGI.
View uwsgi.conf
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 Jul 2, 2013
Unity3D: FramePerSecond for UILabel of NGUI
View HUDFPS.cs
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 Dec 17, 2015 — forked from troelskn/app.rb
Gollum wiki access control. Modifications require authentication.
View app.rb
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!