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
/*globals require, console, process */ | |
'use strict'; | |
var nconf = require('nconf'); | |
var async = require('async'); | |
nconf.file({ | |
file: 'config.json' | |
}); |
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
'use strict'; | |
/*globals require, console, process */ | |
var nconf = require('nconf'); | |
var async = require('async'); | |
var winston = require('winston'); | |
nconf.file({ |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <windows.h> | |
void doTheHack() | |
{ | |
FILE *pFile; | |
FILE *pOut; | |
char *buffer; | |
long fileSize; | |
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
'use strict'; | |
/*globals require, console, process */ | |
var nconf = require('nconf'); | |
var async = require('async'); | |
nconf.file({ | |
file: 'config.json' | |
}); |
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
ratelimit.rateLimitReq = function(req, res, next) { | |
if (!req.session) { | |
return next(); | |
} | |
req.session.lastRequestTime = req.session.lastRequestTime || 0; | |
var now = Date.now(); | |
if (now - req.session.lastRequestTime < 200) { | |
if (res.locals.isAPI) { | |
res.status(429).json('too-many-requests'); |
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
'use strict'; | |
/*globals require, console, process */ | |
var nconf = require('nconf'); | |
var async = require('async'); | |
nconf.file({ |
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
#mongodb queries | |
db.objects.find({ $and: [ | |
{ _id: { $gt: ObjectId("5b06052649f0a0999558b960")} }, | |
{ _key: { $not: /^anal.*/ } }, | |
{ _key: { $not: /^group.*/ } }, | |
{ _key: { $not: /^user/ } }, | |
{ _key: { $not: /^post/ } }, | |
{ _key: { $not: /^topic/ } }, | |
{ _key: { $not: /^chat/ } }, |
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
'use strict'; | |
/*globals require, console, process */ | |
var nconf = require('nconf'); | |
var async = require('async'); | |
var fs = require('fs'); | |
nconf.file({ | |
file: 'config.json' |
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
//use filter:topics.get in plugin.json | |
//{ "hook": "filter:topics.get", "method": "addMainPostContent"} | |
module.addMainPostContent = function(data, callback) { | |
var topics = data.topics; | |
var keys = topics.map(function(topic) { | |
return topic && 'topic:' + topic.tid; | |
}); |
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 nconf = require('nconf'); | |
var async = require('async'); | |
var fs = require('fs'); | |
nconf.file({ | |
file: 'config.json' | |
}); |