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 | |
from PIL.ExifTags import TAGS, GPSTAGS | |
def get_exif_data(image): | |
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags""" | |
exif_data = {} | |
info = image._getexif() | |
if info: | |
for tag, value in info.items(): | |
decoded = TAGS.get(tag, tag) |
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 requests_oauthlib import OAuth2Session | |
from flask import Flask, request, redirect, session, url_for | |
from flask.json import jsonify | |
import os | |
app = Flask(__name__) | |
# This information is obtained upon registration of a new GitHub | |
client_id = "<your client key>" |
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
server { | |
listen 80; | |
server_name pic.example.com; | |
root /path_to/images; | |
location / { | |
index index.html; | |
} | |
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
MIT License | |
Copyright (c) <year> <copyright holders> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S |
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
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
# sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
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
/* http://redd.it/2z68di */ | |
#define _BSD_SOURCE // MAP_ANONYMOUS | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#define PAGE_SIZE 4096 |
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
## Common Packages | |
# --------------- | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install software-properties-common libssl-dev openssl wget | |
## Install latest Python 3 | |
# ----------------------- | |
PY_VERSION=3.4.3 | |
PY_URL="https://www.python.org/ftp/python/$PY_VERSION/Python-$PY_VERSION.tgz" |
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
#!/bin/env python3 | |
import os | |
import mmap | |
import logging | |
import hashlib | |
import contextlib | |
log = logging.getLogger(__name__) | |
@contextlib.contextmanager | |
def directio_mmap(filename, readsize, offset): |
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
(Dijkstra and plain A* are generally not included here as there are thousands of | |
implementations, though I've made an exception for rare Ruby and Crystal versions, | |
and for Thor, Mapzen's enhanced A*. ) | |
A* Ruby https://github.com/georgian-se/shortest-path | |
A* Crystal https://github.com/petoem/a-star.cr | |
A* (bidirectional with shortcuts) C++ https://github.com/valhalla/valhalla | |
NBA* JS https://github.com/anvaka/ngraph.path | |
NBA* Java https://github.com/coderodde/GraphSearchPal | |
NBA* Java https://github.com/coderodde/FunkyPathfinding |
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
''' | |
O'Meirrcy !!!! Download free ebooks from O'Reilly | |
Usage: | |
> git clone https://gist.github.com/Krazybug/1ae50814d25b0a1d862dfdf7161ee503 | |
> mv 1ae50814d25b0a1d862dfdf7161ee503 omercy | |
> cd omercy | |
> pip install requests | |
> pip install bs4 | |
> python omercy.py |
OlderNewer