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
| # chef stuff to install elastic search | |
| # based on https://www.digitalocean.com/community/articles/how-to-install-elasticsearch-on-an-ubuntu-vps | |
| # install oracle java (with help from http://jamie.mccrindle.org/2013/07/installing-oracle-java-7-using-chef.html) | |
| execute "add oracle java repo" do | |
| command '/usr/bin/add-apt-repository -y ppa:webupd8team/java && /usr/bin/apt-get update' | |
| not_if "test -x /etc/apt/sources.list.d/webupd8team-java-precise.list" | |
| end | |
| execute "accept-license" do |
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
| ko.applyBindings({ | |
| fastClickResult: ko.observable("Waiting..."), | |
| clickResult: ko.observable("Waiting..."), | |
| handleClick: function(self, event) { | |
| self.clickResult("Clicked!"); | |
| }, | |
| handleFastClick: function(self, event) { | |
| self.fastClickResult("Fast Clicked!"); | |
| } | |
| }); |
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 map = new OpenLayers.Map('map_container', { | |
| allOverlays: true, | |
| displayProjection: new OpenLayers.Projection("EPSG:4326")}), | |
| esriOcean = new OpenLayers.Layer.XYZ("ESRI Ocean Basemap", | |
| "http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/${z}/${y}/${x}", | |
| { | |
| sphericalMercator: true, | |
| isBaseLayer: true, | |
| numZoomLevels: 13 |
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 geo = new Ext.util.GeoLocation({ | |
| autoUpdate: false, | |
| listeners: { | |
| locationupdate: function(geo) { | |
| refreshRoutes(geo.latitude, geo.longitude); | |
| }, | |
| locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) { | |
| if (bTimeout) { | |
| alert('Timeout occurred.'); | |
| } else { |
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 trimet = require('../lib/trimet.js'), | |
| should = require('should'); | |
| describe('trimet: get nearest routes from coordinate', function() { | |
| describe('getRoutesByPoint', function() { | |
| it('should return some points', function(done) { | |
| var lat = 45.499541, | |
| lon = -122.613639, | |
| expectedRoutes = [{ | |
| route: 9, |
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
| SELECT "RTE" as route, "RTE_DESC" as description, | |
| min(distance(PointFromText('POINT(-122.613639 45.499541)', 4326), the_geom)) as distance | |
| from tm_routes group by route, description | |
| order by distance limit 10; |
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
| # install node | |
| brew install node | |
| # install redis | |
| brew install redis | |
| # install npm | |
| curl http://npmjs.org/install.sh | sh | |
| # install mocha and should for testing |
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
| # install node | |
| brew install node | |
| # install redis | |
| brew install redis | |
| # install npm | |
| curl http://npmjs.org/install.sh | sh | |
| # install mocha and should for testing |
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
| from annoying.decorators import render_to | |
| @render_to('hero.html') | |
| def home(request): | |
| return {} |
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 os | |
| SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) | |
| TEMPLATE_DIRS = ( | |
| # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". | |
| # Always use forward slashes, even on Windows. | |
| # Don't forget to use absolute paths, not relative paths. | |
| os.path.join(SITE_ROOT, 'templates') | |
NewerOlder