Skip to content

Instantly share code, notes, and snippets.

View sagaban's full-sized avatar
🦆
Enjoying life

Santiago Bandiera sagaban

🦆
Enjoying life
View GitHub Profile
@sagaban
sagaban / change_window_opacity.sh
Created November 20, 2022 22:56 — forked from ikbelkirasan/change_window_opacity.sh
Change window opacity in Linux using keyboard shortcuts
#!/bin/bash
function get_active_window() {
printf "0x%08x" $(xdotool getactivewindow)
}
function get_current_opacity() {
window="$1"
opacity=$(xprop -id $window | grep _NET_WM_WINDOW_OPACITY | awk '{print $3}')
if [ -z $opacity ]; then
@sagaban
sagaban / echo.js
Created June 26, 2024 17:54 — forked from bszwej/echo.js
Pure Node.js echo server, that logs all incoming http requests (method, path, headers, body).
const http = require('http');
const server = http.createServer();
server.on('request', (request, response) => {
let body = [];
request.on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
body = Buffer.concat(body).toString();