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
module.exports.bootstrap = function(cb) { | |
_.extend(sails.hooks.http.app.locals, sails.config.http.locals); | |
// add the lines from here | |
// bootstrapping all the cronjobs in the crontab folder | |
var schedule = require('node-schedule'); | |
sails.config.crontab.crons().forEach(function(item){ | |
schedule.scheduleJob(item.interval,sails.config.crontab[item.method]); | |
}); |
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
<script> | |
module.exports.bootstrap = function(cb) { | |
_.extend(sails.hooks.http.app.locals, sails.config.http.locals); | |
// add the lines from here | |
// bootstrapping all the cronjobs in the crontab folder | |
var schedule = require('node-schedule'); | |
sails.config.crontab.crons().forEach(function(item){ | |
schedule.scheduleJob(item.interval,sails.config.crontab[item.method]); |
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
// | |
// FirstViewController.swift | |
// cheapveilingen | |
// | |
// Created by Erwin Nandpersad on 17-07-16. | |
// Copyright © 2016 Cheapveilingen.nl. All rights reserved. | |
// http://stackoverflow.com/questions/23193087/using-timer-in-a-tableview-re-creates-the-timer-after-any-scroll-or-table-reload | |
import UIKit | |
import SwiftyJSON |
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
// | |
// CustomCell.swift | |
// cheapveilingen | |
// | |
// Created by Erwin Nandpersad on 17-07-16. | |
// Copyright © 2016 Cheapveilingen.nl. All rights reserved. | |
// | |
import UIKit | |
import SocketIOClientSwift |
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 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 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 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 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 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 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. | |
**/ |
OlderNewer