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
''' | |
Created on 2011-05-12 | |
@author: Daniel Sokolowski | |
Extends django's built in JSON serializer to support GEOJSON encoding | |
Requirements: | |
Install and setup geodjango (django.contrib.gis) |
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
var serialport = require('node-serialport') | |
var sp = new serialport.SerialPort("/dev/ttyO3", { | |
parser: serialport.parsers.raw, | |
baud: 9600 | |
}) | |
sp.on('data', function(chunk) { | |
console.log(chunk.toString('hex'), chunk.toString(), chunk) | |
}) |
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 pandas as pd | |
import numpy as np | |
from pysal.esda.mapclassify import Natural_Breaks as nb | |
df = pd.DataFrame({'density': np.random.randint(0, 10, 500)}) | |
# replace zero values with NaN | |
df.replace(to_replace={'density': {0: np.nan}}, inplace=True) | |
breaks = nb(df[df['density'].notnull()].density.values, k=5) | |
# this index will allow us to perform the join correctly |
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 | |
# Run this: | |
# | |
# curl https://gist.github.com/nicerobot/7664605/raw/install.sh | bash -s do-sudo | |
# | |
# which will run: | |
[ -f qgis2-homebrew-build.sh ] || { | |
curl -O https://gist.github.com/nicerobot/7664605/raw/qgis2-homebrew-build.sh |
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
CC=g++ | |
CFLAGS=-g -Wall -std=c++11 -I/usr/local/include -I/Users/jbarnett/cinder/include | |
LIBPATH += -L"/System/Library/Frameworks/CoreLocation.framework/Resources" | |
LIBPATH += -L"/System/Library/Frameworks/Accelerate.framework/Resources" | |
LIBPATH += -L"/System/Library/Frameworks/ApplicationServices.framework/Resources" | |
LIBPATH += -L"/System/Library/Frameworks/QuickTime.framework/Resources" | |
LIBPATH += -L"/System/Library/Frameworks/Carbon.framework/Resources" | |
LIBPATH += -L"/System/Library/Frameworks/Cocoa.framework/Resources" | |
LIBPATH += -L"/System/Library/Frameworks/OpenGL.framework/Libraries" |
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
############################################################################# | |
## ## | |
## LT-VIZ INITIAL SERVER SETUP ------------------------------------------ ## | |
## ## | |
## This is a list of bash commands that are used to setup a Ubuntu ## | |
## 14.04 server with nginx, gunicorn, and a Django app. ## | |
## ## | |
############################################################################# | |
############################################################################# |
References:
-
Find the ip address of the computer running the dev server. You can use
ipconfig
on windows or go to Preferences > Network on a Mac. -
start the Django server on the computer's ip (the ip below is just an example):
python manage.py runserver 11.111.1.111:8000
-
Open that address on the browser of your phone