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 _ = 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); |
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 = { | |
port: 1337, | |
environment: "development", | |
reddit: { | |
clientID: "CLIENTID GOES HERE", | |
clientIDSecret: "CLIENTIDSECRET GOES HERE", | |
redirectURL: "http://localhost:1337/auth/reddit/callback", | |
adminRefreshToken: "ADMINREFRESHTOKEN GOES HERE" | |
}, |
NewerOlder