Skip to content

Instantly share code, notes, and snippets.

View fierroformo's full-sized avatar

Alejandro Betancourt fierroformo

  • Yoconciente
  • Valparaíso Zacatecas
View GitHub Profile
@fierroformo
fierroformo / log_db_queries.py
Created September 18, 2023 18:17 — forked from bak1an/log_db_queries.py
django decorator for logging db queries
# simple decorator for logging out django db queries
# just put it along with other decorators before view or
# db-loading stuff. than go to your console and see whats going on.
# example:
#
# @log_db_queries
# @login_required
# def your_view(request, args...):
# your stuff
def log_db_queries(f):
@fierroformo
fierroformo / citas.py
Created April 5, 2022 21:45
Buscador de citas - Placas Zacatecas
import datetime
import requests
import time
url = "http://portaltributario.zacatecas.gob.mx/api/citas/buscar"
data = {"criterio": "{{ numero_de_pago }}", "importe": "{{ cobro }}"}
while True:
time.sleep(600)
@fierroformo
fierroformo / gist:ae536bc4b312c142cb40d96fca243a47
Created June 10, 2020 05:16 — forked from sweenzor/gist:2933958
Kill all celery tasks (redis)
# nuke the queue
redis-cli FLUSHALL
# nuke anything currently running
pkill -9 celeryd
# -*- coding: utf-8 -*-
from datetime import datetime
programmer_day = 2 ** 8
date = datetime.now()
if date.timetuple().tm_yday == programmer_day:
print("¡¡Feliz día del programador!!")
{
"data": {
"type": "users",
"id": "10",
"attributes": {
"name": "Consejero",
"username": "anonimo31054",
"phone": "4571026045",
"email": "[email protected]",
"is_active": true,
@fierroformo
fierroformo / fotitos.py
Last active December 26, 2017 20:18
Script for reduces dimensions of images
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from PIL import Image
VALID_EXTENSIONS = ['.JPG', '.jpg', '.PNG', '.png', '.BMP', '.bmp']
CURSOR_UP_ONE = '\x1b[1A'
@fierroformo
fierroformo / SchemaSpy-HOWTO.md
Created June 6, 2017 16:54 — forked from dpapathanasiou/SchemaSpy-HOWTO.md
How to use SchemaSpy to generate the db schema diagram for a PostgreSQL database

SchemaSpy is a neat tool to produce visual diagrams for most relational databases.

Here's how to use it to generate schema relationship diagrams for PostgreSQL databases:

  1. Download the jar file from here (the current version is schemaSpy_5.0.0.jar)

  2. Get the PostgreSQL JDBC driver (either the JDBC3 or JDBC4 jar file is fine)

  3. Run the command against an existing database. For most databases, the schema (-s option) we are interested in is the public one:

@fierroformo
fierroformo / pyramid.php
Last active December 31, 2015 18:49
Pyramid of asterisks
<?php
$n = 5;
for($i = $n; $i>=0; $i--) {
echo str_repeat(' ', $i).str_repeat('* ', $n - $i)."<br>";
}
?>