Skip to content

Instantly share code, notes, and snippets.

{ action_id: 53510,
action_code: 'https://tracking.crobo.com/aff_c?offer_id=29257&aff_id=19699',
network_id: 1052,
action_subid: 'UK-TTT5_17822',
random_ref: 1,
idfa_gaid: 1 }
var maxmind = require('maxmind');
const Promise = require('bluebird');
const geoip = {};
Promise.promisifyAll(maxmind);
geoip.userGeoInfo = function () {
//Async db calls
let ispsArr = mysql.IspWhitelist.findAll({
where:{iso_code:'GB'},
attributes: ['isp_name'],
}).then((isps) => {
let ispsArr=[];
isps.forEach(function(isp) {
ispsArr.push(isp.isp_name)
})
console.log(ispsArr) //Gives me the array
return ispsArr;
var ispsArr = mysql.IspWhitelist.findAll({
where:{iso_code:'GB'},
attributes: ['isp_name'],
}).then((isps) => {
let ispsArr=[];
isps.forEach(function(isp) {
ispsArr.push(isp.isp_name)
})
//console.log(ispsArr)
return ispsArr;
actionFilter.filterVisited = function (actions) {
actions.forEach(function (action_id) {
let actioncookiecap_key = 'actioncookiecap-'+action_id;
return cache.has(actioncookiecap_key).then(function(val){
if(val!==false){
let index = actions.indexOf(action_id);
actions.splice(index, 1);
async function has(id) {
const val = await cache.has(`actioncookiecap-${id}`);
return { val, id };
}
actionFilter.filterVisited = async function (actions) {
const results = await Promise.all(actions.map(has));
console.log(results) //Returns [ { val: false, id: 39708 }, { val: false, id: 39709 } ]
return results.filter(v => v.val).map(v => v.id);
}
const Promise = require('bluebird');
const mysql = require("../modules/mysql.js");
const es = require("../modules/es.js");
const cache = require("../modules/memcached.js");
const redis = require("../modules/redis.js");
const helpers = require("../modules/helpers.js");
const FpToMemcache = require("../modules/fptomemcache.js");
exports.iframe = function(req, res) {
FROM ubuntu:trusty
RUN apt-get update; apt-get clean
# Add a user for running applications.
RUN useradd apps
RUN mkdir -p /home/apps && chown apps:apps /home/apps
# Install x11vnc.
RUN apt-get install -y x11vnc
FROM ubuntu:trusty
RUN apt-get update; apt-get clean
# Add a user for running applications.
RUN useradd apps
RUN mkdir -p /home/apps && chown apps:apps /home/apps
# Install x11vnc.
RUN apt-get install -y x11vnc
Hericks-Mac-Pro:docker-chrome-vnc herickpaiva$ docker run -p 5900:5900 hmpmarketing/chrome-vnc:2
(EE)
Fatal server error:
(EE) Server is already active for display 1
If this server is no longer running, remove /tmp/.X1-lock
and start again.
(EE)
xvfb failed to start.