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)])) |
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
[Desktop Entry] | |
Name=FTL: Faster Than Light | |
Comment=A spaceship simulation realtime roguelike-like | |
Exec=/opt/FTL/FTL | |
Path=/opt/FTL | |
Icon=/opt/FTL/data/exe_icon.bmp | |
Terminal=false | |
Type=Application | |
Categories=Game | |
StartupWMClass=FTL |
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 staff.callFunctionForEachEmployee(functionName, ...) | |
if employee_instances then | |
for _,employee in pairs(employee_instances) do | |
employee[functionName](employee, ...) | |
end | |
end | |
end | |
-- or, for a more general approach | |
function callMethodOnEach(objects, method, ...) |
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
@PART[ISRU]:FINAL | |
{ | |
MODULE | |
{ | |
name = ModuleResourceConverter | |
ConverterName = RocketParts | |
StartActionName = Start ISRU [Rocket Parts] | |
StopActionName = Stop ISRU [Rocket Parts] | |
AutoShutdown = false | |
GeneratesHeat = false |
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 love.conf(t) | |
t.name = "Example project -- tests" | |
t.author = "ToxicFrog" | |
t.identity = "example.test" | |
t.version = "0.9.0" -- replace with target love2d version | |
t.console = true -- enable console on windows for debug logging | |
-- disable all module loading | |
-- if some of your tests actually call love2d API functions, either enable them or provide stubs |