{"id":23644525,"url":"https://github.com/vorgestern/alltag","last_synced_at":"2025-11-11T10:30:21.126Z","repository":{"id":269116525,"uuid":"906475824","full_name":"vorgestern/Alltag","owner":"vorgestern","description":"Binary Lua module with utilities for daily use","archived":false,"fork":false,"pushed_at":"2025-02-13T02:15:23.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T03:22:26.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vorgestern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-21T02:30:27.000Z","updated_at":"2025-02-13T02:15:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"fedf4bf5-7212-41a3-9081-ee9d4b3e2472","html_url":"https://github.com/vorgestern/Alltag","commit_stats":null,"previous_names":["vorgestern/alltag"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorgestern%2FAlltag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorgestern%2FAlltag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorgestern%2FAlltag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorgestern%2FAlltag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vorgestern","download_url":"https://codeload.github.com/vorgestern/Alltag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239587226,"owners_count":19663894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-28T12:30:59.231Z","updated_at":"2025-11-11T10:30:21.091Z","avatar_url":"https://github.com/vorgestern.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# alltag\n\nProvides functions that prove helpful in daily use.\n\nThoroughly unit-tested.\nRead unittest src/Alltagstest.lua for details.\n\n## alltag.formatany(value)\n\nProduces a string representation of the value, that can reproduce value\nwhen loading it. Data types with a binary internal representation will\nnot be represented correctly. \n\n    print(alltag.formatany(21))                             return 21\n    print(alltag.formatany {21,22,23, a=1, b=2})            return {[1]=21, [2]=22, [3]=23, a=1, b=2}\n    local X={21, 22, a=1, b=2}\n    local Y=load(alltag.formatany(X))()\n    for k,v in pairs(Y) do print(k, v, X[k]) end            1 21 21    (order undefined)\n                                                            2 22 22\n                                                            a 1  1\n                                                            b 2  2\n\n## alltag.keyescape(value)\n\nFormat a value in a form suitable for a table key.\n\n    print(alltag.keyescape \"ö\")                             [\"\\xC3\\xB6\"]\n    print(alltag.keyescape \"a\")                             a\n    print(alltag.keyescape \"a c\")                           [\"a c\"]\n    print(alltag.keyescape \"21\")                            [\"21\"]\n    print(alltag.keyescape \"{a}\")                           [\"{a}\"]\n\n## alltag.map(List, func)\n\nalltag.map(L, f) returns a list {f(value)} for all value in L\n\n    local m=alltag.map({1, true, \"22\"}, tostring)\n    print(table.concat(m, \"-\"))                             1-true-22\n\n## alltag.keymap(Table, func)\n\nalltag.keymap(K, f) returns a list {key=f(value,key)} for all k,value in L\n\n    local L={a=21, b=22, \"A\", \"B\"}\n    local f1=function(v,k)\n        if type(k)==\"string\" then return v; end\n    end\n    local f2=function(v,k)\n        if type(k)~=\"string\" then return v; end\n    end\n    print(alltag.formatany(alltag.keymap(L, f1)))           return {\n                                                                a=21,\n                                                                b=22\n                                                            }\n    print(alltag.formatany(alltag.keymap(L, f2)))           return {\"A\", \"B\"}\n\n## alltag.apply(List, func)\n\n    alltag.apply({1, true, 22}, print)                      1\n                                                            true\n                                                            22\n\n## alltag.applypairs(Table, func)\n\n    alltag.applypairs({1, true, 22}, function(k,v)          1=1\n        print(k..\"=\"..tostring(v))                          2=true\n    end)                                                    3=22\n\n## alltag.findfirst(List, value)\n\nalltag.findfist(L, f) returns the first v,k from ipairs(L) that satisfy predicate f:\n\n    print(alltag.findfirst({21,22,23}, function(v)          22  2\n        return v\u003e21\n    end))\n\n## alltag.contains(List, value)\n\nalltag.contains(L,value) returns the (first) index with List[index]==value,\nor nil if value does not occur in List.\n\n    print(alltag.contains({21,22,23}, 22))                  2\n    if alltag.contains({21,22,23}, 28) then \n        error \"unexpected\"\n    end\n\n## alltag.filter(List, predicate)\n\nalltag.filter returns only those elements of the list that satisfy predicate.\n\n## alltag.pipe_lines(command, linefunc)\n\nwill execute command as a separate process and passes its output linewise\nto function linefunc. Will error if command fails.\n\n        local count=0\n        alltag.pipe_lines(\"lua src/testhelper.lua countdown 10\", function(line) count=count+1 end)\n\n        print(count)                                        11\n\n# How to build: first\n\n    git submodule init\n    git submodule update\n    cd LuaAide\n    git submodule init\n    git submodule update\n\n## .. then on Windows\n\nUse Visual Studio 2022 (VS17)\n\n- Edit buildsys/VS17/Lua.props to point to your Lua installation.\n- Build with buildsys/VS17/alltag.sln\n\n## .. else on Linux\n\n- Make sure Lua is installed: ```sudo apt-get install lua5.4``` or equivalent.\n- Use Makefile\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvorgestern%2Falltag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvorgestern%2Falltag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvorgestern%2Falltag/lists"}