Skip to content

Instantly share code, notes, and snippets.

View paulera's full-sized avatar

Paulo Amaral paulera

View GitHub Profile
@paulera
paulera / jira-custom-filter-shortcut-userscript.js
Last active January 23, 2025 11:48
Userscript that adds custom buttons, to automate clicking on Custom Filters in a Jira board.
// ==UserScript==
// @name Custom Filters quick shortcut
// @namespace http://tampermonkey.net/
// @version 2024-12-18
// @description Add custom buttons that automate clicking on Custom Filters in a Jira board
// @author Paulo
// @match https://*.atlassian.net/jira/software/projects/*/boards/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net
// @grant none
// ==/UserScript==
@paulera
paulera / jira-label-style-userscript.js
Last active January 23, 2025 11:46
Userscript that customize the look of labels in a Jira board (team managed mode)
// ==UserScript==
// @name Label style in JIRA
// @namespace http://tampermonkey.net/
// @version 2025-01-22
// @description Chage the style of labels in Jira board
// @author Paulo Amaral
// @match https://*.atlassian.net/jira/software/projects/*/boards/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net
// @grant none
// ==/UserScript==
@paulera
paulera / recreate_tree_from_filelist.py
Created December 29, 2023 02:25
Automatically recreates a directory tree from a filelist, using divider characters to define folder paths.
#!/usr/bin/env python3
# Written by OpenAI (GPT 4): https://chat.openai.com/share/b7a9d856-7509-460d-85b3-3e5f07161e55
import argparse
import os
import shutil
def process_files(output_folder, divider, file_names):
if not os.path.exists(output_folder):
@paulera
paulera / create_fresh_wsl_image.md
Last active June 20, 2023 09:49
Create a WSL instance from a fresh linux image file. You can have many instances running in parallel.

Create a fresh WSL instance

  • Download ubuntu-20.04-server-cloudimg-amd64-wsl.rootfs.tar.gz from https://cloud-images.ubuntu.com/releases/focal/release
  • Install the .tar.gz image in a folder of your choice: wsl --import <Instance Name> <Folder> <.tar.gz file>
    • example (run in Windows command line):
      mkdir %userprofile%\wsl-developer
      wsl --import Development %userprofile%\wsl-developer ubuntu-20.04-server-cloudimg-amd64-wsl.rootfs.tar.gz
  • Boot up the instance: wsl -d <Instance Name>

Tips from the book Pragmatic Programmer (20th Anniversary edition)

https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/

https://www.goodreads.com/book/show/60633459-the-pragmatic-programmer-20th-anniversary-edition-your-journey-to-maste

Tip #1, pg. xxi: Care About Your Craft - Why spend your life developing software unless you care about doing it well?

Tip #2, pg. xxi: Think! About Your Work - Turn off the autopilot and take control. Constantly critique and appraise your work.

@paulera
paulera / _rsync_backup_restore.md
Last active March 1, 2023 19:09
rsync for backups and restore, preserving folders structure

Backup tricks with rsync

Creating backups

The commands below use a folder ~/backup/ as storage. Files are copied with the following features:

  • rsync --relative: Tree structure relative to / is preserved (subdirectories created if needed).
    • realpath --no-symlinks: Symlinks not resolved, so in case you use the backup to restore files, they will end up where they were found.
  • --recursive: Subfolders too
  • --perms: Permissions preserved
  • --copy-links: Don't backup links, but the files they are pointing to
@paulera
paulera / stopwords.md
Created January 30, 2023 13:20
Clean up text data for creating wordclouds

Cleaning up text data for wordcloud

Regular expression replacements to be done in the order presented, for cleaning up words that might interfere in the resulting cloud.

Step Replace... For...
Remove punctuation [;\.\(\)!/"] space
Add space to lines start and end [^|$] space
Remove stopwords [^a-z](share|and|at|by|the|is|that|it|or|to|it's|of|a|an|btw|be|in|if|be|amd|the|just|get|'ll's)[^a-z] space
Break in lines [ \r\n\t]+ \n
@paulera
paulera / run1.bat
Created March 9, 2022 01:47
Batch file to open a program if not yet running, or bring up to focus if it is already.
@if (@X)==(@Y) @end /* JScript comment
@echo off
REM This script runs a command if it is not yet running. Otherwise, it brings
REM the current stance into focus.
REM Usage: run1 [/nostart] <command> <params>
REM /nostart - doesn't use the command "start" to run, causing the prompt to hang
REM
REM Example: run1.bat c:\Windows\notepad.exe c:\User\paulo\Documents\todo.txt
/**
* Mural downloader
*
* Run this script in Google Chrome's console to display buttons for PDF download and a switch for automatic mode.
*
* This requires the extension Ignore X-Frame headers
* https://chrome.google.com/webstore/detail/ignore-x-frame-headers/gleekbfjekiniecknbkamfmkohkpodhe
*
**/