DISCLAIMER
Because I'm lazy, this does not work if state->fptr == state->state (the fix is simple).
$ echo -en 'this is fun!\x00oh no, it copies after nul byte!' | ./a.out | hexdump -C
00000000 74 68 69 73 20 69 73 20 66 75 6e 21 00 6f 68 20 |this is fun!.oh |
00000010 6e 6f 2c 20 69 74 20 63 6f 70 69 65 73 20 61 66 |no, it copies af|
00000020 74 65 72 20 6e 75 6c 20 62 79 74 65 21 00 00 00 |ter nul byte!...|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|| #!/usr/bin/env bash | |
| LAST_FILE="" | |
| norminette "$@" | while read -r line | |
| do | |
| if [[ "$line" =~ "Norme: " ]] | |
| then | |
| LAST_FILE="${line:7}" | |
| else |
| (() => { | |
| const videos = [...document.querySelectorAll("a.video-item")]; | |
| const links = videos.map(anchor => anchor.href); | |
| const seenLinks = links.map(link => `${link}/seen`); | |
| const requests = seenLinks.map(link => fetch(link)); | |
| return Promise.all(requests) | |
| .then(() => console.log("You've seen a lot of videos today")); | |
| })() |
| (() => { | |
| const total = [...document.querySelectorAll("g[data-toggle='tooltip']")] | |
| .map(({ dataset }) => dataset.originalTitle) | |
| .map((title) => { | |
| const [h, m] = title.split("h"); | |
| return (+h * 60 + +m) | |
| }) | |
| .reduce((a, b) => a + b); | |
| return (`${Math.floor(total / 60)}h${total % 60}`); |
| general { | |
| output_format = "i3bar" | |
| colors = true | |
| interval = 5 | |
| } | |
| order += "wireless _first_" | |
| order += "ethernet _first_" | |
| order += "battery 0" | |
| order += "tztime local" |
| general { | |
| output_format = "i3bar" | |
| colors = true | |
| interval = 5 | |
| } | |
| order += "wireless _first_" | |
| order += "ethernet _first_" | |
| order += "battery 0" | |
| order += "tztime local" |
| # Please see https://i3wm.org/docs/userguide.html for a complete reference! | |
| set $alt Mod1 | |
| set $super Mod4 | |
| set $mod Mod4 | |
| font pango: Source Code Pro 9 | |
| set $refresh_i3status killall -SIGUSR1 i3status |
| rofi.modi: window,drun | |
| rofi.theme: gruvbox-dark-hard | |
| rofi.show-icons: true |
| { pkgs, ... }: | |
| { | |
| home.file.".config/htop/htoprc".source = ./htoprc; | |
| home.packages = [ pkgs.htop ]; | |
| } |