Skip to content

Instantly share code, notes, and snippets.

View mindflayer's full-sized avatar

Giorgio Salluzzo mindflayer

View GitHub Profile
Benvenuto e Benvenuta!
Qui sotto troverai alcune info utili se stai pensando di vivere in Spagna a medio/lungo termine.
1. Il NIE è il numero di identificazione assegnato ai cittadini stranieri che decidono di intrattenere relazioni di tipo economico con la Spagna, valido su tutto il territorio, necessario per chi decide di trasferircisi ma non sufficiente. È in ogni caso il primo passo da compiere, e per ottenerlo puoi fare per conto tuo o tramite agenzia, a pagamento.
⁃ Per conto tuo: https://bit.ly/3xvgERr (https://sede.administracionespublicas.gob.es/pagina/index/directorio/icpplus/%2C/language/en/language/en/language/es_ES)
⁃ Agenzia: https://www.mynie.co.uk (https://www.mynie.co.uk/)
In entrambi i casi, sarà necessario presentarti di persona in Policia.
@mindflayer
mindflayer / rules.txt
Last active July 1, 2022 07:43
Regole gruppo Telegram "Italiani a Valencia"
Ci sono poche regole da rispettare per partecipare al gruppo:
- è necessario utilizzare la funzione di ricerca prima di inviare domande - molto è già stato detto;
- è vietato insultare o schernire gli altri membri;
- è vietato promuovere business online (es. crypto);
- è sconsigliato contattare gli utenti privatamente a meno di non essere stati invitati a farlo;
- è vietato contattare utenti privatamente per futili motivi - non siamo su Tinder;
- è consentito pubblicare annunci di lavoro solo se contengono le informazioni necessarie per capire di che si tratta - niente messaggi tipo "per info contattatemi in privato".
Chi si comporta male di solito viene richiamato o segnalato agli admin.
È molto facile distinguere una semplice cretinata da un cretino.
@mindflayer
mindflayer / mocket.py
Last active February 4, 2022 14:40
Make development great again!
from collections import Counter
import requests
import redis
from mocket import Mocket
Mocket.enable('example', '.')
# get all users
users = requests.get(
@mindflayer
mindflayer / deploy.py
Last active November 26, 2021 10:20
Spawn a deploy for a DO Docker Registry image `tag` for a specific `app` on DigitalOcean App Platform
import argparse
import json
import os
import subprocess
ENCODING = "utf-8"
def check_output(cmd, split_lines=False):

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@mindflayer
mindflayer / index.php
Last active November 21, 2017 23:46
Prerender plain PHP dispatcher file, with X-Prerender-Token
<?php
$uri = $_SERVER["REQUEST_URI"];
$ua = $_SERVER["HTTP_USER_AGENT"];
$static = "home.html"; // your real webapp HTML file (formerly index.html?)
$prerender = 0;
$regex = "baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator";
@mindflayer
mindflayer / gist:6690008
Created September 24, 2013 19:28
Create class instance on-the-fly with Python
>>> class Dog(object):
... pass
...
>>> class Cat(object):
... pass
...
>>> def create_object(class_name):
... return getattr(__import__(__name__), class_name)()
...
>>> dog = create_object('Dog')
@mindflayer
mindflayer / gist:6648751
Created September 21, 2013 09:00
Compile time dictionary
>>> def a(b, c={}):
... c[b] = b
... print c
...
>>> a('prova')
{'prova': 'prova'}
>>> a('gatto')
{'prova': 'prova', 'gatto': 'gatto'}
>>> a('mela')
{'prova': 'prova', 'mela': 'mela', 'gatto': 'gatto'}
@mindflayer
mindflayer / gist:6524007
Created September 11, 2013 14:00
PHP middleware removal using nginx proxy, JSONP available if GET param callback is available
location ^~ /v02/contenz/ {
if ( $arg_callback ) {
add_header Content-Type application/javascript;
echo_before_body '$arg_callback(';
echo_after_body ');';
}
proxy_pass http://192.168.124.37:8001/;
}
@mindflayer
mindflayer / gist:6027026
Created July 18, 2013 06:05
For Python group on Facebook
>>> class Fruit(object):
... pass
...
>>> class Apple(Fruit):
... color = None
... def __init__(self, color):
... self.color = color
...
>>> apple_in_my_fridge = Apple('green')
>>> isinstance(apple_in_my_fridge, Apple)