Skip to content

Instantly share code, notes, and snippets.

View juancarlospaco's full-sized avatar
👑
https://t.me/NimArgentina

Juan Carlos juancarlospaco

👑
https://t.me/NimArgentina
View GitHub Profile
@juancarlospaco
juancarlospaco / music8bit.py
Created May 16, 2016 04:56
Crossplatform Sound Playing with StdLib only,No Sound file required. Plays an 8-Bit game style music procedurally generated on the fly.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Crossplatform Sound Playing with StdLib only,No Sound file required.
Plays an 8-Bit game style music procedurally generated on the fly."""
import os
import sys
@juancarlospaco
juancarlospaco / cgi-hack.sh
Last active April 6, 2018 19:27
Quick and Dirty CGI Hacks from Bash
mkdir cgi-bin
echo '#!/usr/bin/env python3' > cgi-bin/test.py
echo 'print("Content-type:text/html\n\n"+__import__("calendar").HTMLCalendar().formatyearpage(2017).decode("utf-8"))' >> cgi-bin/test.py
chmod +x cgi-bin/test.py
python3 -m http.server --cgi &
xdg-open http://127.0.0.1:8000/cgi-bin/test.py
@juancarlospaco
juancarlospaco / konsole.css
Created October 4, 2016 12:31
Konsole CSS for KDE 5+
QTabBar::tab:selected, QTabBar::tab:hover {
background: qlineargradient(x1: 0 y1: 0, x2: 1 y2: 0, stop: 0 cyan, stop: 1 lightgreen);
color: black;
font: bold italic 20px Oxygen
};
/* Save it, set it as StyleSheet on Settings of Konsole! */
@juancarlospaco
juancarlospaco / DarkQuassel.css
Last active April 6, 2018 19:24 — forked from Zren/DarkSolarized.qss
Dark Quassel Theme (qss)
/**
** Dark Quassel Theme
**
** - Settings > Configure Quassel > Interface > Client Style.
** - Restart Quassel.
**
*/
/* Window colors */
@juancarlospaco
juancarlospaco / 10-my-media-automount.rules
Last active March 3, 2025 17:21
UDev rule that auto mounts any hot-plugged device under /media/<label> and works seamlessly with vfat, ntfs, etc USB storages on Arch Linux. Paste this file and reboot:
# /etc/udev/rules.d/10-my-media-automount.rules
# start at sdb to ignore the system hard drive
KERNEL!="sd[b-z]*", GOTO="my_media_automount_end"
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="my_media_automount_end"
# import some useful filesystem info as variables
IMPORT{program}="/sbin/blkid -o udev -p %N"
@juancarlospaco
juancarlospaco / .xonshrc
Last active April 6, 2018 19:26
My xon.sh config.
# Coloured man page support
# using 'less' env vars (format is '\E[<brightness>;<colour>m')
$LESS_TERMCAP_mb = "\033[01;31m" # begin blinking
$LESS_TERMCAP_md = "\033[01;31m" # begin bold
$LESS_TERMCAP_me = "\033[0m" # end mode
$LESS_TERMCAP_so = "\033[01;44;36m" # begin standout-mode (bottom of screen)
$LESS_TERMCAP_se = "\033[0m" # end standout-mode
$LESS_TERMCAP_us = "\033[00;36m" # begin underline
$LESS_TERMCAP_ue = "\033[0m" # end underline
@juancarlospaco
juancarlospaco / unittest_doctests_template.py
Last active December 30, 2025 17:43
Unittest Templates
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Unittest with DocTests."""
import doctest
import unittest
# Automagic Multi-Language Static Analysis on Commit, before Push.
# Install on local: pip install pre-commit pre-commit-hooks
# Use in C.I.;Force Run: pre-commit run --all-files
# Auto-Update all hooks: pre-commit autoupdate
# Run all hooks on Push: pre-commit install --hook-type pre-push
# Run all hooks on Commit: pre-commit install
# Drop all hooks on Push: pre-commit uninstall --hook-type pre-push
# Drop all hooks on Commit: pre-commit uninstall
# http://pre-commit.com https://github.com/pre-commit
@juancarlospaco
juancarlospaco / HTMLParser.py
Last active January 10, 2022 01:07
HTML Parser to extract all Links (Anchors) and return 1 List of Namedtuples, with all the <a> elements and attributes, classes, IDs, aria, title, alt, etc. It only returns Links automatically, its Iterable, meant for a 2-Step Spider Web Scrapper. Other returns a dict with all the elements on lists.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
from html.parser import HTMLParser
from collections import namedtuple
def clean_html(html: str) -> str:
@juancarlospaco
juancarlospaco / unittests-reproducible-build.md
Last active April 6, 2018 19:25
Python Unittests with Reproducible Builds tools
Disclaimer

Python dont need a raw Binary unless you are distributing *.PYC without *.PY.

These tools were created for Building Binaries in a reproducible Build , here use use them to make reproducible Test.

Whatsoever creating more randomized environment for isolated unittests is always good and helps spot Bugs.

The rest of the tools for Reproducible Builds are more oriented to compiled language builds.