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 / thermal_printer.md
Last active June 21, 2024 17:47
Arch Linux Thermal Printer USB 58mm / 80mm Drivers & Config
@juancarlospaco
juancarlospaco / setup.py
Last active June 5, 2024 22:21
setup.py Template, Generic but Complete, with instructions to Release to PyPI, DEB, RPM, PKGBUILD, EXE, EGG, ZIP, PYZ, and more.
#!/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 May 27, 2024 18:06
C print for 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>".}
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Unittest with DocTests."""
import doctest
import unittest
@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 / ue5cleaner.nim
Last active October 13, 2023 14:54
Unreal Engine 5 project folder Minify/Anonymizer/Cleaner in Nim
import std/[os, strutils, json, sequtils]
proc main(cwd: string) =
if dirExists(cwd / "Content"):
# Minify uproject to valid minimal.
for f in walkPattern(cwd / "*.uproject"):
let uproject = parseFile(f)
if uproject.contains"Category": uproject.delete"Category"
if uproject.contains"Description": uproject.delete"Description"

💰➡️🍕

Tether USDT

TRC20 Tron Network

TPfjb2mbSQQwUe9AScZmu5bRax3dHdBBiL

BEP20 Binance Smart Chain Network BSC

## 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

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 / 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).
#!/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."""