This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Mono.Cecil | |
import Mono.Cecil.Cil | |
import System | |
import System.Collections | |
import Boo.Lang.PatternMatching | |
def CreateApiStub(fromAssembly as string, toAssembly as string): | |
module = ModuleDefinition.ReadModule(fromAssembly) | |
notImplementedExceptionCtor = module.Import(typeof(System.NotImplementedException).GetConstructor(array[of System.Type](0))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Linq.Enumerable | |
words = ("blueberry", "chimpanzee", "abacus", "banana", "apple", "cheese") | |
wordGroups = words.GroupBy({ w | w[0] }) | |
for g in wordGroups: | |
print "Words that start with the letter $(g.Key):" | |
for word in g: print "\t$word" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro traceable_property: | |
case [| traceable_property $name as $type |]: | |
backingField = [| | |
private $("_$name") as $type | |
|] | |
yield backingField | |
yield [| | |
public $name: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Boo.Lang.Compiler | |
import Boo.Lang.Compiler.Ast | |
class DeepProfilingAttribute(AbstractAstAttribute): | |
""" | |
Wraps every method with Profiler.BeginSample/Profiler.EndSample calls. | |
Save it to the Plugins folder of your Unity project and enable it on a per script basis using: | |
@script DeepProfiling() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System | |
import Boo.Lang.Compiler | |
import Boo.Lang.Compiler.Ast | |
import Boo.Lang.Compiler.Services | |
import Boo.Lang.Environments | |
import Boo.Lang.Compiler.MetaProgramming | |
[meta] | |
def assign(e as MethodInvocationExpression): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package UnityEngine.Serialization { | |
class ActionScriptDeserializer { | |
public static function Deserialize(instance: IDeserializable, buffer: ByteArray, offset: int): int { | |
var reader = new SerializedStateReader(buffer, offset); | |
instance.Deserialize(reader); | |
return reader.offset; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static AS3_Val Vector3f_DefaultValue() { | |
static AS3_Val (*DefaultValueShim)() = NULL; | |
if (DefaultValueShim == NULL) { | |
AS3_Val UnityEngine = AS3_String("UnityEngine"); | |
AS3_Val Vector3_class = AS3_NSGetS(UnityEngine, "Vector3"); | |
AS3_Val DefaultValue = AS3_GetS(Vector3_class, "DefaultValue"); | |
DefaultValueShim = AS3_Shim(DefaultValue, null, "AS3ValType", false); | |
AS3_Release(DefaultValue); | |
AS3_Release(Vector3_class); | |
AS3_Release(UnityEngine); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Boo.Lang.Compiler | |
import Boo.Lang.Compiler.Ast | |
import Boo.Lang.Compiler.MetaProgramming // compile_ | |
import Boo.Lang.Compiler.TypeSystem | |
import Boo.Lang.Compiler.TypeSystem.Services | |
import Boo.Lang.Environments | |
struct Vector3: | |
x as single | |
y as single |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns fogbugz | |
(:use [clojure.xml :as xml])) | |
(def *base-url* "https://intra.unity3d.com/fogbugz/api.asp?") | |
(defn query-string-from-map [m] | |
(apply str (interpose "&" (for [[key value] m] (str (name key) "=" value))))) | |
(defn rest-call [args] | |
(let [query-string (query-string-from-map args)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'find-lisp) | |
(defun open-actionscript-files-in (dir-path) | |
(interactive "s") | |
(mapc 'find-file (find-lisp-find-files dir-path "\\.as$"))) |
OlderNewer