These mirror ember data methods. They are high level and aim to be useable by the API via the url query string etc. They follow jsonapi spec where appliable. They are:
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
<? | |
/** | |
* URL-ify | |
* Returns the value in a URL-ified version. | |
* @return string | |
*/ | |
function urlify($string) { | |
$string = strtolower($string); | |
$string = str_replace(array('*', '!', '&', '=', '/', '?'), '', $string); |
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 fs = require('fs') | |
, admittance = require('admittance') | |
//read from the text file where we store pairs of user ids and permissions | |
var storeR = fs.createReadStream(__dirname + '/my-store.txt') | |
//read in permissions | |
storeR.pipe(admittance) | |
//do a permissions check |
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
# installation commands | |
brew update | |
brew install postgresql | |
brew install postgis | |
# start the server | |
postgres -D /usr/local/var/postgres | |
# setup commands | |
createdb <name> |
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
#!/usr/bin/env node | |
'use strict'; | |
//Streaming parser that filters out osm data leaving just ways. | |
//Ways are then broken down into node pairs. | |
// | |
//ie. | |
//{ | |
// "type":"Feature", |
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
#!/usr/bin/env node | |
'use strict'; | |
var pg = require('pg') | |
, geojsonStream = require('geojson-stream') | |
, fs = require('fs') | |
, stdout = require('stdout-stream') | |
, through2 = require('through2') | |
, Q = require('q') |
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
#!/usr/bin/env node | |
'use strict'; | |
var through = require('through2') | |
, geojsonStream = require('geojson-stream') | |
, fs = require('fs') | |
, chalk = require('chalk') | |
, pg = require('pg') |
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
/** | |
* Requires leaflet | |
* Requires leaflet-geometryutil plugin loaded | |
* Requires leaflet-snap plugin loaded | |
*/ | |
//geojson guide layer, this is a linestring around the old town hall | |
var guideLayer = L.geoJson({ | |
"type": "FeatureCollection", | |
"features": [ |
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 findContract = _.flip(_.wrapCallback(Contract.findById.bind(Contract)), {remoteCtx: ctx}); | |
var findContractPeriods = _.flip(_.wrapCallback(ContractPeriod.find.bind(ContractPeriod)), {remoteCtx: ctx}); | |
var findContractPeriod = _.flip(_.wrapCallback(ContractPeriod.findById.bind(ContractPeriod)), {remoteCtx: ctx}); | |
var findReviews = _.flip(_.wrapCallback(Review.find.bind(Review)), {remoteCtx: ctx}); | |
var sendEmail = _.wrapCallback(sendReminderEmail); | |
var contractPeriodStream1 = findReviews(query).flatten().pluck('contractPeriodId').map(findContractPeriod); | |
var contractPeriodStream2 = findContractPeriods(query).flatten(); | |
contractPeriodStream1.merge(contractPeriodStream2) |
This file has been truncated, but you can view the full file.
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
<?xml version="1.0"?> | |
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"> | |
<channel> | |
<title>Media Releases</title> | |
<link>http://www.nzta.govt.nz/media-releases/rss</link> | |
<atom:link href="http://www.nzta.govt.nz/media-releases/rss" rel="self" type="application/rss+xml" /> | |
<description></description> | |
<item><title>Wellington highways closed due to surface flooding - update 11.45am</title><link>http://www.nzta.govt.nz/media-releases/wellington-highways-closed-due-to-surface-flooding-update-11-45am</link><pubDate>2016-11-15 11:45:00</pubDate><guid>http://www.nzta.govt.nz/media-releases/wellington-highways-closed-due-to-surface-flooding-update-11-45am</guid><description></description><category>Media release</category><category>Central</category></item> |
OlderNewer