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
production: | |
solr: | |
# Kieran's laptop's (obfuscated!) ip address. | |
# I'm lazy. I usually ascertain it from http://whatismyip.com/ | |
hostname: 86.00.00.000 | |
port: 8980 | |
log_level: WARNING |
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
# mod_rewrite preamble: | |
RewriteEngine On | |
RewriteBase /shop | |
# The following rule omits anything that actually really maps to a file or folder. | |
RewriteCond %{SCRIPT_FILENAME} !-f | |
RewriteCond %{SCRIPT_FILENAME} !-d | |
# Anything that's not the above, we route to index.php with the path in "readablePath" | |
RewriteRule (.*) index.php?readablePath=$1 [L,QSA] |
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
use strict; | |
use mySociety::GeoUtil qw/national_grid_to_wgs84/; | |
while (<>) { | |
my @x=split(/,/); # split csv | |
my ($pc, $east, $north) = ($x[0], $x[10], $x[11]); | |
$pc=~s/\"//g; # remove quotes around postcode | |
my ($lat, $lng) = national_grid_to_wgs84($east, $north, "G"); # "G" means Great Britain | |
print "$pc,$lat,$lng\n"; | |
} |
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
use strict; | |
use mySociety::GeoUtil qw/national_grid_to_wgs84/; | |
use CAM::DBF; | |
my $filename = $ARGV[0]; | |
my $dbf = CAM::DBF->new($filename); | |
# Double-check the data is as we expect. | |
my @fieldnames = $dbf->fieldnames(); | |
die if $fieldnames[0] ne "PC1" || $fieldnames[6] ne "X" || $fieldnames[7] ne "Y"; |
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 flushThis(id){ | |
var msie = 'Microsoft Internet Explorer'; | |
var tmp = 0; | |
var elementOnShow = document.getElementById(id); | |
if (navigator.appName == msie){ | |
tmp = elementOnShow.parentNode.offsetTop + 'px'; | |
}else{ | |
tmp = elementOnShow.offsetTop; | |
} | |
} |
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 Event < ActiveRecord::Base | |
... | |
has_many :options, :class_name => "EventOption", ... | |
... | |
end | |
class EventOption < ActiveRecord::Base | |
... | |
belongs_to :event | |
... |
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
<%= form_for @event, :url => (@event.new_record? ? events_path : event_path(@event)) do |f| %> | |
... | |
<%= f.fields_for :options, @event.options do |f2| %> | |
... | |
<%= f2.text_field :name %> | |
... | |
<$ end %> | |
... | |
<% end %> |
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 Event < ActiveRecord::Base | |
... | |
has_many :options, :class_name => "EventOption", ... | |
accepts_nested_attributes_for :options | |
... | |
end |
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
<div id="flip" class="container"> | |
<div class="loading" style="position: absolute; left: 100px; top: 200px; font-size: 15px;"> | |
<div id="loading">loading...</div> | |
</div> | |
</div> | |
... | |
<script type="text/javascript"> | |
$(function () { |
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
--- a/jquery.flips.js | |
+++ b/jquery.flips.js | |
@@ -140,7 +140,7 @@ | |
if( this.History.getState().url.queryStringToJSON().page !== page ) { | |
- this.History.pushState( null, null, '?page=' + page ); | |
+ // this.History.pushState( null, null, '?page=' + page ); |