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
<h4> | |
REQUESTS FOR QUOTE & LETTER OF INTENT: | |
</h4> | |
<ul> | |
<li> | |
<a href="http://apps.pittsburghpa.gov/omb/RFQ-LED_Streetlights.pdf"> | |
Streelight LED Upgrade | |
</a> | |
<ul> | |
<li> |
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
app.filter('titlecase', function () { | |
return function (input) { | |
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i; | |
// cast the input to lower case to deal with weird all caps issue | |
input = input.toLowerCase(); | |
return input.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title){ | |
if (index > 0 && index + match.length !== title.length && | |
match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && |
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
;; Turn off mouse interface early in startup to avoid display | |
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1)) | |
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) | |
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) | |
;; Handle backups | |
(setq backup-directory-alist | |
`((".*" . ,temporary-file-directory))) | |
(setq auto-save-file-name-transforms | |
`((".*" ,temporary-file-directory t))) |
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
# Big thanks to @deacondesperado | |
class Timer(): | |
def __enter__(self): | |
self.start = time.clock() | |
return self | |
def __exit__(self, *args): | |
self.end = time.clock() | |
self.interval = self.end - self.start |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.chart { | |
float: left; | |
padding-right: 5px; | |
padding-bottom: 5px; | |
padding-top: 0; | |
padding-left: 0; |
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
var bpm = 240; // beats per minute | |
var spb = 60/bpm; // seconds per beat | |
// gets note `n` frequency of `octave` | |
function note(n, octave){ | |
n += 2; | |
return Math.pow(2, (n - 33 + (12 * (octave || 0))) / 12) * 440; | |
} | |
// random noise |
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
class PaperTowel: | |
def __init__(self, input='paper towel'): | |
if isinstance(input, str): | |
self.output = sum([ord(i) for i in input]) | |
elif isinstance(input, int): | |
self.output = input | |
else: | |
raise Exception("that's not right!") | |
print type(PaperTowel().output) |
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 13 columns, instead of 7 in line 8.
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
YEAR,SPECIES,METRIC TONS,POUNDS,POUNDS (millions),VALUE,VALUE (millions),PRICE/LB,VALUE OF ONE 2014 DOLLAR (bls),PRICE (adj.),NUMBER OF LICENSE HOLDERS ,NUMBER OF TRAPS - MILLIONS,WATER TEMP AT BOOTHBAY HARBOR | |
1939,"LOBSTER, AMERICAN","3,005","6,624,823",6.6248,"$1,000,000.00",1,0.15,17.12,$2.57,"3,722",0.26,6.4 | |
1940,"LOBSTER, AMERICAN","3,468","7,644,735",7.6447,"$1,300,000.00",1.3,0.17,16.99,$2.89,"3,717",0.222,7 | |
1941,"LOBSTER, AMERICAN","4,055","8,939,070",8.9391,"$1,600,000.00",1.6,0.18,16.18,$2.91,"3,648",0.194,7.9 | |
1942,"LOBSTER, AMERICAN","3,813","8,405,460",8.4055,"$1,800,000.00",1.8,0.21,14.6,$3.07,"3,511",0.187,8.1 | |
1943,"LOBSTER, AMERICAN","5,203","11,470,410",11.4704,"$2,900,000.00",2.9,0.25,13.75,$3.44,"4,239",0.209,7.4 | |
1944,"LOBSTER, AMERICAN","6,377","14,059,080",14.0591,"$4,000,000.00",4,0.28,13.52,$3.79,"4,926",0.252,8 | |
1945,"LOBSTER, AMERICAN","8,678","19,132,785",19.1328,"$7,700,000.00",7.7,0.4,13.22,$5.29,"6,241",0.378,8.4 | |
1946,"LOBSTER, AMERICAN","8,518","18,779,985",18.78,"$7,200,000.00",7 |
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 requests | |
from bs4 import BeautifulSoup | |
URL = "http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=1.00&year1={year}&year2=2014" | |
# input a range of years here. The first valid year is 1913. | |
year_range = xrange(1939, 2014) | |
print [BeautifulSoup(requests.get(URL.format(year=i)).text).find('span', {'id': 'answer'}).text for i in year_range] |
This file has been truncated, but you can view the full file.
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
{"216": [{"station_lon": "-73.993915", "end_station": "442", "station_lat": "40.746647", "start_station": "216", "end_station_name": "W 27 St & 7 Ave", "trips": 1}, {"station_lon": "-73.99595065", "end_station": "406", "station_lat": "40.69512845", "start_station": "216", "end_station_name": "Hicks St & Montague St", "trips": 8}, {"station_lon": "-73.98963911", "end_station": "233", "station_lat": "40.69246277", "start_station": "216", "end_station_name": "Joralemon St & Adams St", "trips": 4}, {"station_lon": "-73.98329859", "end_station": "349", "station_lat": "40.71850211", "start_station": "216", "end_station_name": "Rivington St & Ridge St", "trips": 1}, {"station_lon": "-73.99422366", "end_station": "412", "station_lat": "40.7158155", "start_station": "216", "end_station_name": "Forsyth St & Canal St", "trips": 1}, {"station_lon": "-73.963198", "end_station": "2002", "station_lat": "40.716887", "start_station": "216", "end_station_name": "Wythe Ave & Metropolitan Ave", "trips": 1}, {"station_lon": "-73. |