I hereby claim:
- I am not-an-aardvark on github.
- I am not_an_aardvark (https://keybase.io/not_an_aardvark) on keybase.
- I have a public key ASAIfVUSAjh_DpFTn6ysz8qjWkCSkJyC5E_2a3Tz2bK-HAo
To claim this, I am signing this object:
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" | |
}, |
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); |
/* Returns a wrapped version of `func` which calls `func` at most once every `delay` milliseconds. | |
** The wrapped function returns a Promise which resolves with the result of calling `func` after the delay has finished. | |
*/ | |
module.exports = (func, delay) => { | |
var lastTimestamp = -Infinity; | |
return function (...args) { | |
var now = Date.now(); | |
lastTimestamp = Math.max(now, lastTimestamp + delay); | |
return new Promise(resolve => setTimeout(resolve, lastTimestamp - now)).then(() => func.apply(this, args)); |
var Promise = require('bluebird'); | |
var examplePromise1 = Promise.delay(5000); | |
var examplePromise2 = Promise.delay(2000).return('myValue'); | |
// the following two are equivalent: | |
// 1. Async function (ES7, only available with a transpiler) | |
var func = async function (arg1, arg2, arg3) { | |
await examplePromise1; |
"use strict"; | |
//------------------------------------------------------------------------------ | |
// Requirements | |
//------------------------------------------------------------------------------ | |
const assert = require("assert"); | |
const lodash = require("lodash"); | |
const eslump = require("eslump"); | |
const SourceCodeFixer = require("eslint/lib/util/source-code-fixer"); |
'use strict'; | |
const fs = require('fs'); | |
const path = require('path'); | |
const PACKAGE_NAME = require('./package').name; | |
const SYMLINK_LOCATION = path.join(__dirname, 'node_modules', PACKAGE_NAME); | |
// Symlink node_modules/{package name} to this directory so that ESLint resolves this plugin name correctly. | |
if (!fs.existsSync(SYMLINK_LOCATION)) { | |
fs.symlinkSync(__dirname, SYMLINK_LOCATION); |
I hereby claim:
To claim this, I am signing this object:
from pymongo import MongoClient | |
from bson.objectid import ObjectId | |
db = MongoClient('mongodb://localhost:27017/').fapp | |
username_map = {} | |
reverse_map = {} | |
initial_list_of_users = [] | |
print "Beginning database migration.\nAccounting for users..." | |
for user in db.user.find({}): | |
username_map[str(user['_id'])] = user['name'] | |
reverse_map[user['name']] = str(user['_id']) |
"use strict"; | |
const crypto = require("crypto"); | |
const fetch = require("node-fetch"); | |
const BLOCK_SIZE = 16; | |
const PADDING_ORACLE_PAYLOAD = '","user":"admin"}'; | |
const padToBlockSize = text => { | |
const unpadded = Buffer.from(text, "binary"); |