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
local buf = {} | |
for i=#out_number,1,-1 do | |
table.insert(buf, out_number:sub(1, i)) | |
end | |
fsLog("MY VARIABLE", table.concat(buf, ", ")) |
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
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) |
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
-- 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 |
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
@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 |
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
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 |
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
#!/bin/bash | |
#:mode=bash:wrap=soft: | |
TITLE="RDesktop Frontend" | |
RDESKTOP_OPTS="-d MY_DOMAIN -g 1024x768 -z" | |
LEGAL=$(cat <<__EOF__ | |
*** start of legal notice *** |
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
#!/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 *** |
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
-- invoke as: lua bibgen.lua master.bib paper1.tex paper2.mybib paper3.cites ... | |
-- a ".tex" or ".latex" file will be parsed for \cite{name} entries | |
-- anything else will be treated as a newline-separated list of paper names | |
-- the output file will be the name of the input file, with the extension replaced with ".bib" | |
-- note: will overwrite files without prompting. Handle with care. | |
-- parse a BibTeX file into a table of entries indexed by name | |
local function parsebib(buf) | |
local bib = {} | |
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 ca.ancilla.kessler.lexer | |
(:use clojure.string)) | |
(defn- lex-token | |
"Creates and returns the token for the next token in input according to lexer. Throws an exception if input does not match any tokens." | |
[lexer input] | |
(let [try-lex (fn [lexeme] (re-find (:pattern lexeme) input)) | |
matching (first (filter try-lex (:lexicon lexer)))] | |
(if matching | |
(let [groups (re-find (:pattern matching) input) |
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
(def sfs-lexer | |
(lexer | |
["\\s+" :whitespace :drop-token] | |
["//.*" :comment :drop-token] | |
["\\{" :open-brace] | |
["\\}" :close-brace] | |
["[A-Z]+" :type] | |
["[a-zA-Z0-9]+" :key] | |
["=\\s*(.*)" :value #(-> %2)])) |
OlderNewer