Skip to content

Instantly share code, notes, and snippets.

Avatar
👑
https://t.me/NimArgentina

Juan Carlos juancarlospaco

👑
https://t.me/NimArgentina
View GitHub Profile
View wallets.md

💰➡️🍕

Tether USDT

TRC20 Tron Network

TPfjb2mbSQQwUe9AScZmu5bRax3dHdBBiL

BEP20 Binance Smart Chain Network BSC

View debugutils.py
## Debug utilities, to keep it simple and stdlib-only.
import functools
__all__ = ("debugs", )
def debugs(func):
@juancarlospaco
juancarlospaco / Cython_CheatSheet.md
Last active June 28, 2023 08:10
Cython Cheatsheet
View Cython_CheatSheet.md

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

View unittest_doctests_template.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Unittest with DocTests."""
import doctest
import unittest
@juancarlospaco
juancarlospaco / thermal_printer.md
Last active June 19, 2023 03:45
Arch Linux Thermal Printer USB 58mm / 80mm Drivers & Config
View thermal_printer.md
@juancarlospaco
juancarlospaco / arch-tricks.md
Last active May 23, 2023 14:46
Arch Linux Tips & Tricks
View arch-tricks.md
@juancarlospaco
juancarlospaco / static_typing_python3.py
Last active May 22, 2023 17:19
Python3 Annotations as Static Typing, checks code blocks inputs and outputs enforcing Types via Decorator (change "log.critical" to "log.exception" to Force Fail).
View static_typing_python3.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import functools
import logging as log
def typecheck(f):
"""Decorator for Python3 annotations to type-check inputs and outputs."""
@juancarlospaco
juancarlospaco / setup.py
Last active May 15, 2023 22:58
setup.py Template, Generic but Complete, with instructions to Release to PyPI, DEB, RPM, PKGBUILD, EXE, EGG, ZIP, PYZ, and more.
View setup.py
#!/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 / printf.nim
Last active February 25, 2023 15:12
C print for Nim
View printf.nim
proc printf*(format: cstring): cint {.importc, header: "<stdio.h>".}
proc fprintf*(stream: File, format: cstring): cint {.importc, header: "<stdio.h>".}
proc sprintf*(str: var cstring, format: cstring): cint {.importc, header: "<stdio.h>".}
proc vsprintf*(str: var cstring, format: cstring, arg: varargs[typed, `$`]): cint {.importc, header: "<stdio.h>".}
proc vfprintf*(stream: File, format: cstring, arg: varargs[typed, `$`]): cint {.importc, header: "<stdio.h>".}
@juancarlospaco
juancarlospaco / README.md
Last active October 20, 2022 21:05
Rust vs C++ vs C vs Cython vs Nim. (year 2022)
View README.md

Build

$ ./compileall.sh 

# Cleanout #############################################################
# Go ###################################################################

real    0m0,283s
user    0m0,227s