Skip to content

Instantly share code, notes, and snippets.

View ToxicFrog's full-sized avatar

B. Kelly ToxicFrog

  • Google
  • Kitchener, Ontario
View GitHub Profile
--------------------------------------------------------------
DoomRL (0.9.9.7) roguelike post-mortem character dump
--------------------------------------------------------------
ToxicFrog, level 11 Cacodemon Sergeant Major Scout,
defeated the Mastermind at the City of Dis.
He survived 95827 turns and scored 98972 points.
He played for 7 hours, 17 minutes and 41 seconds.
He didn't like it too rough.
$ lein run
Exception in thread "main" java.lang.NullPointerException, compiling:(/tmp/form-init1237425758983172879.clj:1:90)
at clojure.lang.Compiler.load(Compiler.java:7142)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)
at clojure.main$init_opt.invoke(main.clj:279)
at clojure.main$initialize.invoke(main.clj:307)
at clojure.main$null_opt.invoke(main.clj:342)
at clojure.main$main.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:421)
@ToxicFrog
ToxicFrog / log
Created September 29, 2014 01:10
System Shock 1 Devstream 2 chat log (joins/parts removed)
12:04:19 <timstellmach> It's quiet. Almost ... too quiet.
12:06:02 <chuckfiniey> They mostly come out at night... mostly
12:08:21 <ranavin> Wow, the IRC interface to this has some issues
12:09:26 <koshirro> Game over man! Game over!
12:10:00 <algorithmancy> gonna do a test soon.
12:10:15 <valet2> cool, i'm gonna record this video as well
12:10:27 <chuckfiniey> THEY'RE COMING OUT OF THE WALLS, THEY'RE COMING OUT OF THE GODDAMN WALLS (appologies for the caps lock, it was necessary to express the correct message)
12:10:36 <valet2> here's the last session, with comments: http://www.youtube.com/watch?v=-LDiTZ89j-Q
12:11:26 <valet2> "i may be synthetic, but i'm not stupid"
12:14:27 <valet2> oh, that voice again! nice to hear you!
@ToxicFrog
ToxicFrog / log
Last active August 29, 2015 14:07
System Shock 1 Devstream 2 chat log
12:04:19 <timstellmach> It's quiet. Almost ... too quiet.
12:04:40 --> timstellmach (timstellmach@timstellmach.tmi.twitch.tv) has joined #algorithmancy
12:05:36 <-- timstellmach (timstellmach@timstellmach.tmi.twitch.tv) has left #algorithmancy
12:06:02 <chuckfiniey> They mostly come out at night... mostly
12:08:21 <ranavin> Wow, the IRC interface to this has some issues
12:09:26 <koshirro> Game over man! Game over!
12:10:00 <algorithmancy> gonna do a test soon.
12:10:15 <valet2> cool, i'm gonna record this video as well
12:10:27 <chuckfiniey> THEY'RE COMING OUT OF THE WALLS, THEY'RE COMING OUT OF THE GODDAMN WALLS (appologies for the caps lock, it was necessary to express the correct message)
12:10:36 <valet2> here's the last session, with comments: http://www.youtube.com/watch?v=-LDiTZ89j-Q
math.randomseed(os.time())
local keys = { "A", "B", "start", "select", "up", "down", "left", "right" }
function randkey()
local key = keys[math.random(1,8)]
local input = joypad.get(1)
input[key] = true
joypad.set(1, input)
end
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, ...)
[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
(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)]))
(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)
-- 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 = {}