Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
from datetime import datetime | |
from sqlalchemy import Column, Integer, DateTime, ForeignKey | |
from sqlalchemy.orm import relationship | |
from sqlalchemy.ext.declarative import declared_attr | |
from flask_security import current_user | |
class AuditMixin(object): | |
created_at = Column(DateTime, default=datetime.now) | |
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now) |
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 | |
keys_zone=microcache:5m max_size=1000m; | |
# Virtualhost/server configuration | |
server { | |
listen 80; | |
server_name yourhost.domain.com; | |
# Define cached location (may not be whole site) |
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=microcache:10m max_size=1024m inactive=15m; | |
map $http_cookie $cache_uid { | |
default nil; # hommage to Lisp :) | |
~SESS[[:alnum:]]+=(?<session_id>[[:alnum:]]+) $session_id; | |
} | |
map $request_method $no_cache { | |
default 1; | |
HEAD 0; | |
GET 0; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use Mojo::JSON 'j'; | |
use Mojo::Asset::Memory; | |
use File::Spec; | |
helper send_ready_signal => sub { | |
my $self = shift; | |
my $payload = { ready => \1 }; |
The shell script was used to clean the data and upload it to BigQuery. You can access the data yourself there:
https://bigquery.cloud.google.com/table/nypd-data:nypd.stop_and_frisk
Or if you simply want a giant zip of CSV files, go here (note: You'll have to do the work of reconciling the columns in order to get all the files into one database):
http://stash.compciv.org.s3.amazonaws.com/nypd-stop-and-frisk/2003-2013.zip
The R script in this gist produces the image below: