Skip to content

Instantly share code, notes, and snippets.

View sassembla's full-sized avatar
😍
be gentle.

Toru sassembla

😍
be gentle.
View GitHub Profile
@sassembla
sassembla / RubyTest
Created October 29, 2011 01:26
Simple TestUnit(will evaluate when run)
require 'test/unit'
class MyTest < Test::Unit::TestCase
def test_myTestCase
test = "here comes"
# test = nil
assert(test, msg = (nomsg = true;nil))
end
@sassembla
sassembla / gwtOptionInstructions.txt
Created July 14, 2012 16:33
GWT 2.5rc commandline options
//gwt option instructions of gwt 2.5rc
-port Specifies the TCP port for the embedded web server (defaults to 8888)
-whitelist Allows the user to browse URLs that match the specified regexes (comma or space separated)
-blacklist Prevents the user browsing URLs that match the specified regexes (comma or space separated)
-logdir Logs to a file in the given directory, as well as graphically
-logLevel The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL
-gen Debugging: causes normally-transient generated types to be saved in the specified directory
-codeServerPort Specifies the TCP port for the code server (defaults to 9997)
-war The directory into which deployable output files will be written (defaults to 'war')
@sassembla
sassembla / gist:4564980
Created January 18, 2013 14:40
TimeAssert
trait TimeAssert {
val SecUnit = 1000
def timeAssert(timestamp: String, message: String, delaySec: Int = 0) = {
val timestampDate = new SimpleDateFormat("MM/dd/yy HH:mm:ss").parse(timestamp)
val limit = timestampDate.getTime + delaySec * SecUnit
val currentDate = new Date
val currentDateTime = currentDate.getTime
@sassembla
sassembla / node fileobserver.js
Last active December 12, 2015 01:38
【msgpack ハッカソンの産物】 ログファイル > node tail > (msgpack pack) WebSocket (msgpack unpack) > SublimeTextのコンソールに表示 用途:Unityのコンソールとか、エラー解析した行データをSTのコードの上に表示したり。
var WebSocket = require('ws');
var assert = require('assert');
var msgpack = require('msgpack');
var ws = new WebSocket('ws://127.0.0.1:8823/');
Tail = require('tail').Tail;
tail = new Tail("/Users/sassembla/Library/Logs/Unity/Editor.log");
ws.on('open', function() {});
@sassembla
sassembla / UnityEditorTestKit.cs
Last active December 14, 2015 11:58
Unity's plugin testkit. Minimum. Run automatically in UnityEditor.
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
[InitializeOnLoad]
public class UnityEditorTestKit : MonoBehaviour {
using UnityEngine;
using UnityEditor;
using System.Collections;
public class BuildBatch : MonoBehaviour {
// build iOS app
private static void BuildiOS(){
Debug.Log("/////////// build start ///////////");
Uniy errors & regexp
1.error on edit
sample:
Assets/Flight/Scripts/WorldRule.cs(44,52): error CS1525: Unexpected symbol `)', expecting `;'
2.error on play
sample:
MissingReferenceException: The variable flighterPrefab of 'WorldRule' doesn't exist anymore.
You probably need to reassign the flighterPrefab variable of the 'WorldRule' script in the inspector.
@sassembla
sassembla / gist:5660767
Created May 28, 2013 06:09
伝説のコードを探して
・if (環境) がすべてのパーツに浸食
・DBがへんな区切り
@sassembla
sassembla / Unity's editor code
Last active December 22, 2015 12:59
The code of UnityEditor C#. Unity 4.2.x. Run with Mac works. Run with Windows does not works.
public static string Decompress(string s) {
var bytes = Convert.FromBase64String(s);
using (var msi = new MemoryStream(bytes))
using (var mso = new MemoryStream()) {
using (var gs = new GZipStream(msi, CompressionMode.Decompress)) {
CopyStream(gs, mso);
}
return Encoding.Unicode.GetString(mso.ToArray());
}
}
@sassembla
sassembla / ShiftJSON
Created February 4, 2014 12:33
キモいDSL
"transform<-path, crossed, messages": {
"code": "
import os\n
name = os.path.basename(inputs[\"path\"])\n
onselected = []\n
messages = inputs[\"messages\"]\n
for message in messages:\n