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
# get all ice rings from Cote-Des-Neiges | |
-X GET /cdn/patinoires/ | |
# get all ice rings | |
-X GET /patinoires | |
# get all open ice rings | |
-X GET /patinoires/?open=true | |
# get geolocation of the ice rings in Code-Des-Neiges | |
-X GET /cdn/patinoires/locations |
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
var ndg = new montreal.data.arrondissement("Côte-des-Neiges - Notre-Dame-de-Grâce") | |
var patinoires = new montreal.data.patinoires(); | |
patinoires.filter(ndg, function(patinoire) { | |
console.log(patinoire.location); | |
if (patinoire.open) | |
console.log(patinoire.condition); | |
}); |
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 1 column, instead of 3. in line 3.
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
Source : Ville de Montréal | |
URL : http://donnees.ville.montreal.qc.ca/archives/fiche-donnees/elections-2009-section-vote-par-adresse | |
AdrComplete1;AdrComplete2;NoArrondissement;Arrondissement;NoDistrict;District;Section;BVA;BVA-Description;BVA-Adresse1;BVA-Adresse2;BVA-Adresse3;BVO;BVO-Description;BVO-Adresse1;BVO-Adresse2;BVO-Adresse3;NoCiv;NoCivAlpha;NoApp;NoAppAlpha;Specifique;Direction;Generique;Particule;CodePostal;Lot;Matricule;VilleProv;NbElecteurs | |
7180 avenue des Acacias;Anjou Qc H1J 2B4;2;d'Anjou;21;Ouest (Anjou);13;A-021-01;?COLE JACQUES-ROUSSEAU;7455, rue Jarry est;Anjou (Qc) H1J 1G8;Gymnase;S-021-02;?COLE JACQUES-ROUSSEAU;7455, rue Jarry Est;Anjou (Qc) H1J 1G8;Gymnase;7180;;;;Acacias;;avenue;des;H1J2B4;; ;Anjou;2; | |
7181 avenue des Acacias;Anjou Qc H1J 2B4;2;d'Anjou;21;Ouest (Anjou);13;A-021-01;?COLE JACQUES-ROUSSEAU;7455, rue Jarry est;Anjou (Qc) H1J 1G8;Gymnase;S-021-02;?COLE JACQUES-ROUSSEAU;7455, rue Jarry Est;Anjou (Qc) H1J 1G8;Gymnase;7181;;;;Acacias;;avenue;des;H1J2B4;; ;Anjou;2; | |
7190 av |
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
upstream test { | |
server localhost:8080; | |
} | |
server { | |
... | |
error_page 401 =403 /login; | |
location ~ ^/model/(.*)$ { | |
auth_basic "Restricted"; | |
auth_basic_user_file conf/htpasswd; |
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
$.ajax( { | |
url : '/model/user.json', | |
dataType : 'json', | |
beforeSend : function(xhr) { | |
var bytes = Crypto.charenc.Binary.stringToBytes(username + ":" + password); | |
var base64 = Crypto.util.bytesToBase64(bytes); | |
xhr.setRequestHeader("Authorization", "Basic " + base64); | |
}, | |
error : function(xhr, ajaxOptions, thrownError) { | |
reset(); |
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
render : function(view, model, callback) { | |
cst.model = model; | |
cst.view = view; | |
try { | |
var html = Mustache.to_html(view, model); | |
callback.call(this, html); | |
} catch (error) { | |
onError('Error while rendering template.'); | |
} | |
} |
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
<h1>{{header}}</h1> | |
{{#items}} | |
{{#first}} | |
<li> | |
<strong>{{name}}</strong> | |
</li> | |
{{/first}} | |
{{#link}} | |
<li> |
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
{ | |
"header": "Colors", | |
"items": [ | |
{"name": "red", "first": true, "url": "#Red"}, | |
{"name": "green", "link": true, "url": "#Green"}, | |
{"name": "blue", "link": true, "url": "#Blue"} | |
], | |
"empty": false | |
} |
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
/* foo.js */ | |
var date = new Date(); | |
exports.Date = date; | |
/* bar.js */ | |
var foo = require('./foo.js'); | |
exports.Date = foo.Date; | |
/* foobar.js */ |
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
var libpath = require('path'), | |
http = require("http"), | |
fs = require('fs'), | |
url = require("url"), | |
mime = require('mime'); | |
var path = "."; | |
var port = 8088; | |
http.createServer(function (request, response) { |