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__ = 'Michal Szczepanski' | |
import json | |
import random | |
from PIL import Image, ImageDraw | |
from geoalchemy2 import Geometry, func | |
from sqlalchemy import create_engine, Column | |
from sqlalchemy.orm import sessionmaker, scoped_session |
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 -*- | |
import sys | |
import os | |
import os.path | |
import email | |
import imaplib |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<div> | |
<video id="preview" width="640" height="480" muted="muted"></video> | |
<div id="buttons"> |
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/python | |
# -*- coding: utf-8 -*- | |
from matplotlib import pyplot as plt | |
from descartes import PolygonPatch | |
import simplejson | |
import os | |
#https://github.com/mledoze/countries/data | |
BASE_PATH = "your path to data folder" |
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 -*- | |
""" | |
BSD 3-Clause License | |
Copyright (c) 2017, Michal Szczepanski | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: |
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
# Python/Twisted/Redis backed DNS server - resolves from NAME to IP addrs | |
# fallback to google or any other DNS server to resolv domains not present on Redis | |
# to set a new domain on redis, just issue a SET domain.tld ip_addr | |
# run with twistd -ny txredns.tac | |
# gleicon 2011 | |
from twisted.names import dns, server, client, cache | |
from twisted.application import service, internet | |
from twisted.internet import defer | |
from twisted.python import log |
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 -*- | |
import sys | |
import socket | |
import threading | |
from collections import Counter | |
HOST = "127.0.0.1" | |
PORT = 6379 | |
INTERVAL = 5 |
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/bash | |
# For Ubuntu. Probably works elsewhere too. | |
# This script downloads the Raspbian file system into ~/rpi/chroot-raspbian-armhf | |
# It also chroots you into the directory, so you can act as a Raspbian user. | |
# This was all taken from here: http://superpiadventures.com/2012/07/development-environment/ | |
mkdir -p ~/rpi | |
cd ~/rpi |
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 -*- | |
import time | |
import bottle | |
import traceback | |
import tornado | |
import tornado.wsgi | |
import tornado.web | |
import tornado.ioloop | |
import concurrent.futures.thread |
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 -*- | |
import time | |
import io | |
import sys | |
import bottle | |
import traceback | |
import tornado | |
import tornado.gen | |
import tornado.log |
OlderNewer