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 / example.txt
Created February 28, 2019 19:12
NimWC with Firejail: typical terminal standard output debug messages when not build for release.
2019-02-28T16:00:52-03:00: Nim Website Creator: starting.
*** Starting xvfb server: "Xvfb" ":529" "-screen" "0" "800x600x24" ***
*** Stating xvfb client: "firejail" ***
*** Attaching to Xvfb display 529 ***
Basic read-only filesystem:
Mounting read-only /bin
Mounting read-only /lib
Mounting read-only /usr
@juancarlospaco
juancarlospaco / arch-tricks.md
Last active February 25, 2024 15:38
Arch Linux Tips & Tricks

Required Packages

sudo pacman -S xdelta3 ccache axel

pacman.conf

@juancarlospaco
juancarlospaco / 0README.md
Last active June 8, 2021 19:14
Python Versus Nim: Async

Python Versus Nim: Async

  • No performance benchmark.
  • Python ⟿ PEP-8
  • Nim ⟿ NEP1
  • Python ⟿ 3.7
  • Nim ⟿ 0.19
  • No Ofuscation, no Code-Golf.

This is to compare elegant, simple, expressive code.

@juancarlospaco
juancarlospaco / setup.py
Last active May 25, 2021 18:37
setup.py with post-install compilation of Cython and Go.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# To generate DEB package from Python Package:
# sudo pip3 install stdeb
# python3 setup.py --verbose --command-packages=stdeb.command bdist_deb
#
#
# To generate RPM package from Python Package:
@juancarlospaco
juancarlospaco / setup.cfg
Last active July 26, 2022 23:55
setup.py using setup.cfg for config for python3.
# See: https://setuptools.readthedocs.io/en/latest/setuptools.html#metadata
[metadata]
name = example
provides = example
description = example package
url = https://github.com/example/example
download_url = https://github.com/example/example
author = Deborah Melltrozzo
author_email = example@example.com
maintainer = Deborah Melltrozzo
@juancarlospaco
juancarlospaco / Cython_CheatSheet.md
Last active June 28, 2023 08:10
Cython Cheatsheet

Python 3 to Cython CheatSheet

Python 3.7+ to Cython CheatSheet by examples as simple as posible, because I cant find a Cython Cheatsheet on Internet. It start with simple stuff and continues towards more complex ones, is compatible with PXD that allows to left the *.py untouched. All values and variable names are example values.

Integers

@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 / 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:
# 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Unittest with DocTests."""
import doctest
import unittest