Skip to content

Instantly share code, notes, and snippets.

@NonLogicalDev
NonLogicalDev / README.md
Last active November 12, 2025 19:27
Fix up KDE apps distributed as flatpacks being unable to open Remote files (ex: Samba shares) from Dolphin (File Explorer)

KDE Flatpak Remote File Fix

Context: Fedora/Bazzite/Kinoite/universal-blue/KDE/Flatpacks

The Problem

When using KDE applications (like Okular or Gwenview) installed as Flatpaks in Fedora KDE Bazzite or other containerized Linux distributions, they may fail to open remote files (like those on Samba shares) when launched from Dolphin File Explorer.

Example error from Okular:

Could not open smb://... Reason: Unable to create KIO worker. Unknown protocol 'smb'.
@KonnorRogers
KonnorRogers / dungeon.rb
Created September 14, 2025 01:14
shadowcasting
module Dungeon
# Multipliers for transforming coordinates into other octants
MULT = [
[1, 0, 0, -1, -1, 0, 0, 1],
[0, 1, -1, 0, 0, -1, 1, 0],
[0, 1, 1, 0, 0, -1, -1, 0],
[1, 0, 0, 1, -1, 0, 0, -1],
]
# Determines which co-ordinates on a 2D grid are visible
@KonnorRogers
KonnorRogers / dr.rb
Last active December 17, 2025 16:39
Label wrapping
# Sample from:
# https://docs.dragonruby.org/#/samples/rendering-basics?id=labels-text-wrapping-mainrb
def tick(args)
lines = ["line1", "line2", "line3", "line4"]
labels = lines.map.with_index do |text, index|
{
x: 1280 / 2,
y: 720 / 2,
text: text,
anchor_y: index
@fnky
fnky / ANSI.md
Last active December 17, 2025 16:39
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
ProductName;LicensePartNumber;LicenseSKUID
APP CONNECT IW;SPZA_IW;8f0c5670-4e56-4892-b06d-91c085d7004f
Microsoft 365 Audio Conferencing;MCOMEETADV;0c266dff-15dd-4b49-8397-2bb16070ed52
AZURE ACTIVE DIRECTORY BASIC;AAD_BASIC;2b9c8e7c-319c-43a2-a2a0-48c5c6161de7
AZURE ACTIVE DIRECTORY PREMIUM P1;AAD_PREMIUM;078d2b04-f1bd-4111-bbd4-b4b1b354cef4
AZURE ACTIVE DIRECTORY PREMIUM P2;AAD_PREMIUM_P2;84a661c4-e949-4bd2-a560-ed7766fcaf2b
AZURE INFORMATION PROTECTION PLAN 1;RIGHTSMANAGEMENT;c52ea49f-fe5d-4e95-93ba-1de91d380f89
DYNAMICS 365 CUSTOMER ENGAGEMENT PLAN ENTERPRISE EDITION;DYN365_ENTERPRISE_PLAN1;ea126fc5-a19e-42e2-a731-da9d437bffcf
DYNAMICS 365 FOR CUSTOMER SERVICE ENTERPRISE EDITION;DYN365_ENTERPRISE_CUSTOMER_SERVICE;749742bf-0d37-4158-a120-33567104deeb
DYNAMICS 365 FOR FINANCIALS BUSINESS EDITION;DYN365_FINANCIALS_BUSINESS_SKU;cc13a803-544e-4464-b4e4-6d6169a138fa
@hj2016github
hj2016github / webviewer
Last active December 17, 2025 16:35
webview-android #Android
WebView webView= (WebView) findViewById(R.id.webview);
webView.loadUrl(http://www.baidu.com);
//允许JS执行
webView.getSettings().setJavaScriptEnabled(true);
//设置WebView的一些缩放功能点
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.setHorizontalScrollBarEnabled(false);
webView.getSettings().setSupportZoom(true);
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active December 17, 2025 16:33
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@skeeto
skeeto / example.c
Last active December 17, 2025 16:32
// https://old.reddit.com/r/C_Programming/comments/1pnh9fq
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define S(s) (Str){s, sizeof(s)-1}
#define new(a, n, t) (t *)alloc(a, n, sizeof(t), _Alignof(t))
@robin-a-meade
robin-a-meade / unofficial-bash-strict-mode.md
Last active December 17, 2025 16:32
Unofficial bash strict mode

Unofficial Bash Strict Mode

Sometimes a programming language has a "strict mode" to restrict unsafe constructs. E.g., Perl has use strict, Javascript has "use strict", and Visual Basic has Option Strict. But what about bash? Well, bash doesn't have a strict mode as such, but it does have an unofficial strict mode:

set -euo pipefail

set -e