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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
.resort { | |
padding: 10px; | |
border: 1px solid black; | |
background: #ccc; |
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
package main | |
import ( | |
"fmt" | |
"github.com/bycoffe/pollster" | |
"strconv" | |
) | |
func getPolls(pages []string) []pollster.Poll { | |
ch := make(chan []pollster.Poll) |
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
pager less -niSFX |
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
""" | |
A small Django app I built last year that looked for people on Twitter saying they were sick. | |
An example of using Twitter search. | |
""" | |
# models.py | |
from django.contrib.gis.db import models |
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
""" | |
Like cut, but for CSVs. To be used from a shell command line. | |
Change row[1] to the row index to be printed. row[1] will print the second | |
item in the row. | |
""" | |
python -c 'import sys, csv | |
for row in csv.reader(sys.stdin): | |
print row[1]' < filename.csv |
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 | |
""" | |
Like cut, but for CSVs. To be used from a shell command line. | |
Note that fields are zero-based, as opposed to 'cut' where they are 1-based. | |
Leveraged from/motivated by an example from @bycoffe | |
Usage: | |
csvcut foobar.csv |
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 | |
# Count the number of occurrences of each line in a file. | |
# | |
# Example: | |
# | |
# test.txt: | |
# A | |
# A | |
# B |
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 | |
""" | |
Copyright (c) 2009, Aaron Bycoffe | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions | |
are met: | |
1. Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. |
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
City | Latitude | Longitude | |
---|---|---|---|
Autauga, AL | 32.5791817 | -86.4996546 | |
Baldwin, AL | 30.6010744 | -87.7763333 | |
Barbour, AL | 31.8172896 | -85.354965 | |
Bibb, AL | 32.9562798 | -87.1422895 | |
Blount, AL | 34.0145152 | -86.4996546 | |
Bullock, AL | 32.0573536 | -85.7256372 | |
Butler, AL | 32.091673 | -88.221233 | |
Calhoun, AL | 33.7701576 | -85.80766 | |
Chambers, AL | 32.9028048 | -85.354965 |
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
""" | |
Copyright (c) 2009, Aaron Bycoffe | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions | |
are met: | |
1. Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright |
OlderNewer