Skip to content

Instantly share code, notes, and snippets.

View sineemore's full-sized avatar
🖤

sineemore

🖤
View GitHub Profile
@sineemore
sineemore / translate-xsel.sh
Created April 13, 2018 14:18
Translate selection and view it with notify-send
#!/bin/sh
# translate-xsel - translate clipboard via "Google Translate"
die() {
printf 'translate-xsel: %s' "$1" >&2
notify-send "translate-xsel" "$1"
exit 1
}
@sineemore
sineemore / pretty-json.bf
Last active May 16, 2018 15:08
JSON formatter in Brainfuck
#!/usr/bin/brainduck
This program is a JSON formatter
It takes a valid(!) JSON input and outputs formatted JSON
Memory layout used:
0 input
1 input copy
@sineemore
sineemore / scalb.c
Created October 12, 2018 19:17
Simple X calibrator based on `xinput`
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <linux/input-event-codes.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
int count = 9;
char *buf = calloc(count + 1, 1);
fread(buf, count, 1, stdin);
class NodeMarkup {
// class...
spanWord({start, end}) {
const space = /\s/
const word = /[^\s]/
while (start < this.text.length - 1 && space.test(this.text[start]))
start++
@sineemore
sineemore / st-proper-alpha-0.8.2.diff
Last active March 16, 2021 23:04
proper st alpha patch with premultiplied colors
diff --git a/config.def.h b/config.def.h
index 546edda..4f3e806 100644
--- a/config.def.h
+++ b/config.def.h
@@ -82,6 +82,9 @@ char *termname = "st-256color";
*/
unsigned int tabspaces = 8;
+/* bg opacity */
+float alpha = 0.8;
@sineemore
sineemore / main.go
Created October 6, 2020 14:19
watch w/o buffering
package main
import (
"context"
"flag"
"fmt"
"os"
"os/exec"
"os/signal"
"time"
@sineemore
sineemore / main.go
Created May 13, 2021 12:36
SNI patch proxy
package main
import (
"errors"
"flag"
"io"
"log"
"math"
"net"
"os"
@sineemore
sineemore / lorem.txt
Created July 7, 2021 12:03
Lorem ipsum original paragraph
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@sineemore
sineemore / main.go
Created July 28, 2021 13:41
sleep less on Ctrl+C
package main
import (
"fmt"
"os"
"os/signal"
"time"
)
func main() {