{"id":29463612,"url":"https://github.com/fiddlerwoaroof/sigexec","last_synced_at":"2025-07-14T05:38:08.620Z","repository":{"id":42669376,"uuid":"474600790","full_name":"fiddlerwoaroof/sigexec","owner":"fiddlerwoaroof","description":"A simple utility that runs a command with each line sent over a socket","archived":false,"fork":false,"pushed_at":"2024-02-29T21:59:32.000Z","size":31,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-14T05:17:03.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fiddlerwoaroof.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-03-27T10:12:42.000Z","updated_at":"2024-05-29T09:09:29.000Z","dependencies_parsed_at":"2024-02-29T22:53:29.103Z","dependency_job_id":null,"html_url":"https://github.com/fiddlerwoaroof/sigexec","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fiddlerwoaroof/sigexec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiddlerwoaroof%2Fsigexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiddlerwoaroof%2Fsigexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiddlerwoaroof%2Fsigexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiddlerwoaroof%2Fsigexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fiddlerwoaroof","download_url":"https://codeload.github.com/fiddlerwoaroof/sigexec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiddlerwoaroof%2Fsigexec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265246229,"owners_count":23734111,"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":"2025-07-14T05:38:08.191Z","updated_at":"2025-07-14T05:38:08.599Z","avatar_url":"https://github.com/fiddlerwoaroof.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: socket-based command runner\n#+TAGS: utilities\n#+AUTHOR: Ed Langley\n\n** Introduction\n\nRun a command everytime a line is written to a unix socket, passing\nthe line written as the last argument to the command. Useful in an\n=after-save-hook= in emacs to run tests after the buffer is saved.\nUnlike file-watchers, this allows more precise control of when the\ntests are run, reducing the amount of time spent configuring ignore\nfiles and waiting for spurious reruns.\n\n** Building\n\nChoose either building with zig:\n\n#+BEGIN_SRC zsh :results output :post proc\n  zig build --verbose\n#+END_SRC\n\nOr nix:\n\n#+BEGIN_SRC zsh :results output :post proc\n  nix build github:fiddlerwoaroof/sigexec\n#+END_SRC\n\nOne can also run the flake's default app like:\n\n#+BEGIN_SRC zsh :results output :post proc\n  nix run github:fiddlerwoaroof/sigexec \u003csocket\u003e \u003ccommand...\u003e\n#+END_SRC\n\n** Usage\n\n#+BEGIN_SRC zsh\n  rm /tmp/jest.sock ; $OLDPWD/zig-out/bin/zig-test /tmp/jest.sock npx jest --\n#+END_SRC\n\n\n** Full-stack example:\n\n*** In one terminal:\n\n#+begin_src zsh\n  % nix run github:fiddlerwoaroof/sigexec /tmp/bar.sock echo NOTICE ME: input:\n  # output:\n  # warning: listening at /tmp/bar.sock\n  #\n  # NOTICE ME: input: 4\n#+end_src\n\n*** In another terminal:\n\n#+begin_src zsh\n  # in another terminal:\n  % echo 4 | socat - unix-connect:/tmp/bar.sock\n  # ACK!\n#+end_src\n\n#+NAME: proc\n#+BEGIN_SRC elisp :exports none\n  (defun fix (fn inp)\n    (cl-loop for old = inp then new\n             for new = (funcall fn inp)\n             until (equal new old)\n             finally (cl-return new)))\n  (s-join\n   \"\\n\"\n   (funcall (fwoar/over (lambda (it)\n                          (    (lambda (v)\n                                 (s-replace-regexp \" \\\\(--\\\\|#\\\\)\" \" \\\\\\\\\\n  \\\\1\" v))\n                               (s-replace-regexp \"/nix/store/[^/]*/\\\\(.* \\\\)\"\n                                                 \"/nix/.../\\\\1\"\n                                                 (s-replace \"/Users/edwlan\" \"~\" it)))))\n            (s-lines (s-trim *this*))))\n#+END_SRC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiddlerwoaroof%2Fsigexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiddlerwoaroof%2Fsigexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiddlerwoaroof%2Fsigexec/lists"}