Skip to content

Instantly share code, notes, and snippets.

View ToxicFrog's full-sized avatar

B. Kelly ToxicFrog

  • Google
  • Kitchener, Ontario
View GitHub Profile
@ToxicFrog
ToxicFrog / rdestop-launcher.py
Created June 26, 2012 02:10
rdesktop-launcher
#!/usr/bin/python
from __future__ import print_function
TITLE = "RDesktop Frontend"
RDESKTOP_COMMAND = "rdesktop"
RDESKTOP_OPTIONS = [ "-d", "MY_DOMAIN", "-g", "1024x768", "-z" ]
LEGAL = """
*** start of legal notice ***
#!/bin/bash
#:mode=bash:wrap=soft:
TITLE="RDesktop Frontend"
RDESKTOP_OPTS="-d MY_DOMAIN -g 1024x768 -z"
LEGAL=$(cat <<__EOF__
*** start of legal notice ***
local handlers = setmetatable({}, { __index = function(self, k) self[k] = {}; return self[k]; end; })
event = {}
function event.add(name, fn)
assert(handlers[name][fn] == nil, "attempt to register the same callback multiple times for event " .. name)
handlers[name][fn] = true
return fn
end
@ECHO OFF
MODE CON: COLS=120
TITLE KSP SFSEdit
CALL :FindJRE
:RunEditor
"%JAVAPATH%\bin\java.exe" -jar kessler/sfsedit.jar saves/default/persistent.sfs
PAUSE
-- function f() return foo.bar[1] end
function <stdin:1,1> (5 instructions, 20 bytes at 0x1e19410)
0 params, 2 slots, 0 upvalues, 0 locals, 3 constants, 0 functions
1 [1] GETGLOBAL 0 -1 ; foo
2 [1] GETTABLE 0 0 -2 ; "bar"
3 [1] GETTABLE 0 0 -3 ; 1
4 [1] RETURN 0 2
5 [1] RETURN 0 1
-- function g() return foo[1] end
class Foo(_name: String) {
def name = _name
def equals(other: Foo) = {
println(this, other, name, other.name, name equals other.name)
_name equals other.name
}
}
val (one,two,three) = (new Foo("one"), new Foo("two"), new Foo("three"))
val s = Seq[Foo](one, two, three)
local buf = {}
for i=#out_number,1,-1 do
table.insert(buf, out_number:sub(1, i))
end
fsLog("MY VARIABLE", table.concat(buf, ", "))