Skip to content

Instantly share code, notes, and snippets.

View BlogBlocks's full-sized avatar

Jack Northrup BlogBlocks

View GitHub Profile
@BlogBlocks
BlogBlocks / WIX_STUFF.ipynb
Last active July 18, 2018 03:44
Jupyter Notebook using WIX
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Where to get the data:
# https://catalog.data.gov/dataset/crimes-2001-to-present-398a4
# THIS IS A BIG FILE - 1.5 gig
# prints the Headers and the First Line
# USAGE EXAMPLE: python HeadFirst.py Crimes_-_2001_to_present.csv
import sys
filename = sys.argv[1]
def headFirst(filename):
N=1000
f=open(filename)
# Where to get the data:
# Crimes_-_2001_to_present.csv
# https://catalog.data.gov/dataset/crimes-2001-to-present-398a4
# THIS IS A BIG FILE - 1.5 gig
# prints a range within the file
#USAGE: Line 0 is the header row
# python PrintRange.py Crimes_-_2001_to_present.csv 0 15
import sys
filename = sys.argv[1]
starT = int(sys.argv[2])
#!/usr/bin/python
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
# gives a base to x and y
x=[]
y=[]
with open("Crimes_file.txt") as f:
data = f.read()
data = zip(*[iter(data.split(" "))]*2)
@BlogBlocks
BlogBlocks / GoogleMapDownloader.py
Last active December 8, 2017 13:48 — forked from eskriett/GoogleMapDownloader.py
A python script to download high resolution Google map images given a longitude, latitude and zoom level.
#!/usr/bin/python
# GoogleMapDownloader.py
# Created by Hayden Eskriett [http://eskriett.com]
#
# A script which when given a longitude, latitude and zoom level downloads a
# high resolution google map
# Find the associated blog post at: http://blog.eskriett.com/2013/07/19/downloading-google-maps/
import urllib
import Image
import os
import timeit
def txsearch():
# Ask to enter string to search
Sstring = raw_input("Search Phrase")
for fname in os.listdir('./'):
# Apply file type filter
if fname.endswith(".txt"):
# Open file for reading
fo = open(fname)
import sys
import tweepy
import csv
import Key
#pass security information to variables
consumer_key = Key.twiter()[0]
consumer_secret = Key.twiter()[1]
access_key = Key.twiter()[2]
access_secret = Key.twiter()[3]
# post image and tweet to Twitter
# USAGE: import Tpost
# Tpost.tpost(ImgPath,STR)
import sys
import twython
from twython import Twython
import Key
def tpost(ImgPath,STR):
CONSUMER_KEY = Key.twiter()[0]
CONSUMER_SECRET = Key.twiter()[1]
@BlogBlocks
BlogBlocks / Key.py
Last active December 8, 2017 13:49
def twiter():
CONSUMER_KEY = 'aaaaaaaaaaaaa'
CONSUMER_SECRET = 'bbbbbbbbbbbbbbbbbbbbb'
ACCESS_KEY = 'ccccccccccccccccccccccccccccc'
ACCESS_SECRET = 'dddddddddddddddddddddddddddddddd'
twitter = (CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET)
return twitter