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 gviz_api | |
from django.db.models.query import ValuesQuerySet | |
# mapping of model field types to google vizualization column types (all not | |
# in list are 'string' type) valid google viz data types are: 'string' | |
# 'number' 'boolean' 'date' 'datetime' 'timeofday' | |
fieldmap = {'DateField':'date','DateTimeField':'datetime','BooleanField':'boolean', | |
'IntegerField':'number','DecimalField':'number','BigIntegerField':'number', | |
'FloatField':'number','TimeField':'timeofday','NullBooleanField':'boolean'} |
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 | |
import csv | |
from math import cos, pi | |
# API key for Google Places | |
api_key= 'YOUR_KEY_GOES_HERE' | |
outf = open('njpoints.csv','w') | |
w = csv.writer(outf) |
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 | |
import requests, os, pickle, datetime, zipfile, subprocess, csv | |
from bs4 import BeautifulSoup | |
class FeedFetcher(): | |
def __init__(self, ddir=os.getcwd(), get_nj=True, nj_username='', nj_pass=''): | |
self.ddir = ddir | |
self.get_nj = get_nj # whether to fetch from NJ TRANSIT or not | |
self.tc = {} # time checks for GTFS fetches |
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 | |
from bs4 import BeautifulSoup | |
import requests, os, subprocess | |
from time import sleep | |
download_dir = os.getcwd() | |
soup = BeautifulSoup(open('ned_links.html','rb')) | |
of = open('just_ned_links.txt', 'wb') |
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 | |
from os import walk | |
from ftplib import FTP | |
from time import sleep | |
# 10 - DE | |
# 34 - NJ | |
# 36 - NY | |
# 42 - PA |
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 | |
from ftplib import FTP | |
from time import sleep | |
import os | |
my_dirs = [] # global | |
my_files = [] # global | |
curdir = '' # global |
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/sh | |
# | |
# update_storyboard_strings.sh - automatically extract translatable strings from storyboards and update strings files | |
# Based on http://forums.macrumors.com/showpost.php?p=16060008&postcount=4 by mikezang | |
storyboardExt=".storyboard" | |
stringsExt=".strings" | |
newStringsExt=".strings.new" | |
oldStringsExt=".strings.old" | |
localeDirExt=".lproj" |
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 | |
import pymysql | |
import geojson | |
from geojson import FeatureCollection, Feature, LineString, Point | |
dt_fmt = '%Y-%m-%d %H:%M' | |
db = pymysql.connect(host='', user='', passwd='', db='') |
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 | |
import requests, os, pickle, datetime, zipfile, subprocess, csv | |
class FeedFetcher(): | |
def __init__(self, ddir=os.getcwd()): | |
self.ddir = ddir | |
self.tc = {} # time checks for GTFS fetches | |
self.new_use = [] # list of new feeds successfully downloaded and validated |
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 | |
""" Parse JSON real-time bus data from SEPTA: | |
http://www3.septa.org/hackathon/ | |
""" | |
from datetime import datetime, timedelta | |
import json | |
import requests | |
import sys |
OlderNewer