Skip to content

Instantly share code, notes, and snippets.

View NonLogicalDev's full-sized avatar

Oleg Utkin NonLogicalDev

View GitHub Profile
@NonLogicalDev
NonLogicalDev / .remote.vimrc
Last active April 30, 2025 17:44
Micro (N)VIMRC: A minimal sane configuration for debugging on remote hosts.
" Set encoding
set encoding=utf-8
" Enable syntax highlighting
syntax enable
" Set/Create directory for swap files
set directory=$HOME/.cache/vim/swap//
" Create swap directory if it doesn't exist
if !isdirectory(&directory)
@NonLogicalDev
NonLogicalDev / to_gif.sh
Last active February 8, 2025 02:00
FFMPEG: Convert to GIF.sh
#!/bin/bash
cnv_to_gif() {
local usage="Usage: $0 [--fps <fps>] [--wsize <width>] [--hsize <height>] [--start <timestamp>] [--end <timestamp>] <input> [<output>]"
local in_f="" out_f="" fps=15 wsize="500" hsize="-1" start="00:00:00" end="00:00:00"
while [[ $# -gt 0 ]]; do
case "$1" in
--fps) fps="$2"; shift 2;;
--wsize) wsize="$2"; shift 2;;
@NonLogicalDev
NonLogicalDev / README.md
Last active February 17, 2025 23:03
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'.
@NonLogicalDev
NonLogicalDev / .config__gtk-3.0__gtk.css
Created June 9, 2024 20:41
GTK Adjust top bar size
/* window.ssd headerbar.titlebar { */
/* padding-top: 4px; */
/* padding-bottom: 4px; */
/* min-height: 0; */
/* } */
/* */
/* window.ssd headerbar.titlebar button.titlebutton { */
/* padding: 0px; */
/* min-height: 0; */
/* min-width: 0; */
@NonLogicalDev
NonLogicalDev / 01.input.go
Created June 26, 2023 22:00
Go Imports compare
//go:build ignore
// (before 1) [package doc comment]
package main
// (before 2) [this is a general comment]
// (group 1) this is a lonely single element grouping.
import (
"go/format"
#!/bin/bash -e
rm -rf repo*
ROOT_DIR="$(pwd)"
mkdir repo-origin
export GIT_PAGER=cat
(
cd repo-origin
@NonLogicalDev
NonLogicalDev / gist:2fad55f52c26dcd633966c69dd483955
Created September 27, 2022 17:33
Enable IntelliJ Experimental UI
--- /Users/USER/Library/Application Support/JetBrains/IntelliJIdea2022.2/before.txt 2022-09-27 10:30:08.000000000 -0700
+++ /Users/USER/Library/Application Support/JetBrains/IntelliJIdea2022.2/jba_config/ide.general.xml 2022-09-27 10:31:36.000000000 -0700
@@ -1,34 +1,36 @@
<application>
<component name="GeneralSettings">
<option name="autoSaveIfInactive" value="true" />
<option name="confirmExit" value="false" />
<option name="confirmOpenNewProject2" value="0" />
<option name="inactiveTimeout" value="5" />
<option name="processCloseConfirmation" value="TERMINATE" />
@NonLogicalDev
NonLogicalDev / stg-fixup.sh
Last active June 15, 2023 19:06
Utilities for fixing up stacked git stack in case of accidental modifications.
#!/bin/bash
# DEPENDENCIES:
# - git
# - stg
# - jq
# Stacked git records metadata in two commits:
#
# 1. Octopus commit that is a "merge" commit that has parent links to:
@NonLogicalDev
NonLogicalDev / osc52.sh
Last active March 22, 2022 19:30
osc52 is a utility for copying to system clipboard via osc52 escape sequences.
#!/bin/bash
#
# osc52 is a utility for copying to system clipboard via osc52 escape sequences.
#
# If your terminal supports these sequences this enables you
# to copy things from remote SSH sessions to system clipboard.
#
# Convenient when you're using lots of in-browser terminals or working on a remote server.
#
# Usage:
stg-checked-refresh-index() {
#: stg-checked-refresh-index
#: `stg refresh --index` but with diff preview and confirmation
#:
TARGET_PATCH=$(stg top)
git diff --cached -u --stat
git --no-pager diff --cached --stat