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 / 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
@juancarlospaco
juancarlospaco / printf.nim
Last active November 22, 2025 16:03
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>".}
@juancarlospaco
juancarlospaco / thermal_printer.md
Last active May 14, 2025 19:19
Arch Linux Thermal Printer USB 58mm / 80mm Drivers & Config
@juancarlospaco
juancarlospaco / Cython_CheatSheet.md
Last active March 19, 2025 21:44
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 / 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 / setup.py
Last active February 9, 2025 22:05
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.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 / 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