Skip to content

Instantly share code, notes, and snippets.

View sposmen's full-sized avatar
😀

Jaime Giraldo sposmen

😀
View GitHub Profile
@sposmen
sposmen / release_size.sh
Last active November 5, 2026 15:01
Cut log file to release disc available size
# Set the log filename here
LOG=/log/your_log.log
# Set the bytes you want last
KEEP=3221225472
SIZE=$(stat -c %s "$LOG")
dd if="$LOG" of="$LOG" bs=1M skip=$(( (SIZE-KEEP)/1048576 )) count=$((KEEP/1048576)) conv=notrunc
truncate -s "$KEEP" "$LOG"
@sposmen
sposmen / printCanvasElm.js
Created September 8, 2026 01:24
PrintCanvasElm.js
() => {
const imagenData = $0.toDataURL("image/png");
const contenidoOriginal = document.body.innerHTML;
document.body.innerHTML = `<img src="${imagenData}" style="max-width: 100%; height: auto;" />`;
setTimeout(() => {
window.print();
document.body.innerHTML = contenidoOriginal;
}, 500);
})();
@sposmen
sposmen / refresh_print_page.html
Created August 28, 2026 21:41
Weekly Print refresh page to preserve ink fresh in printer with date (print the next page to the current printed)
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Patrón de Mantenimiento - Epson ET-2800</title>
<style>
@page {
size: letter;
margin: 1cm;
}
@sposmen
sposmen / recorder
Created March 24, 2026 19:20
ffmpeg simple screen Recorder for Mac
#!/bin/bash
PIDFILE="$HOME/.ffmpeg_screen_record.pid"
OUTDIR="$HOME/Movies"
get_default_video() {
ffmpeg -f avfoundation -list_devices true -i "" 2>&1 \
| grep "Capture screen" \
| head -n 1 \
| sed -E 's/.*\[(.*)\].*/\1/'
@sposmen
sposmen / commit_time_range_all_authors
Created February 13, 2026 17:11
Get Authors dates frame.
#!/bin/bash
# Ensure we're inside a git repository
if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
echo "Error: This is not a git repository."
exit 1
fi
TMP_FILE=$(mktemp)
@sposmen
sposmen / Readme.md
Last active September 10, 2025 15:24
Github gh command plugin showing prs tree

gh-pr-tree

gh-pr-tree is a GitHub CLI extension that helps you visualize the dependency tree of pull requests.

Normally, gh pr list --base <branch> only shows the direct PRs targeting a branch. With gh-pr-tree, you can see all descendants recursively as a hierarchical tree, making it easier to track stacked PRs and feature branch chains.

Setup

Requirements

  • gh command
@sposmen
sposmen / config_add
Created August 8, 2024 20:53
Git options for rebase
[rebase]
autoStash = true
rebaseMerges = true
updateRefs = true
@sposmen
sposmen / Readme.md
Last active June 8, 2022 20:33
Node Server Body Parser

Run

node server_body_parser.js

Setup in your endpoint

http://localhost:8888

Change port

Change the variable port in the code. 8888 is the default

@sposmen
sposmen / excel_to_csv_commands.sh
Created March 2, 2022 17:44
Large Excel to split CSV helpers
# Command to convert the large Excel to csv. this is based on gnumeric
# To install it in Mac could be through `brew install gnumeric`
ssconvert -O "sheet=SHEET_NAME" EXCEL_FILENAME.xlsx CSV_FILENAME.csv
# Command to split the large csv in chunks of lines through parallel command.
# This case is 30K lines each file and each file will be numbered based on the `{#}` addition in the filename
# To install parallel in MAC `brew install parallel`
cat CSV_FILENAME.csv | parallel --header : --pipe -N30000 'cat > CSV_FILENAME_{#}.csv'
@sposmen
sposmen / .env.example
Last active October 6, 2021 03:52
Github PR Tree
#GITHUB_ACCESS_TOKEN=
GH_OWNER=rew-ca
GH_REPO=rewportal
SHOW_DOT=true