Skip to content

Instantly share code, notes, and snippets.

var _ = require('lodash');
function losslessThrottle(func, wait) {
var scheduledCalls = [];
return function() {
// Add a timestamp to `scheduledCalls` signifying when the current invocation will take place.
// The last element of `scheduledCalls` will be the timestamp of the latest scheduled invocation, so the current
// invocation should occur `wait` milliseconds after that.
var scheduledTimestamp = _.max([_.last(scheduledCalls) + wait, _.now()]);
scheduledCalls.push(scheduledTimestamp);
module.exports = {
port: 1337,
environment: "development",
reddit: {
clientID: "CLIENTID GOES HERE",
clientIDSecret: "CLIENTIDSECRET GOES HERE",
redirectURL: "http://localhost:1337/auth/reddit/callback",
adminRefreshToken: "ADMINREFRESHTOKEN GOES HERE"
},