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 | |
# encoding: utf-8 | |
""" | |
Some exercising of Python test functionality based on: | |
https://docs.python.org/3/library/doctest.html | |
https://docs.python.org/3/library/unittest.html | |
Generating tests dynamically with unittest |
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 csv | |
mydir = "C:/Users/Nessa/Documents/Work/Coding/Test" | |
os.chdir(mydir) | |
all_filenames = [i for i in glob.glob("*.{}".format("csv"))] | |
all_data = [] | |
for f in all_filenames: |
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 | |
trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong... Press any key to continue..."' EXIT | |
VM=default | |
#DOCKER_MACHINE=./docker-machine.exe | |
DOCKER_MACHINE=/c/Program\ Files/Docker\ Toolbox/docker-machine.exe | |
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then | |
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}VBoxManage.exe" |
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 | |
# encoding: utf-8 | |
import lxml.etree | |
import lxml.html | |
import requests | |
xml_sample = """<?xml version="1.0" encoding="UTF-8"?> | |
<foo:Results xmlns:foo="http://www.foo.com" xmlns="http://www.bah.com"> | |
<foo:Recordset setCount="2"> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
# encoding: utf-8 | |
from __future__ import unicode_literals | |
import json | |
import requests | |
import scraperwiki | |
from collections import OrderedDict |
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 | |
# encoding: utf-8 | |
from __future__ import unicode_literals | |
import json | |
import requests | |
import scraperwiki | |
from collections import OrderedDict |
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 | |
""" | |
Save stock ticker data from Yahoo! Finance to sqlite. | |
""" | |
import datetime as d | |
import sqlite3 | |
import pandas.io.data as web | |
import pandas.io.sql as sql |
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/Rscript | |
# Script to create r-view 2013-08-14 | |
# Ian Hopkinson | |
source('scraperwiki_utils.R') | |
NumberOfTweets<-function(){ | |
query = 'select count(*) from tweets' | |
number = ScraperWikiSQL(query) | |
return(number) |
NewerOlder