Skip to content

Instantly share code, notes, and snippets.

@l-ray
l-ray / gist:724ee7bf3a7faaa33603
Last active February 27, 2018 10:32
Find all properties of an gosu entity
uses gw.lang.reflect.IPropertyInfo
var propertyList = entity.Entity.TypeInfo.Properties.toArray()
propertyList = propertyList.sort( \ elt1, elt2 -> elt1.toString() < elt2.toString())
propertyList = propertyList.where( \ elt -> elt.toString().matches(".*[a-z]+.*"))
propertyList = propertyList.where( \ elt -> not ((elt as IPropertyInfo).Hidden or (elt as IPropertyInfo).Internal))
print("Found entity properties ("+propertyList.Count+"):")
for(myProperty in propertyList) {
@l-ray
l-ray / gist:570a34e3dadd5517f09c
Created October 13, 2015 07:57
Show author-date and commit date with GIT
git log --pretty=fuller
uses gw.api.util.Math
var resultTimesVariable = new long[100]
var resultTimesConcat = new long[100]
for (var count in 0..99) {
var startDate = (new Date()).Time
for (var i in 0..1000000) {
var elem1 = Math.random(10000)
var result = "bla ${elem1}"