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
function findAddr(){ | |
var address = $("#search_text").val() | |
geocoder.geocode({ 'address': address }, function (results, status) { | |
if (status == google.maps.GeocoderStatus.OK) { | |
if(cur_marker != null){ | |
cur_marker.setMap(null); | |
} | |
//Create the Map and center to geocode results latlong | |
var latlng = new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng()); | |
var queryText = encodeURIComponent("SELECT 'PRECNAME' FROM "+precinct_ft+" WHERE ST_INTERSECTS(geometry, CIRCLE(LATLNG("+latlng.lat()+","+latlng.lng()+"),1))"); |
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
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
mysql -u<USERNAME> -p<PASSWORD> <DB_NAME> -e "show tables" | \ | |
grep -v Tables_in|awk '{print "ALTER table",$1" ENGINE=InnoDB;"}' |
NewerOlder