This file contains hidden or 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
| -- | |
| -- Call PrintTable on a table to print a nicely formated lua table to the console. | |
| -- The print table can also be overloaded with a different type of printer to output the table in a new representation | |
| -- like a blob. | |
| -- | |
| -- In the final version both these should be changed to local | |
| TabSize = 4 | |
| DataType = |
This file contains hidden or 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 clone(s) | |
| local t = {} | |
| for k, v in pairs(s) do | |
| t[k] = v | |
| end | |
| return t | |
| end | |
| -- Generate all possible combinations, then filter |
This file contains hidden or 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
| list = | |
| { | |
| {n="old", p=1} | |
| } | |
| function add(effect) | |
| for i = 1, #list do | |
| local priority = list[i].p |
This file contains hidden or 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
| #!/opt/local/bin/lua | |
| dofile("./printtable.lua") | |
| dofile("./blacklist.lua") | |
| local BACKUP_PATH = "./backup/" | |
| function dofile (filename) | |
| local f = assert(loadfile(filename)) | |
| return f() |
This file contains hidden or 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
| [System.Serializable] | |
| public struct SaveDataVector3 | |
| { | |
| float x, y, z; | |
| public SaveDataVector3(Vector3 v) | |
| { | |
| x = v.x; | |
| y = v.y; | |
| z = v.z; | |
| } |
This file contains hidden or 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
| list = | |
| { | |
| { y = 2 }, | |
| { y = 3 }, | |
| { y = 1 }, | |
| { y = 1 }, | |
| { y = 8 }, | |
| } | |
| table.sort(list, function(a, b) return a.y > b.y end) |
This file contains hidden or 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
| s = "\\" | |
| s = string.gsub(s, "!%[(.-)]%s*%((.-)%)%s*\\", | |
| function(comment, path) | |
| local ret = "\\\n\\begin{center} \\emph{%s} \\end{center}\n\n" | |
| return string.format(ret, comment, path, comment) | |
| end) | |
| print(s) |
This file contains hidden or 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
| #!/opt/local/bin/lua | |
| local addFigs = true | |
| -- print("Markdown -> TeX") | |
| -- print("...") | |
| -- os.execute('pandoc -s ./test.md -o ./middle.tex --latex-engine="xelatex" -V --highlight-style espresso documentclass="report"') | |
| -- print("Done.") | |
| -- print(" ") | |
| -- print("TeX -> PDF") |
This file contains hidden or 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
| http://audiorpc.weblogs.com/RPC2 | |
| http://bing.com/webmaster/ping.aspx | |
| http://blo.gs/ping.php | |
| http://blog.goo.ne.jp/XMLRPC | |
| http://blog.with2.net/ping.php | |
| http://blogping.unidatum.com/RPC2 | |
| http://blogpingr.de/ping/rpc2 | |
| http://blogsearch.google.com/ping/RPC2 | |
| http://feedsky.com/api/RPC2 | |
| http://geourl.org/ping |
This file contains hidden or 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 frac(v) | |
| return v - math.floor(v) | |
| end | |
| print(1.6, frac(1.6)) | |
| print(2.0, frac(2.0)) | |
| print(1356.9999, frac(1356.9999)) |