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 requests | |
# fill in the appropriate values from your data.sparkfun.com data stream | |
publicKey = 'G2pKDamRDDUwKy7aMdy5' | |
privateKey = '' | |
dataLabel = 'pressure' | |
# Weather location, see openweathermap.org/current for more information | |
location = 'Edmonton,ca' | |
weatherUnits = 'metric' |
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 geocoder | |
import csv | |
def getGeo(address): | |
lat = geocoder.google(address).lat | |
lng = geocoder.google(address).lng | |
print lat, lng | |
source = csv.reader(open('source.csv', 'rb')) | |
for row in source: |
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 | |
# by David Hay @misterhay | |
# This script finds the machine's hostname and external and internal IP address, and logs them to data.sparkfun.com | |
# borrowed some code from http://blog.turningdigital.com/2012/09/get-ip-address-of-raspberry-pi-operating-headlessly/ | |
# edit the next two lines with your values from https://data.sparkfun.com/streams/make | |
public_key = '' | |
private_key = '' | |
import os |
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 | |
# some code/ideas borrowed from http://youtu.be/oaf_zQcrg7g | |
import time, threading | |
delayTime = 0.25 | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
pins = [2, 3, 4, 17, 27, 22, 10, 9, 11, 14, 15, 18, 23, 24, 25, 8, 7] | |
#pins = [2, 3, 4, 17, 27, 22, 10, 9, 14, 15, 18, 23, 24, 25, 8, 7] | |
#pins = [2, 3, 4, 17, 27, 22, 10, 9, 11] |
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
// Create a Google spreadsheet with a list of student email addresses in column A starting at row 2. | |
// Rename the sheet Achievements or change line 17 of this code. | |
// Under the Tools menu choose Script editor and paste in this code. | |
// Follow the directions at https://developers.google.com/classroom/quickstart/apps-script to authorize your script. | |
// Set up a trigger to run countClassroomAssignments() every morning or every week. | |
// https://developers.google.com/apps-script/reference/spreadsheet/sheet | |
function listCourses() { | |
// Run this then check the execution logs to find the courseId for your desired course | |
var courses = Classroom.Courses.list().courses; |
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
// in a Google Sheet that has two sheets: Cards and Drawn | |
// The 'Cards' sheet should have three columns: subject, verb, and location | |
// This code is public domain, but let me know if there are any copyright concerns. | |
// https://developers.google.com/apps-script/guides/sheets | |
// https://docs.google.com/spreadsheets/d/1mrnsKUCSkum-ZmAvGtK10uAf1eypdxsoFP7tbjWynsQ | |
function addMenu() { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createMenu('Game').addItem('Draw Something', 'drawSomething').addToUi(); | |
} |
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
function addMenu() { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createMenu('Student Responses').addItem('Concatenate all responses', 'concatenateResponses').addToUi(); | |
} | |
function concatenateResponses() { | |
var responsesDoc = DocumentApp.create('Student Responses'); | |
var responsesDocID = responsesDoc.getId(); | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var columnContainingLinksToDocuments = 6; |
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 plotly | |
from plotly.graph_objs import Scatter, Layout | |
plotly.offline.init_notebook_mode(connected=True) | |
plo = plotly.offline.iplot | |
results = pd.read_excel('https://education.alberta.ca/media/3680582/diploma-multiyear-auth-list-annual.xlsx') | |
years = [] | |
for value in results.columns.values: |
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
numberOfRolls = 10 | |
numberOfSides = 6 | |
from random import randint # a module for random integers | |
resultsList = [] # create an empty list | |
for x in range(0,numberOfRolls): # loop through this a number of times | |
number1 = randint(1, numberOfSides) # pick a number between 1 and 6 | |
number2 = randint(1, numberOfSides) # pick another number between 1 and 6 | |
total = number1 + number2 # add those two values | |
#print(total) | |
resultsList += [total] # append the sum to the resultsList |
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
// remember to add an on-open trigger for addMenu | |
function addMenu() { | |
var ui = DocumentApp.getUi(); | |
ui.createMenu('WBO Announcements') | |
.addItem('Format Announcements', 'formatAnnouncements') | |
.addToUi(); | |
} | |
function formatAnnouncements() { |
OlderNewer