Skip to content

Instantly share code, notes, and snippets.

@lite
lite / gist:2785956
Created May 25, 2012 05:26 — forked from vshvedov/gist:1370650
Sublime Text Edit 2 for Debian (from PPA)
wget http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt
sudo mv add-apt-repository.sh.txt /usr/sbin/add-apt-repository
sudo chmod o+x /usr/sbin/add-apt-repository
sudo chown root:root /usr/sbin/add-apt-repository
sudo add-apt-repository ppa:webupd8team/sublime-text-2
@lite
lite / gist:2978973
Created June 23, 2012 16:45
Apple Push Notification Service
#!/usr/bin/env python
'''
Sample code for Apple Push Notification Service in Python
Author: Jacky Tsoi <jacky@tsoi.me>
Date: December 15, 2011
'''
import ssl
import json
@lite
lite / OpenQQShell.py
Created November 14, 2012 01:59
openqq login
#!/usr/bin/env python
# coding=utf-8
import sys
import pexpect
class OpenQQShell:
def __init__(self, app_user, jumper_ip, jumper_port, token, passwd, cvm_ip):
self.p = self.get_shell(app_user, jumper_ip, jumper_port, token, passwd, cvm_ip)
@lite
lite / CodeProfiler.cs
Created November 14, 2012 02:13 — forked from darktable/CodeProfiler.cs
Unity3D: Tweaked version of @robotduck's CodeProfiler script.
// You can switch to a regular Update() loop
// if you comment out this line. (makes debugging easier)
#define COROUTINE
//
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using UnityEngine;
using Debug = UnityEngine.Debug;
@lite
lite / DebugConsole.cs
Created November 14, 2012 02:15 — forked from darktable/DebugConsole.cs
Unity3D: Heavily modified version of Jeremy Hollingsworth's DebugConsole script.
#define DEBUG_CONSOLE
#define DEBUG_LEVEL_LOG
#define DEBUG_LEVEL_WARN
#define DEBUG_LEVEL_ERROR
#if (UNITY_EDITOR || DEVELOPMENT_BUILD)
#define DEBUG
#endif
#if (UNITY_IOS || UNITY_ANDROID)
{"frames": {
{% for sprite in spritesAndAliases %}
"{{ sprite.name }}":
{
"frame": {"x":{{ sprite.textureRectX }},"y":{{ sprite.textureRectY }},"w":{{ sprite.textureRectWidth }},"h":{{ sprite.textureRectHeight }}},
"rotated": {% if sprite.isRotated %}true{% else %}false{% /if %},
"trimmed": {% if sprite.isTrimmed %}true{% else %}false{% /if %},
"spriteSourceSize": {"x":0,"y":0,"w":{{ sprite.sourceSizeWidth }},"h":{{ sprite.sourceSizeHeight }}},
"sourceSize": {"w":{{ sprite.sourceSizeWidth }},"h":{{ sprite.sourceSizeHeight }}},
"spriteColorRect": {"x":{{ sprite.sourceColorRectX }},"y":{{ sprite.sourceColorRectY }},"w":{{ sprite.sourceColorRectWidth }},"h":{{ sprite.sourceColorRectHeight }}},
{
// You probably want to configure this to something of your own.
// ${home}, ${env:<variable>}, ${project_path:} and ${folder:} tokens can be used in the completesharp_assemblies option.
//
// ${home} is replaced with the value of the HOME environment variable.
//
// ${env:<variable>} is replaced with the "variable" environment variable.
//
// ${project_path:} tries to find a file with the given name in all the registered project folders and
// returns the first file found, or the original file name if none is found.
@lite
lite / thumb.py
Created February 5, 2013 09:48
Save scratch file(*.sb) to thumbnail.png
#!/usr/bin/env python
# coding=utf-8
# pip install kurt
# python thumb.py 3013900.sb
import sys
import kurt
from kurt.files import ScratchProjectFile, ScratchSpriteFile
<body></body>
<script src="http://gamingJS.com/Three.js"></script>
<script src="http://gamingJS.com/ChromeFixes.js"></script>
<script>
var camera, scene, renderer;
var geometry, material, mesh;
init();
function init() {