Skip to content

Instantly share code, notes, and snippets.

@nefigcas
nefigcas / tornado.pde
Created July 24, 2026 17:23
Tornado #pde #processing #animation
/*
Making a Tornado/Hurricane with circles of different sizes and sin waves (WIP)
moving forward and disappering
*/
int x = 0;
int x_dis = 0;
int y = 0;
int x2 = 0;
int y2 = 0;
@nefigcas
nefigcas / money-count.bb
Created May 1, 2026 21:02
Money Count #bb Total Amount cash counter
#!/usr/bin/env bb
(defn money-sum
"Calcula el total de sumar los billetes de las diversas denominaciones"
[bills]
(reduce + (map #(* %1 %2) (keys bills) (vals bills))))
(def bills (apply hash-map [500 (Integer/parseInt (nth *command-line-args* 0 0))
200 (Integer/parseInt (nth *command-line-args* 1 0))
100 (Integer/parseInt (nth *command-line-args* 2 0))
@nefigcas
nefigcas / set-theme.bb
Last active June 7, 2026 03:50
Set Theme: Wallpaper and pywal colors for Polybar
#!/usr/bin/env bb
(require '[babashka.process :refer [shell]]
'[clojure.java.io :as io]
'[clojure.string])
;; (def image-extensions #{".jpg" ".jpeg" ".png" ".webp" ".bmp" ".svg"})
(def wallpaper-locations [ ;; "."
"/usr/share/endeavouros/backgrounds"
"/usr/share/backgrounds/xfce"
"/home/maribelma/Imágenes/wallpapers"
@nefigcas
nefigcas / kindle-hg.bb
Last active May 1, 2026 21:03
Babashka Kindle Highlights processing script
;; #!/usr/bin/env bb
;; This was designed for babashka but because of trouble with Locales
;; must be executed as clj -M kindle-hg.bb instead, using the "normal" JVM and not the Graal one or the bb binary
;; This is only the case if mixing spanish and english locales in the My Clippings.txt file
;; and ONLY affects the timestamps in org format, failing to Epoch.
(require '[clojure.string])
(import '[java.time.format DateTimeFormatter]
'[java.time LocalDateTime]
'[java.util Locale])
@nefigcas
nefigcas / config.ini
Last active March 19, 2026 01:30
Polybar Settings
# https://github.com/Murzchnvok/polybar-collection/blob/master/themes/murz/tray.ini
[bar/mi_barra]
width = 100%
height = 24
# font-0 = "JetBrainsMono Nerd Font:size=10;2"
#icons normal size
font-0 = "JetBrainsMono Nerd Font:style=Normal:size=11;3"
# icons big size (most for border)
font-1 = "JetBrainsMono Nerd Font:style=Normal:size=19;5"
# text normal
@nefigcas
nefigcas / userChrome.css
Created January 12, 2026 21:26
Firefox Chrome, for use with Vertical Tabs plugin SideBerry
/* hides the native tabs */
#TabsToolbar
{
visibility: collapse;
}
/* hides the title bar */
#titlebar {
visibility: collapse;
}
@nefigcas
nefigcas / build
Last active July 12, 2026 06:44
Haskell Xmonad
#!/bin/sh
exec stack ghc -- \
--make xmonad.hs \
-i \
-ilib \
-fforce-recomp \
-main-is main \
-v0 \
-o "$1"
@nefigcas
nefigcas / backupdb.sh
Last active August 1, 2025 16:49
MySQL/MariaDB database backup script for crontab
#!/bin/bash
db_name="your_database_name"
fecha=$(date +"%Y%m%d%H%M%S")
rutarespaldo="/the/path/Where_you-want-to-store-the/DB/${db_name}.${fecha}"
mysqldump --column-statistics=0 -u root "${db_name}" > "${db_name}.${fecha}.sql"
zip -m "${rutarespaldo}.zip" "${db_name}.${fecha}.sql"
@nefigcas
nefigcas / makebase64csv.sh
Created March 25, 2025 18:06
Odoo data processing
#!/bin/bash
# Usage : MakeBase64CSV.sh infile.csv outfile.csv
# infile.csv columns are : externalID, name, filename or identifier
# infile.csv separator MUST BE |
echo \"External ID\",\"Name\",\"Image\" > $2
while IFS="|" read f1 f2 f3; do
@nefigcas
nefigcas / emacsclient-one-frame.sh
Last active January 29, 2026 18:18
Emacs client jumpapp one frame setup
#!/bin/bash
# if no args open new frame
if [ $# -eq 0 ]; then
jumpapp -R emacs || emacsclient -nc
exit
fi
emacsclient -e "(frames-on-display-list \"$DISPLAY\")" # &>/dev/null