Skip to content

Instantly share code, notes, and snippets.

❤️
Making forums great again™

Andrew Rodrigues psychobunny

❤️
Making forums great again™
Block or report user

Report or block psychobunny

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@psychobunny
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";
/*
BACK UP YOUR DB BEFORE RUNNING
modify these:
*/
var inputFile = 'emails.csv';
var groupToJoin = 'global-moderators';
@psychobunny
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
psychobunny / Zendesk-README.md
Created Jan 26, 2018
Step-by-step instructions on configuring NodeBB's Zendesk integration
View Zendesk-README.md

Documentation

Admin Control Panel

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


@psychobunny
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');
nconf.file({
file: 'config.json'
});
@psychobunny
psychobunny / CLA.md
Last active Jan 31, 2018
NodeBB Contributor License Agreement
View CLA.md

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 https://github.com/NodeBB/NodeBB/blob/master/.github/CONTRIBUTING.md. 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
psychobunny / 502.html
Created Sep 1, 2015
The NodeBB Community's 502 page
View 502.html
<html>
<head>
<title>The NodeBB Community Forum is Under Maintenance</title>
<link href='http://fonts.googleapis.com/css?family=Ubuntu:400,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
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 = {},
loader,
@psychobunny
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('icon.read', markRead);
});
@psychobunny
psychobunny / debug.js
Last active Aug 29, 2015
NodeBB patch - Remove OP and replace it with first reply
View debug.js
// paste this in https://github.com/NodeBB/NodeBB/blob/master/src/routes/debug.js
// 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
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();
deferredObjects.push(deferredObject);
You can’t perform that action at this time.