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
| #!/usr/bin/env lua | |
| local remote_prog = [[ | |
| local name = [=[%s]=] | |
| local fh = assert(io.open(name)) | |
| local src = assert(fh:read("*a")) | |
| fh:close() | |
| local f = assert((loadstring or load)(src)) | |
| local activelines = assert(debug.getinfo(f, "L").activelines) | |
| local lines = {} | |
| for line in pairs(activelines) do table.insert(lines, line) 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
| #!/usr/bin/env python3 | |
| import fractions | |
| import itertools | |
| import random | |
| sample_size = 200 | |
| random.seed(44944755) | |
| new_possible_holes = [] | |
| possible_holes = [[(fractions.Fraction(1, 1), fractions.Fraction(1, 1))]] |
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
| #!/usr/bin/env lua | |
| local LineScanner = require("luacov.reporter").LineScanner | |
| local lfs = require "lfs" | |
| local function annotate_file(path) | |
| local lines = {} | |
| local max_len = 0 | |
| for line in io.lines(path) do | |
| table.insert(lines, line) |
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
| -- The following code should print "nil" several times, | |
| -- but one of the nils gets replaced with a table somehow. | |
| local function key(expr) | |
| if type(expr) == 'table' then | |
| -- Removing the zero removes spurious table | |
| local res = {0} | |
| for i=1, #expr do | |
| res[i] = key(expr[i]) | |
| -- Uncommenting the following line removes spurious table |
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
| ./env tools/pflua-compile -O0 'tcp and ((tcp[tcpflags] & tcp-syn) != 0) and ((tcp[20] == 3) or ((tcp[20] != 1) and ((tcp[20 + tcp[21]] == 3) or ((tcp[20 + tcp[21]] != 1) and ((tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1]] == 3) or ((tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1]] != 1) and ((tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + 1]] == 3) or ((tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + 1]] != 1) and ((tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + 1] + 1]] == 3) or ((tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + 1] + 1]] != 1) and ((tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + 1] + tcp[20 + tcp[21] + tcp[20 + tcp[21] + 1] + tcp[20 + |
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
| src/luarocks/admin_remove.lua:33:24: unused variable 'login_url' | |
| src/luarocks/admin_remove.lua:37:52: unused variable 'password' | |
| src/luarocks/build.lua:123:20: unused variable 'err' | |
| src/luarocks/build.lua:178:13: unused variable 'ok' | |
| src/luarocks/build.lua:184:10: value assigned to variable 'ok' is unused | |
| src/luarocks/build.lua:231:7: value assigned to variable 'ok' is unused | |
| src/luarocks/build.lua:306:4: value assigned to variable 'ok' is unused | |
| src/luarocks/build.lua:309:4: value assigned to variable 'ok' is unused | |
| src/luarocks/build.lua:317:4: value assigned to variable 'ok' is unused | |
| src/luarocks/build.lua:320:4: value assigned to variable 'ok' is unused |
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
| -- luacheck configuration file for snabbswitch, requires luacheck 0.7.0. | |
| -- Run luacheck as `luacheck -q src` from the snabbswitch root folder. | |
| -- Ignore local variables defined twice in the same scope. | |
| redefined = false | |
| -- Ignore unused arguments and loop variables. | |
| unused_args = false | |
| -- Ignore unused values coming from a call of a multi-value function together with used ones. |
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
| #!/usr/bin/env luajit | |
| local optimize = require "pf.optimize".optimize | |
| local pp = require "pf.utils".pp | |
| local expanded_src = [[ | |
| { "if", | |
| { "true" }, | |
| { "if", | |
| { "!=", |
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
| -- Requires luacheck scm-6 | |
| -- Reads a Lua program from stdin, prints warnings for unreachable code in top level closure. | |
| -- Crashes on `break` or `goto` or labels. | |
| local flow = require "luacheck.flow" | |
| local parser = require "metalua.compiler".new() | |
| local src = assert(io.stdin:read("*a")) | |
| local ast = assert(parser:src_to_ast(src)) | |
| local intel = {closures = {{stmts = ast}}, gotos = {}} | |
| flow(intel) |
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
| -- Requires luacheck scm-6 | |
| -- Reads a Lua program from stdin, prints program flow graph for top level closure. | |
| -- Format: node id: (ids of previous nodes) -> ast node tag:line:column -> (ids of next nodes) | |
| -- Crashes on `break` or `goto` or labels. | |
| local flow = require "luacheck.flow" | |
| local parser = require "metalua.compiler".new() | |
| local src = assert(io.stdin:read("*a")) | |
| local ast = assert(parser:src_to_ast(src)) | |
| local intel = {closures = {{stmts = ast}}, gotos = {}} |