Skip to content

Instantly share code, notes, and snippets.

View webdev23's full-sized avatar
😡
SHTF

NVRM webdev23

😡
SHTF
View GitHub Profile
@revolunet
revolunet / lzw_encoder.js
Created February 25, 2011 14:55
LZW javascript compress/decompress
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
var out = [];
var currChar;
var phrase = data[0];
var code = 256;
for (var i=1; i<data.length; i++) {
currChar=data[i];
@eusonlito
eusonlito / foldersize.php
Last active March 11, 2025 07:56
PHP function to get the folder size including subfolders
<?php
function folderSize ($dir)
{
$size = 0;
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {
$size += is_file($each) ? filesize($each) : folderSize($each);
}
@achoukah
achoukah / blank-html-page.html
Last active June 26, 2025 08:13
html blank page
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="description" content="Webpage description goes here" />
<meta charset="utf-8">
<title>Change_me</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="">
<link rel="stylesheet" href="css/style.css">
@izabera
izabera / 0.README.md
Last active April 22, 2025 10:11
tput codes

This is the table from man 5 terminfo.

Do NOT hardcode terminal escape sequences. Use tput with the cap-names from the table below to get the right code for your terminal.

(P) indicates that padding may be specified
@berndverst
berndverst / Readme.md
Last active March 29, 2024 09:27
Script to quickly merge captions into mp4 H.264 (or HEVC/H.265) video as selectable or burned in subtitles from command-line

Add captions to MP4 videos as subtitles

Requirements

FFMpeg must be installed.

Instructions:

@probonopd
probonopd / Wayland.md
Last active July 13, 2025 06:57
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

image

Source: https://x.com/LundukeJournal/status/1940441670098809093

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

@jnsprnw
jnsprnw / countries-emojis.json
Created July 9, 2022 15:15
JSON file with country ISO 3166-1 alpha-3 and emoji flags
{
"ABW": "🇦🇼",
"AFG": "🇦🇫",
"AGO": "🇦🇴",
"AIA": "🇦🇮",
"ALA": "🇦🇽",
"ALB": "🇦🇱",
"AND": "🇦🇩",
"ARE": "🇦🇪",
"ARG": "🇦🇷",