This file contains hidden or 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
| // EmailService.js - in api/services | |
| var baby = require('babyparse'), | |
| fs = require('fs'), | |
| Promise = require("bluebird"), | |
| rp = require('request-promise'), | |
| moment = require('moment'), | |
| detect = require('detect-csv'), | |
| request = require('request'), | |
| strip_tags = require('striptags') | |
| ; |
This file contains hidden or 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
| <?php | |
| /** | |
| * Created by PhpStorm. | |
| * User: erm | |
| * Date: 24-04-15 | |
| * Time: 14:03 | |
| */ | |
| namespace Cronjob\Spider; | |
| use \Zend\Dom\Query; | |
| use Application\Model\Image; |
This file contains hidden or 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
| <?php | |
| namespace tasks; | |
| use enum\TaskTimes; | |
| use models\general\AdvertiserTask; | |
| use models\general\AdvertiserTaskQuery; | |
| use models\general\CampaignSignup; | |
| use models\general\CampaignTaskQuery; | |
| use models\general\Cap; |
This file contains hidden or 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
| <?php | |
| namespace tasks; | |
| interface iTask { | |
| /** | |
| * Method to enqueue the task. This should take params and values from the class that implements the interface, | |
| * given to the class by the constructor or other methods. | |
| **/ |
This file contains hidden or 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
| module.exports = { | |
| run:function() | |
| { | |
| Feed.find({}).then(function(feed) { | |
This file contains hidden or 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 counter = 0 // count when the foreach is done | |
| retailers.forEach(function(retailer) { | |
| retailer.siteid=siteid; | |
| retailer.month=month; | |
| retailer.year=year; | |
| prim_id =md5(siteid+month+year+retailer.storeid); | |
| retailer.prim_id=prim_id; | |
| //sails.log(retailer); | |
| Retailers.updateOrCreate({prim_id:prim_id},retailer,function createFindCB(error, createdOrFoundRecords){ |
This file contains hidden or 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
| parse: function(feed) { | |
| return new Promise(function(resolve, reject) { // wrap into function to return a promise | |
| sails.log.info('downloading feed ' + feed.id ); | |
| importcsv_service.parsecsvfeed.downloadfile(feed,csv_dir).then(function(file){ | |
| sails.log.info('file '+ feed.id +' downloaded succesfully'); | |
| return file; | |
| }).then(function(file) { | |
| console.log("reading" + file); | |
| importcsv_service.parsecsvfeed.convert_line_to_json(file).then(function(data) { |
This file contains hidden or 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 fileType = require('file-type'); | |
| var fs = require('fs'); | |
| var Stream = require('stream').Transform; | |
| var image_dest = sails.config.orangebuddies.settings.image_download_location; | |
| var thumb_dest = sails.config.orangebuddies.settings.image_thumbnail_location; | |
| var max_images_writes = sails.config.orangebuddies.settings.max_write_images; | |
| var product = require('../../services/mongoose_wrapper/product'); | |
| var path = require('path'); | |
| var request = require('request'); | |
| var async = require('async'); |
This file contains hidden or 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 page = 1, | |
| lastPage = 5000; // force sync, by incresing this counter | |
| async.whilst(function () { | |
| return page <= lastPage; | |
| }, | |
| function (next) { | |
| // BUSINESS LOGIC HERE | |
| // DON'T FORGET TO ADD page++ and next() into a callback |
This file contains hidden or 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
| // | |
| // CustomCell.swift | |
| // cheapveilingen | |
| // | |
| // Created by Erwin Nandpersad on 17-07-16. | |
| // Copyright © 2016 Cheapveilingen.nl. All rights reserved. | |
| // | |
| import UIKit | |
| import SocketIOClientSwift |