I hereby claim:
- I am dtanham on github.
- I am dtanham (https://keybase.io/dtanham) on keybase.
- I have a public key ASBJ20ifsSwJ6VQ1id8WU6QXU6RkIC5rO8FAArGkHe_NFAo
To claim this, I am signing this object:
import random, string | |
def random_string(length): | |
''.join(random.choice(string.ascii_lowercase+string.digits) for i in range(length)) |
I hereby claim:
To claim this, I am signing this object:
from pylab import * | |
# # x: location; h: bandwidth; xp, yp: data points (vectors) | |
def loess( x, h, xp, yp): | |
w = exp( -0.5*( ((x-xp)/h)**2)/sqrt(2*pi*h**2) ) | |
b = sum(w*xp)*sum(w*yp) - sum(w)*sum(w*xp*yp) | |
b /= sum(w*xp)**2 - sum(w)*sum(w*xp**2) | |
a = ( sum(w*yp) - b*sum(w*xp) )/sum(w) | |
return a + b*x |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>Bootstrap 101 Template</title> | |
<!-- Bootstrap --> |
Flask==0.10.1 | |
Jinja2==2.7.3 | |
MarkupSafe==0.23 | |
Werkzeug==0.10.4 | |
itsdangerous==0.24 | |
mongoengine==0.10.0 | |
pymongo==3.0.2 | |
wsgiref==0.1.2 |
if (window.location.href.indexOf("https://") != 0 && window.location.href.indexOf("http://localhost") == -1) { | |
window.location.href = window.location.href.replace("http://", "https://"); | |
} |
import BaseHTTPServer | |
import SocketServer | |
import socket | |
import threading | |
import functools | |
import contextlib | |
code, content = 200, "Ok" | |
class Handler(BaseHTTPServer.BaseHTTPRequestHandler): | |
def do_GET(self): |
#!/bin/sh | |
# | |
# Startup script for persistent tcpdump | |
# | |
PCAP=/data/tcpdump/tcpdump.pcap | |
SIZE=100 | |
COUNT=20 | |
PIDFILE=/var/run/tcpdump |
# Thanks to: http://darklaunch.com/2014/02/02/fix-do-you-want-the-application-python-to-accept-incoming-network-connections | |
. venv/bin/activate | |
codesign -s "Personae Dev Cert" -f $(which python) |
"""Calculates the end date for any given datetime object""" | |
import calendar | |
def last_day(year, month): | |
return calendar.monthrange(year, month)[1] |