Skip to content

Instantly share code, notes, and snippets.

View mtdukes's full-sized avatar

Tyler Dukes mtdukes

View GitHub Profile
@mtdukes
mtdukes / choose-maps.html
Created August 21, 2014 21:08
Sample code for selectable map layers.
<!DOCTYPE html>
<!-- Testing out some things via
http://stackoverflow.com/questions/5484419/update-google-map-from-select-dropdown-menu
and
http://stackoverflow.com/questions/17342665/google-maps-api-v3-select-fusion-table-layer-from-drop-down-list
and
http://stackoverflow.com/questions/15293686/switching-between-layers-in-google-fusion-map-using-drop-down-box
and
http://www.webmasterworld.com/forum91/4032.htm
-->

Keybase proof

I hereby claim:

  • I am mtdukes on github.
  • I am mtylerdukes (https://keybase.io/mtylerdukes) on keybase.
  • I have a public key whose fingerprint is A92F 3A5D DF58 2F3F 964D F588 BF86 15E3 F5B1 1BB1

To claim this, I am signing this object:

[
'Alamance',
'Alexander',
'Alleghany',
'Anson',
'Ashe',
'Avery',
'Beaufort',
'Bertie',
'Bladen',
[
['Alabama','AL'],
['Montana','MT'],
['Alaska','AK'],
['Nebraska','NE'],
['Arizona','AZ'],
['Nevada','NV'],
['Arkansas','AR'],
['New Hampshire','NH'],
['California','CA'],
@mtdukes
mtdukes / collegescorecard_v2.py
Last active April 20, 2017 04:02
A generalized script to gather data from DOE's College Scorecard site using JSON
'''
A generalized script to gather data from
DOE's College Scorecard site using JSON
USAGE
python collegescorecard_v2.py 'https://api.data.gov/ed/collegescorecard/v1/schools.json?school.ownership=2&fields=id,school.name,2014.student.share_firstgeneration&page=0&per_page=100&api_key=MY_API_KEY_HIDDEN'
'''
#import libraries
#the time library allows us to pause for a second
from time import sleep
@mtdukes
mtdukes / hello-world.py
Last active May 11, 2017 19:18
A simple program to run from the command line
#import a python library to help us work with dates and times
import datetime
# define a FUNCTION to run a specified task
def main():
print 'Hello World!'
print 'I am some prepackaged code.'
print "I don't do much, but I'm still special!"
# another function, but we won't run this at first
@mtdukes
mtdukes / nc_county_choices.py
Created July 24, 2017 16:54
NC County code list
COUNTY_CODE_CHOICES = (
('000','Alamance'),
('010','Alexander'),
('020','Alleghany'),
('030','Anson'),
('040','Ashe'),
('050','Avery'),
('060','Beaufort'),
('070','Bertie'),
('080','Bladen'),
@mtdukes
mtdukes / parse_date.py
Created July 27, 2017 17:59
Get a python date object from a date string
#import the datetime library
from datetime import datetime
#Get a python date object from a date string
#specify the date string with ex '%Y%m%d'
def parse_date(d, date_string):
if d:
try:
parsed_date = datetime.strptime(d, date_string).date()
except ValueError, e:
@mtdukes
mtdukes / msg_cleaner.bas
Created April 29, 2019 17:47
A VBA script for Outlook to clean msg files not loading correctly into Outlook due to Internal MAPI errors
Sub savemsg()
Debug.Print "Running..."
ListFilesInFolder "SOURCE DIR HERE"
End Sub
Sub ListFilesInFolder(SourceFolderName As String)
Debug.Print "Loading source folder..."
Debug.Print SourceFolderName
Dim FSO As Scripting.FileSystemObject
Dim SourceFolder As Scripting.Folder, SubFolder As Scripting.Folder
@echo off
::Enter a project name to create a new project directory
::Provided you have a template folder with the following structure:
::chron.docx
::documents
::interviews
::>audio
::questions.txt
::data
::>data-diary.txt