Skip to content

Instantly share code, notes, and snippets.

Making forums great again™

Andrew Rodrigues psychobunny

Making forums great again™
View GitHub Profile
psychobunny / index.js
Last active Jul 13, 2018
Add CSV list of user emails to a specific group in NodeBB
View index.js
"use strict";
modify these:
var inputFile = 'emails.csv';
var groupToJoin = 'global-moderators';
psychobunny / client.js
Created May 16, 2018
colorize usernames in nodebb according to group badge
View client.js
$(document).ready(function() {
function colorize() {
$('a[href*="/user/"').each(function() {
var link = $(this);
var username = link.attr('href').match(/\/user\/(\w+)/);
$.get('/api/user/' + username[1], function(data) {
// todo: check `data.groupTitle` and then find the matching group in `data.groups`
if (data.groups[0]) {
link.css({color: data.groups[0].labelColor});
psychobunny /
Created Jan 26, 2018
Step-by-step instructions on configuring NodeBB's Zendesk integration


Admin Control Panel

This plugin can be configured at NodeBB Admin -> Plugins -> Support Tickets.

psychobunny / import.js
Created Mar 2, 2016
Script: Deleting topics/posts from a JSON file containing pids and tids
View import.js
'use strict';
/*globals require, console, process */
var nconf = require('nconf');
var async = require('async');
file: 'config.json'
psychobunny /
Last active Jan 31, 2018
NodeBB Contributor License Agreement

NodeBB Individual Contributor Assignment Agreement

Thank you for your interest in contributing to an open source project run by NodeBB Inc. ("We" or "Us"). This NodeBB Individual Contributor Assignment Agreement ("Agreement") documents the rights granted by contributors to Us.

To make this document effective, please sign it and send it to Us by mail, email, or electronic submission, following the instructions at This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.

2. Grant of Rights

2.1 Copyright Assignment

psychobunny / 502.html
Created Sep 1, 2015
The NodeBB Community's 502 page
View 502.html
<title>The NodeBB Community Forum is Under Maintenance</title>
<link href=',500,700' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
background: #00A9EA;
color: white;
font-family: 'Ubuntu', sans-serif;
text-align: center;
psychobunny / templates.js
Created May 21, 2015
templates.js optimized
View templates.js
'use strict';
/*global require, module, self*/
(function(module) {
var templates = {
cache: {},
globals: {}
helpers = {},
psychobunny / core.js
Last active Aug 29, 2015
FlightJS inspired components system for NodeBB
View core.js
define('notifications', ['events', 'components'], function(events, components) {
var notifications = {};
notifications.init = function() {
events.initialize('notifications', function() {
this.register('icon.unread', markUnread);
this.register('', markRead);
psychobunny / debug.js
Last active Apr 16, 2020
NodeBB patch - Remove OP and replace it with first reply
View debug.js
// paste this in
// and then don't forget to remove it!
router.get('/remove-op', function(req, res) {
var db = require('../database'),
async = require('async');
db.getSortedSetRange('topics:tid', 0, -1, function(err, tids) {
async.eachLimit(tids, 50, function(tid, next) {
db.getSortedSetRange('tid:' + tid + ':posts', 0, 0, function(err, pid) {
psychobunny / partials.js
Created Feb 12, 2015
Client-side partials parsing
View partials.js
var matches = null,
regex = regex = /[ \t]*<!-- IMPORT ([\s\S]*?)? -->[ \t]*/g,
apiCalls = [],
matchList = [],
deferredObjects = [];
while((matches = regex.exec(html)) !== null) {
var deferredObject = $.Deferred();