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
upstream test { | |
server localhost:8080; | |
} | |
server { | |
... | |
error_page 401 =403 /login; | |
location ~ ^/model/(.*)$ { | |
auth_basic "Restricted"; | |
auth_basic_user_file conf/htpasswd; |
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
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); | |
}); |
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
[provider_1] | |
type=peer | |
host=192.168.137.56 | |
dtmfmode=inband | |
canreinvite=no | |
qualify=1000 | |
disallow=all | |
allow=ulaw | |
[provider_2] |
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
globals { | |
// configure the limits for each provider | |
provider_1_limit=1; | |
provider_2_limit=4; | |
// no more edit beyond this point | |
provider_1_count=0; | |
provider_2_count=0; | |
}; |
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
context multi-provider { | |
_X. => { | |
if (${GLOBAL(provider_1_limit)} > ${GLOBAL(provider_1_count)}) { | |
Set(PROVIDER_CONTEXT=provider_1); | |
} | |
else if (${GLOBAL(provider_2_limit)} > ${GLOBAL(provider_2_count)}) { | |
Set(PROVIDER_CONTEXT=provider_2); | |
} | |
else { | |
Congestion(); |
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
#!/bin/bash | |
if [ -e /etc/asterisk/enabled/$1.conf ] ; then | |
echo "#include /etc/asterisk/enabled/$1.conf"; | |
fi | |
if [ -e /etc/asterisk/enabled/$1/ ] ; then | |
find /etc/asterisk/enabled/$1/ -name '*.conf' -exec echo "#include {}" \; | |
fi |
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
VERBOSE=true | |
ASTERISK_LOAD_SCRIPT='/usr/bin/asterisk-load' | |
ASTERISK_ETC='/etc/asterisk' | |
AVAILABLE=ASTERISK_ETC + "/available" | |
ENABLED=ASTERISK_ETC + "/enabled" | |
DISABLED=ASTERISK_ETC + "/disabled" | |
directory AVAILABLE |