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 / qcolorbutton.py
Created June 23, 2015 21:38
qColorButton, use to configure colors, shows a color on itself, show HEX/RGBA Values on Tooltip, and opens QColorDialog when clicked.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""qColorButton, use to configure colors, opens QColorDialog when clicked."""
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtGui import QColor, QPixmap, QIcon
@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 / 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
# 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 / 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.

@juancarlospaco
juancarlospaco / templar.py
Last active April 6, 2018 19:25
Templar is a tiny Template Engine that Render and Runs native Python 3. Optionally it can Minify the rendered output, or load from a file or file-like object.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Templar is a tiny Template Engine that Render and Runs native Python."""
import re
@juancarlospaco
juancarlospaco / single_instance_no_root.py
Last active April 6, 2018 19:25
Single Instance App Singleton.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, os, socket
import logging as log
def set_single_instance(name, single_instance=True, port=8888):
"""Set process name and cpu priority, return socket.socket object or None.
@juancarlospaco
juancarlospaco / logging_logger.py
Last active April 6, 2018 19:26
Logging Logger for Logs, the best in the world!, Colored, SysLog, Log File, CrossPlatform, Optional Arguments, and more...
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, os
import logging as log
from copy import copy
from tempfile import gettempdir
@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 / 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