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
task :jsonify_timeline => :environment do | |
require 'csv' | |
require 'json' | |
require 'open-uri' | |
def scrub(text) | |
if text.include? '--' | |
text = text.gsub(/--/, '—') | |
end | |
return text |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| results | BASE TABLE | | |
| resultview3 | VIEW | | |
| resultview_sub1 | BASE TABLE | | |
| resultview_sub2 | BASE TABLE | | |
| resultview_sub3 | BASE TABLE | | |
| resultview_sub3a | BASE TABLE | | |
RESULTSVIEW3 is confirmed to be a view | |
mysql> select * from trackertouse; |
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
mysql -u<USERNAME> -p<PASSWORD> <DB_NAME> -e "show tables" | \ | |
grep -v Tables_in|awk '{print "ALTER table",$1" ENGINE=InnoDB;"}' |
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
for remote in `git branch -r | grep -v master `; | |
do git checkout --track $remote ; | |
done; |
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
def generate_document_path(instance, filename): | |
return u"uploaded/documents/%s/%s/%s/%s" % (datetime.now().year,\ | |
datetime.now().month, instance.slug, filename) | |
DOCUMENTS_PATH=generate_document_path |
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
<script type='text/javascript' src='http://media.baycitizen.org/js/jquery-1.4.2.min.js'></script> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript" charset="utf-8"> | |
var ft_id = INSERT_FUSION_TABLE_ID; | |
function Legend(controlDiv, name, title) { | |
// Set CSS for the control border | |
var controlUI = document.createElement('DIV'); | |
controlUI.style.cursor = 'default'; | |
controlUI.style.textAlign = 'left'; |
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
#keep track of the round number | |
round = 1 | |
while next_round: | |
if round == 1: | |
#the world is our oyster, keep track of all the candidates still in play and their 1st,2nd,3rd place votes | |
avail_candidate_list = all_candidates | |
#all the ballots in the race | |
ballots = all_ballots | |
dropped_candidates = [] | |
else: |
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
find DIR_PATH -type f -mmin +4320 -delete |
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 MapLegendView(el, values, headerText, footerText){ | |
/* | |
Class to dynamically generate a legend for a given map | |
el: containing element | |
values: array of key, value objects | |
ex: var legendItems = [ | |
{text: 'text to display next to color', colorStr: 'color of legend item (hex preferred)'}, | |
] | |
you'll want your container element and map to be contained in the same parent element | |
and to position the containing element to float over the map like so: |
OlderNewer