This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g default-terminal "screen-256color" | |
set -g terminal-overrides ",xterm-256color:RGB" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias nukefromorbit="docker kill \$(docker ps -q); docker rm \$(docker ps -a -q)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.element { | |
scrollbar-width: none; | |
-ms-overflow-style: none; | |
overflow-y: scroll; | |
overflow-x: hidden; | |
} | |
.element::-webkit-scrollbar { | |
display: none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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%; |
NewerOlder