sudo service nginx stop
sudo apt-get remove nginx nginx-common
sudo add-apt-repository ppa:fxr/nginx-alpn
sudo apt-get update
sudo apt-get install nginx
sudo service nginx restart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from shapely.geometry import Polygon | |
from matplotlib import pyplot as plt | |
from shapely.ops import cascaded_union | |
import geopandas as gpd | |
m = cascaded_union([Polygon(i if i[0] == i[-1] else i[:-2].append(i[0])) for i in [ | |
[ | |
[81.300003051757812, 37.588695526123047], | |
[75.599998474121094, 37.588695526123047], | |
[75.599998474121094, 39.888694763183594], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
np.array([8.218,-9.341]) + np.array([-1.129,2.111]) | |
np.array([7.119,8.215]) - np.array([-8.223,0.878]) | |
7.41 * np.array([1.671,-1.012,-0.318]) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Author: ficapy | |
import io | |
from urllib.parse import urlencode | |
from base64 import b64encode | |
from pdf2image import convert_from_bytes | |
from PyPDF2 import PdfFileWriter, PdfFileReader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Author: ficapy | |
# Create: '12/03/2018' | |
from threading import Lock, get_ident | |
class RLock: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import imagehash | |
def get_phash(file_path): | |
img = Image.open(file_path) | |
phash = imagehash.phash(img).hash.flatten() | |
phash_list = list(map(bool, phash)) | |
if phash_list[0] is True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Author: ficapy | |
# Create: '03/03/2018' | |
import random | |
from string import ascii_lowercase | |
def distance(str1: str, str2: str): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Author: ficapy | |
import random | |
import csv | |
import time | |
from functools import wraps | |
from io import StringIO | |
from contextlib import closing, contextmanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net" | |
"os" | |
"os/signal" | |
"syscall" | |
"time" |