Skip to content

Instantly share code, notes, and snippets.

View emanuele6's full-sized avatar
๐Ÿ„

Emanuele Torre emanuele6

๐Ÿ„
  • Provincia di Varese, Italy
  • 02:30 (UTC +01:00)
View GitHub Profile
@emanuele6
emanuele6 / chainif.c
Last active February 16, 2024 00:41
chainif -- maintained version available at https://github.com/emanuele6/emanutils
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <spawn.h>
#include <sys/wait.h>
#include <unistd.h>
extern char **environ;
@emanuele6
emanuele6 / setproctitle.c
Last active November 18, 2023 22:01
bash loadable builtin to set proctitle (ps -ocmd) on linux [VERY HACKY]
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <bash/builtins.h>
#include <bash/shell.h>
#include <bash/builtins/bashgetopt.h>
#include <bash/builtins/common.h>
@emanuele6
emanuele6 / gron.jq
Last active November 21, 2024 05:59
gron in jq
#!/bin/sh --
# \
exec jq -nsRrf --args -- "$0" "$@"
def path2gronpath:
reduce .[] as $k ("json"; . + ($k |
if type == "number" or . == "" or test("^[0-9]|[^0-9a-zA-Z_]")
then @json "[\(.)]"
else ".\(.)"
end));
@emanuele6
emanuele6 / gmail_html_selectall.js
Created February 16, 2024 18:45
qutebrowser greasemonkey userscript that adds a "Select All" button to the "basic HTML" gmail client <https://mail.google.com/mail/u/0/h/>
// ==UserScript==
// @name select all button on GMail basic HTML client
// @include /^https?://mail\.google\.com/mail/u/0/h/.*/
// ==/UserScript==
const inputs = document.querySelector("form[name='f'] table tr td")
if (inputs) {
const selectall = document.createElement("input");
selectall.type = "checkbox";
selectall.onchange = function(e) {