Skip to content

Instantly share code, notes, and snippets.

View jamesbarnett's full-sized avatar

Jim Barnett jamesbarnett

View GitHub Profile
@jamesbarnett
jamesbarnett / f-bomb-filter.js
Last active March 12, 2020 07:17
Filters out F-Bombs from e-chat
var lastWarningTimestamp = null;
var delayInterval = 15; // The interval in seconds
var languageViolationLedger = {};
var checkLastWarning = function(msg) {
console.log("lastWarningTimestamp: " + lastWarningTimestamp + ", Date.now() " + Date.now() / 1000);
if (Date.now() / 1000 - lastWarningTimestamp > delayInterval) {
CometdRoom.sendMessage(msg);
lastWarningTimestamp = Date.now() / 1000;
@jamesbarnett
jamesbarnett / justKickNonFriends.js
Last active February 17, 2020 14:21
Kicks all people that are not NCs friend
var friendsOnly = function(x) {
if (!FriendsController.isFriends(x.data.userUuid)) {
CometdModerator.kickAccount(x.data.userUuid);
CometdModerator.removeAccountMessages(x.data.userUuid);
}
};
var friendsOnlyListener = $.cometd.addListener('/chatroom/user/joined/*', friendsOnly);
@jamesbarnett
jamesbarnett / friendsOnly.js
Created February 17, 2020 11:14
Friends Only Shields
var friends_only = function(x) {
var friends = x.data.friends;
var userUuid = x.data.userUuid;
if (FriendsController.isFriends(userUuid)) {} else {
CometdModerator.banAccount(userUuid);
setTimeout(function(x){CometdModerator.unbanAccount((userUuid))}, 10000);
};
};
$.cometd.addListener('/chatroom/user/joined/*', friends_only)
@jamesbarnett
jamesbarnett / friendsOnly.js
Created February 17, 2020 11:14
Friends Only Shields
var friends_only = function(x) {
var friends = x.data.friends;
var userUuid = x.data.userUuid;
if (FriendsController.isFriends(userUuid)) {} else {
CometdModerator.banAccount(userUuid);
setTimeout(function(x){CometdModerator.unbanAccount((userUuid))}, 10000);
};
};
$.cometd.addListener('/chatroom/user/joined/*', friends_only)
@jamesbarnett
jamesbarnett / friendsOnly.js
Created February 17, 2020 11:14
Friends Only Shields
var friends_only = function(x) {
var friends = x.data.friends;
var userUuid = x.data.userUuid;
if (FriendsController.isFriends(userUuid)) {} else {
CometdModerator.banAccount(userUuid);
setTimeout(function(x){CometdModerator.unbanAccount((userUuid))}, 10000);
};
};
$.cometd.addListener('/chatroom/user/joined/*', friends_only)
@jamesbarnett
jamesbarnett / gist:9106565
Created February 20, 2014 03:23
First stab at a Makefile for building libcinder apps on Mavericks
CC=g++
CFLAGS=-g -Wall -std=c++11 -I/usr/local/include -I/Users/jbarnett/cinder/include
LIBPATH += -L"/System/Library/Frameworks/CoreLocation.framework/Resources"
LIBPATH += -L"/System/Library/Frameworks/Accelerate.framework/Resources"
LIBPATH += -L"/System/Library/Frameworks/ApplicationServices.framework/Resources"
LIBPATH += -L"/System/Library/Frameworks/QuickTime.framework/Resources"
LIBPATH += -L"/System/Library/Frameworks/Carbon.framework/Resources"
LIBPATH += -L"/System/Library/Frameworks/Cocoa.framework/Resources"
LIBPATH += -L"/System/Library/Frameworks/OpenGL.framework/Libraries"