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
some stuff |
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') | |
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
# 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
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
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
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 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
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!"); | |
} | |
}); |
OlderNewer