Skip to content

Instantly share code, notes, and snippets.

@mrkskwsnck
mrkskwsnck / renmove_zero-conflicted_files.sh
Created August 21, 2022 16:28
Search synchronized files conflicted by Nextcloud and replace the original file if it is zero sized.
#!/usr/bin/bash
# Search synchronized files conflicted by Nextcloud and
# replace the original file if it is zero sized.
START_DIR="$1"
GLOB_PATTERN=' (conflicted copy ????-??-?? *)'
REGEX_PATTERN=' \(conflicted copy [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]+\)'
OLDIFS=$IFS
# Description: Rename argument files of taken photos (JPG) and videos (AVI) to a Nextcloud compatible timestamp format.
#
# Author: Markus Kwaśnicki
#
# Prerequisites:
# * { Install-Module -Name ExifDateTime -Scope CurrentUser }
# * { Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser }
#
# Setup: Create shortcut to
# `"C:\Program Files\PowerShell\7\pwsh.exe" -WindowStyle Hidden -File "%USERPROFILE%\Documents\PowerShell\Scripts\Rename-FotofallenFotos.ps1"´ inside
@mrkskwsnck
mrkskwsnck / Skip YouTube Ads.js
Created December 30, 2022 12:17 — forked from kwasmich/Skip YouTube Ads.js
Script for Userscripts browser extension to skip ads on Youtube.
// ==UserScript==
// @name Skip YouTube Ads
// @description This is your new file, start writing code
// @match *://*.youtube.com/*
// ==/UserScript==
function skipAd() {
const adPlaying = document.body.querySelector(".ad-showing");
if (!adPlaying) {
@mrkskwsnck
mrkskwsnck / .bash_profile
Last active May 2, 2024 13:33
Customized bash prompt for Git's sake
source ~/.profile
# Customized terminal prompt to reflect current git branches. Based on Debian's default PS1 variable, which was
# e.g. '\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# at the time beeing of Debian 12 Bookworm. The original prompt was broken in two parts (left and right)
# and it can get flavoured with the middle part, to your very linking.
#
# Left part: ${PS1:0:-3}
# Right part: ${PS1:${#ps1_left_part}:${#PS1}}
#
@mrkskwsnck
mrkskwsnck / EvilMouse.js
Created May 1, 2024 20:38 — forked from kwasmich/EvilMouse.js
UserScript for browser to enable Disney Plus on Linux
// ==UserScript==
// @name Enable Disney Plus on Linux
// @description This is your new file, start writing code
// @match *://*.disneyplus.com/*
// ==/UserScript==
Object.defineProperty(navigator, "userAgent", { value: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", configurable: true, enumerable: true, writable: true });
@mrkskwsnck
mrkskwsnck / git-prune.sh
Created May 2, 2024 12:24 — forked from peterwwillis/git-prune.sh
Prune Git's local orphan references, merged feature branches, remote tracking references, and more
#!/bin/bash
# Prune local orphan refs
git prune -v
# Deletes all stale (local) remote-tracking branches under origin.
# These stale branches have already been removed from the remote repository
# referenced by <name>, but are still locally available.
git remote prune origin