Skip to content

Instantly share code, notes, and snippets.

View headsrooms's full-sized avatar
🦊

Pablo Cabezas headsrooms

🦊
  • SNGULAR
  • Madrid
  • 04:23 (UTC +02:00)
View GitHub Profile
@DangerOnTheRanger
DangerOnTheRanger / importhooks.py
Last active August 19, 2022 02:54
Example showing how to use import hooks in Python 3 - original article: https://dev.to/dangerontheranger/dependency-injection-with-import-hooks-in-python-3-5hap
import importlib.abc
import importlib.machinery
import sys
import types
class DependencyInjectorFinder(importlib.abc.MetaPathFinder):
def __init__(self, loader):
self._loader = loader
def find_spec(self, fullname, path, target=None):
@AFAgarap
AFAgarap / autoencoder-full.py
Last active August 17, 2024 08:17
TensorFlow 2.0 implementation for a vanilla autoencoder. Link to tutorial: https://medium.com/@abien.agarap/implementing-an-autoencoder-in-tensorflow-2-0-5e86126e9f7
"""TensorFlow 2.0 implementation of vanilla Autoencoder."""
import numpy as np
import tensorflow as tf
__author__ = "Abien Fred Agarap"
np.random.seed(1)
tf.random.set_seed(1)
batch_size = 128
epochs = 10
@jasondilworth56
jasondilworth56 / example_image_utils.py
Last active March 4, 2024 03:41 — forked from turicas/example_image_utils.py
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <http://www.pythonware.com/products/pil/> to run this script
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
from image_utils import ImageText
@PhilippHomann
PhilippHomann / app.py
Last active August 7, 2024 07:36
FastAPI file upload with streaming_form_data to parse multipart/form-data
from fastapi import FastAPI, UploadFile, HTTPException
from starlette.requests import Request
from streaming_form_data import StreamingFormDataParser
from streaming_form_data.targets import FileTarget
from tempfile import NamedTemporaryFile
import os
import shutil
@brews
brews / dask-test-workflow.yaml
Last active October 31, 2023 16:22
Argo Workflow demo to launch kubernetes dask distributed job
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dask-test-
spec:
entrypoint: dask
activeDeadlineSeconds: 1800 # Safety first, kids!
templates:
- name: dask
script:
@qcoumes
qcoumes / pytest_mute_signals_fixture.py
Last active August 9, 2024 06:42
This fixture disable django's signals in every test. You can indiviually enable them for a function using '@pytest.mark.enable_signals' decorator or for a file using 'pytestmark = pytest.mark.enable_signals'
@pytest.fixture(autouse=True)
def mute_signals(request):
# Skip applying, if marked with `enabled_signals`
if 'enable_signals' in request.keywords:
return
signals = [pre_save, post_save, pre_delete, post_delete, m2m_changed]
restore = {}
for signal in signals:
restore[signal] = signal.receivers
Listado de Proxies para Telegram
Copia y pega los enlaces en el navegador para que se abran con Telegram.
Añade los servidores y DESACTIVA el proxy mientras no lo necesites.
Podéis gestionarlos desde Ajustes > Datos y almacenamiento > Proxy
*23/03/2024*
tg://proxy?server=proxy.digitalresistance.dog&port=443&secret=d41d8cd98f00b204e9800998ecf8427e