Skip to content

Instantly share code, notes, and snippets.

View rdnt's full-sized avatar

Anastasios Papalyras rdnt

View GitHub Profile
@rdnt
rdnt / ungreedify.js
Last active April 12, 2025 20:31
Ungreedify.js: Disable Spotify song title/artist text scrolling animation on the bottom left to save CPU cycles.
// ungreedify.js
//
// Spotify (at least on Linux) uses A FULL CPU CORE trying to render the text scrolling animation on the bottom left panel,
// if the text is too big to fit. Very greedy.
// This extension disables the scrolling text for both the song title and the artist name.
// Presumably, the Spotify animation is not using CSS transforms, i.e. other non-CPU-efficient properties
// are being animated instead.
// Or, perhaps, the hardware acceleration being disabled (with no way to turn it on, again, on Linux)
// is at fault, forcing the CPU to render this animation (very inefficient indeed).
@rdnt
rdnt / ~.tmux.conf
Created December 4, 2023 21:44
tmux 8-bit color support
set -g default-terminal "screen-256color"
set -g terminal-overrides ",xterm-256color:RGB"
@rdnt
rdnt / nukefromorbit.sh
Last active May 4, 2022 14:05
nukefromorbit
alias nukefromorbit="docker kill \$(docker ps -q); docker rm \$(docker ps -a -q)"
@rdnt
rdnt / Makefile
Created February 25, 2021 13:58
self-documenting-makefile
#! Based on https://www.freecodecamp.org/news/self-documenting-makefile/
MAKEFLAGS := --no-print-directory
help:
@egrep -h '\s#\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
build: # builds
@echo "build"
@rdnt
rdnt / ctrl.py
Last active October 27, 2020 13:26
# https://raw.githubusercontent.com/LastContinue/ctrl-info/master/led_map.png
dark_gray = [1, 6,7,8,9,14,15,16,30,31,32,33,34,48,49,50,51,63,64,75,76,77,78,79,81,82,83,84,85,86,87]
light_gray = [2,3,4,5,10,11,12,13,17,18,19,20,21,22,23,24,25,26,27,28,29,35,36,37,38,39,40,41,42,43,44,45,46,47,52,53,54,55,56,57,58,59,60,61,62,65,66,67,68,69,70,71,72,73,74,80]
back_light = range(88,120)
layer_0 = [
1, # ESC
]
layer_1 = [
34, # TAB
@rdnt
rdnt / main.c
Created April 3, 2020 09:54
condition send receive
// Final example with condition variables
// Compile with: gcc -O2 -Wall -pthread cv-example-final2.c -o cv-example-final2
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#define MESSAGES 20
@rdnt
rdnt / main.c
Created April 1, 2020 15:12
Producer/Consumer C pthreads
// Producer / consumer example
// build with `cls && gcc -O2 -Wall -pthread main.c -o main.exe && main.exe`
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#define MESSAGES 20
// global integer buffer
int global_buffer;
@rdnt
rdnt / hide-scrollbar.css
Created April 1, 2020 11:57
hide scrollbar but allow scroll
.element {
scrollbar-width: none;
-ms-overflow-style: none;
overflow-y: scroll;
overflow-x: hidden;
}
.element::-webkit-scrollbar {
display: none;
}
handleMousewheel(event) {
this.holdingCtrl = event.ctrlKey;
if (event.deltaY == 0 && event.deltaX == 0) {
// inertial scroll has started
this.inertialScroll = true;
}
clearTimeout(this.timer);
this.timer = setTimeout(() => {
// inertial scroll has stopped
this.inertialScroll = false;
// Highlight bracket matchers with blue pulsing color
atom-text-editor .bracket-matcher .region {
border-bottom: 2px solid #528bff;
&:before {
content: '';
bottom: -2px;
display: block;
animation: pulse-bracket .5s infinite alternate;
position: absolute;
width: 100%;