Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
public class Rotator : MonoBehaviour {
private Vector3 lastMousePosition = Vector3.zero;
private bool mousePressed;
private Vector3 rotation = Vector3.zero;
private GameObject target = null;
/Library/
/Temp/
*.sln
*.pidb
*.csproj
*.unityproj
*.userprefs
*.swp
*~
set nocompatible
set showcmd
filetype on
filetype plugin on
syntax enable
set autoindent
set expandtab
set smarttab
export PS1="\[\e[00;33m\]\t\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[00;32m\]\u@\[\e[0m\]\[\e[00;36m\]\h:\[\e[0m\]\[\e[00;35m\]\W\[\e[0m\]\[\e[00;31m\]\$\[\e[0m\]\[\e[00;37m\] \[\e[0m\]"
alias ls='ls -G'
export PATH=$PATH:/Applications/adt-bundle-mac-x86_64-20130917/sdk/platform-tools:/Applications/adt-bundle-mac-x86_64-20130917/sdk/tools:/Applications/apache-ant-1.9.2/bin
using UnityEngine;
using System.Collections;
using System.Linq;
using System;
public class TestLinq : MonoBehaviour {
void Start () {
float[] values = new float[3] { 3, 5, 1};
Debug.Log(values.Min());
import requests
import time
import threading
payload = {
'u_name': 'ken',
'email': 'kuanying@tradeserv.com',
'mobile': '0999000000',
'num1': '9999',
'o_num':'9999'
import requests
import time
count = 0
def write_file(text, path):
f = open(path, 'w+')
f.write(text.encode('utf8'))
f.close();
using UnityEngine;
using System.Collections;
public class Target : MonoBehaviour {
public void Awake() {
Debug.Log(this.GetType().Name + ".Awake() at frame " +
Time.frameCount);
}
public void Start() {
Debug.Log(this.GetType().Name + ".Start() at frame " +
using UnityEngine;
using System.Collections;
public class Main : MonoBehaviour {
private GameObject prefab;
public void Update() {
Debug.Log(Time.frameCount);
if(Time.frameCount == 5) {
Load();
using UnityEngine;
using System.Collections;
public class TestWait : MonoBehaviour {
private bool hasTouched = false;
public IEnumerator Start() {
Debug.Log("1");
yield return StartCoroutine(WaitForInput());
Debug.Log("2");