Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
using SuperWebSocket.Client;
using System;
public class Net : MonoBehaviour {
private string lastMessage = string.Empty;
public static string serverURI = "ws://192.168.100.196:12345/channels/0?userId=1";
public static WebSocket webSocket = new WebSocket(serverURI, "basic");
%% @private
-spec init(list()) -> {ok, {SupFlags::any(), [ChildSpec::any()]}} |
ignore | {error, Reason::any()}.
init([]) ->
Dispatch = [
%% {Host, list({Path, Handler, Opts})}
{'_', [{[<<"graphs">>, graph], kw_handler, []}]}
],
RestartStrategy = one_for_one,
using UnityEngine;
using System;
using System.Collections;
using System.IO;
using System.Text;
/// <summary>
/// Bare minimum wrapper for UnityEngine.WWW.
///
#!/bin/bash
# Script used to setup elasticsearch. Can be run as a regular user (needs sudo)
ES_USER="elasticsearch"
ES_GROUP="$ES_USER"
ES_HOME="/usr/local/share/elasticsearch"
ES_CLUSTER="clustername"
ES_DATA_PATH="/var/data/elasticsearch"
ES_LOG_PATH="/var/log/elasticsearch"
ES_HEAP_SIZE=1024

How to share a folder with a docker container on OSX

Mounting shared folders between OSX and the docker container is tricky due to the intermediate boot2docker VM. You can't use the usual docker -v option as the docker server knows nothing about the OSX filesystem - it can only mount folders from the boot2docker filesystem. Fortunately, you can work around this using SSHFS.

@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;
{"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 }}},