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
version: "3" | |
services: | |
mongo1: | |
hostname: mongo1 | |
container_name: localmongo1 | |
image: mongo:4.0-xenial | |
expose: | |
- 27017 | |
ports: | |
- 27011:27017 |
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
import { createClient, GoogleMapsClient } from '@google/maps'; | |
export class GeoCodingService { | |
private geoCoder: GoogleMapsClient; | |
public constructor() { | |
this.geoCoder = createClient({ | |
key: 'YOUR-API-KEY', | |
}); |
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
/* | |
A kludgey example of how to use FullStory with AngularJS. | |
Just shove it into .run :-) | |
Do with it as you please, but use at your own risk. | |
This is not officially sanctioned code and intended to provide an example | |
of how FullStory is implemented in an Angular application. | |
*/ | |
(function(){ | |
'use strict'; |
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
{ | |
"ABIA": [ | |
[5.3918045732398, 7.3196411132812], | |
[5.4246168391946, 7.3388671875], | |
[5.4437565043427, 7.3663330078125], | |
[5.5285105256928, 7.4020385742188], | |
[5.6282859838703, 7.4006652832031], | |
[5.6856833027592, 7.3814392089844], | |
[5.6952489676056, 7.4020385742188], | |
[5.8428131655266, 7.3855590820312], |
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 mongoose = require('mongoose'); | |
var repository = function (modelName) { | |
var self = this; | |
self.Model = require('../models/' + modelName); | |
self.FindById = function (id, cb) { | |
self.FindOne({ |
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
// String utils | |
// | |
// resources: | |
// -- mout, https://github.com/mout/mout/tree/master/src/string | |
/** | |
* "Safer" String.toLowerCase() | |
*/ | |
function lowerCase(str) { | |
return str.toLowerCase(); |
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
// snippet taken from http://catapulty.tumblr.com/post/8303749793/heroku-and-node-js-how-to-get-the-client-ip-address | |
function getClientIp(req) { | |
var ipAddress; | |
// The request may be forwarded from local web server. | |
var forwardedIpsStr = req.header('x-forwarded-for'); | |
if (forwardedIpsStr) { | |
// 'x-forwarded-for' header may return multiple IP addresses in | |
// the format: "client IP, proxy 1 IP, proxy 2 IP" so take the | |
// the first one | |
var forwardedIps = forwardedIpsStr.split(','); |
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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |