Skip to content

Instantly share code, notes, and snippets.

mritzco /
Created April 2, 2022 16:04
Undo the last local commit, fix and re-commit
git commit -m "Something terribly misguided" # (0: Your Accident)
git reset HEAD~ # (1)
#[ edit files as necessary ] # (2)
git add . # (3)
git commit -c ORIG_HEAD # (4)
mritzco / .tmux.conf
Created September 15, 2021 09:20
tmux and VI custom config
#Tweak timing between key sequence
set -s escape-time 0
## active window title colors
set-window-option -g window-status-current-attr bright
# Set prefix to Ctrl-Space instead of Ctrl-b
unbind C-b
set -g prefix C-Space
bind Space send-prefix
mritzco /
Created August 10, 2021 10:05
Lineman image resizing
for i in *.$filetype; do
name=$(echo $i | sed 's/\.[^.]*$//')
echo "Processing: $i"
mkdir -p $name
convert $i -resize 700x700\> $name/700;
convert $i -resize 460x460\> $name/460;
mritzco /
Created January 4, 2021 11:51
Find your true IP
# Find out true IP for DB access.
# Ref:
version: "3"
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
restart: always
mritzco / How to create Node cli executable from
Last active June 5, 2024 01:54
Create Node Package (cli) executable from npm scripts

Creating an executable NPM package and using it

This short guide explains how to create an NPM package that can be called as a script from another project. For clarity: The package to execute will be called: Module The place where you use it: Application

1. Build your module

Create a standard module ignore command line parsing

mritzco /
Created July 28, 2019 07:16
PDF to text all files in a directory, plus some cleaning
for f in $FILES
if [ ! -f "librosTexto/$SAVEAS" ]; then
echo "-Processing $f file as $SAVEAS..."
pdftotext -enc UTF-8 -nopgbrk "$f" "librosTexto/tmp.txt"
tr -s '\t' ' ' <"librosTexto/tmp.txt" > "librosTexto/$SAVEAS"
rm librosTexto/tmp.txt
mritzco /
Created April 17, 2019 16:47
Installing miraclecast and dependencies on Linux Mint
# not really an sh file but the sequence I used to install, might work as .sh but haven't tried
# If running as .sh with sudo it might not need the sudo's
# 1. Clone the repo and create the directories
git clone
cd miraclecast/
mkdir build
cd build/
# 2. There's lots of dependencies not listed
sudo apt-get install autoconf automake libtool libudev-dev libsystemd-dev libglib2.0-dev libreadline-dev
# 3. Continue the building process
mritzco / IconText.css
Created September 6, 2018 08:26
Using infernojs / reactjs components with transposed content
.text-wrapper {
margin: 0px 10px 0px 34px;
text-align: left;
mritzco /
Last active January 4, 2020 16:03
Installing TortoiseHG on linux (2018 PPA not working)

Installing TortoiseHG

(June 2018)

PPA for tortoise is gone and Tortoise is removed when mercurial is updated.

If you're ok having an old version of Mercurial, you can reinstall following this guide:

First let's see the requirements:

sudo apt-get install tortoisehg