Skip to content

Instantly share code, notes, and snippets.

View psychobunny's full-sized avatar
❤️
Making forums great again™

Andrew Rodrigues psychobunny

❤️
Making forums great again™
View GitHub Profile
@psychobunny
psychobunny / widget.html
Created February 21, 2014 07:33
[nodebb-script-snake] Embed a Snake Flash game on your NodeBB forum
<embed src="http://www.neave.com/games/get_game.php?swf=snake" name="neaveSnake" width="100%" quality="high" pluginspage="http://get.adobe.com/flashplayer/" type="application/x-shockwave-flash" allowscriptaccess="always"></embed>
@psychobunny
psychobunny / twitch-pokemon.html
Created February 21, 2014 18:50
[nodebb-script-pokemon-twitch] Twitch plays Pokemon, on your NodeBB forum!
<object data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=twitchplayspokemon" height="250" id="live_embed_player_flash" type="application/x-shockwave-flash" width="100%"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" /><param name="flashvars" value="hostname=www.twitch.tv&amp;channel=twitchplayspokemon&amp;auto_play=true&amp;start_volume=0" /></object>
@psychobunny
psychobunny / comments.php
Created May 24, 2014 00:50
Wordpress integration with NodeBB
<?php
if ( post_password_required() )
return;
?>
<a id="nodebb/comments"></a>
<script type="text/javascript">
var nodeBBURL = 'http://forum.burnaftercompiling.com',
articleID = '<?php echo the_ID(); ?>';
@psychobunny
psychobunny / 502.html
Created September 1, 2015 03:47
The NodeBB Community's 502 page
<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 18:19
templates.js optimized
'use strict';
/*global require, module, self*/
(function(module) {
var templates = {
cache: {},
globals: {}
},
helpers = {},
loader,
@psychobunny
psychobunny / core.js
Last active August 29, 2015 14:18
FlightJS inspired components system for NodeBB
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 / partials.js
Created February 12, 2015 16:43
Client-side partials parsing
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);
@psychobunny
psychobunny / mongo-ltrim.js
Created July 28, 2014 18:17
redis-like LTRIM for mongodb
module.listLTrim = function(key, start, stop, callback) {
module.getListRange(key, start, stop, function(err, value) {
if(err) {
if(typeof callback === 'function') {
return callback(err);
}
return;
}
db.collection('objects').update({_key: key }, {$set: value}, function(err, result) {
{
"id": "nodebb-plugin-blog-comments",
"name": "NodeBB Blog Comments",
"description": "Lets NodeBB act as a comments engine/widget for your blog.",
"url": "https://github.com/psychobunny/nodebb-plugin-blog-comments",
"library": "./library.js",
"hooks": [
{
"hook": "filter:admin.header.build", "method": "addAdminLink"
},
{
"categories": [
{
"cid": "1",
"name": "Announcements",
"description": "Announcements regarding our community",
"icon": "fa-bullhorn",
"bgColor": "#0059B2",
"color": "#fff",
"slug": "1/announcements",