This file contains hidden or 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 main() { | |
| // make sure single digit dd's don't appear without a leading zero | |
| Number.prototype.padZero= function(len){ | |
| var s= String(this), c= '0'; | |
| len= len || 2; | |
| while(s.length < len) s= c + s; | |
| return s; | |
| } |
This file contains hidden or 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 myFunction() { | |
| //https://developers.google.com/apps-script/reference/mail/mail-app#sendemailmessage | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheet = ss.getSheets()[0]; | |
| var charts = sheet.getCharts()[0]; | |
| var chart_image = charts.getAs("image/png").setName("hourly_chart") | |
| var d = new Date(); | |
| var currentTime = d.toLocaleTimeString(); | |
This file contains hidden or 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 myFunction() { | |
| //https://developers.google.com/apps-script/reference/mail/mail-app#sendemailmessage | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheet = ss.getSheets()[0]; | |
| var charts = sheet.getCharts()[0]; | |
| var chart_image = charts.getAs("image/png").setName("hourly_chart") | |
| var d = new Date(); | |
| var currentTime = d.toLocaleTimeString(); | |
This file contains hidden or 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
| from sshtunnel import SSHTunnelForwarder | |
| import psycopg2 | |
| #http://stackoverflow.com/questions/22046708/ | |
| #https://github.com/pahaz/sshtunnel | |
| #at least wrap in a try except block | |
| server = SSHTunnelForwarder( | |
| ('remote.server.ip', remote.port), | |
| ssh_username="jeff", |
This file contains hidden or 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 | |
| from stop_words import get_stop_words | |
| from collections import Counter | |
| #Get the file into a list | |
| with open('taw_quer.csv', 'rb') as f: | |
| reader = csv.reader(f) | |
| data = list(reader) | |
| """ |
This file contains hidden or 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
| from bs4 import BeautifulSoup | |
| import requests | |
| import urllib | |
| #if that shit doesn't load, do from terminal | |
| #python -m pip install module name or pip install module | |
| url = "http://www.americanrhetoric.com/barackobamaspeeches.htm" | |
| response = requests.get(url) |
This file contains hidden or 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 argparse | |
| import base64 | |
| import httplib2 | |
| import os | |
| from apiclient.discovery import build | |
| from oauth2client.client import GoogleCredentials | |
| os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = 'secret.json' |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| //"strconv" | |
| "strings" | |
| "math/big" | |
| ) |
This file contains hidden or 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
| #https://projecteuler.net/problem=4 | |
| #https://projecteuler.net/problem=4 | |
| def isPal(string): | |
| if len(string) <= 1: | |
| return True | |
| if list(string)[0] != list(string)[-1]: | |
| return False |
This file contains hidden or 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 argparse | |
| import csv | |
| import os.path | |
| import datetime | |
| import time | |
| from datetime import date, timedelta as td | |
| from apiclient.discovery import build | |
| from oauth2client.service_account import ServiceAccountCredentials |