Skip to content

Instantly share code, notes, and snippets.

@photofroggy
photofroggy / bds.group.txt
Created April 14, 2014 00:07
Idea for a BDS protocol to allow private group chats on dAmn.
Ok, so, protocol for making private group chats possible on dAmn.
These messages must happen in a private chat between users and a service bot.
BDS:GROUP:NEW:user1[,user2[,...]]
Sent by clients.
Open a new group chat with the named users.
@photofroggy
photofroggy / bindingproof.js
Last active December 29, 2015 21:49
Proof of concept for a different kind of command binding API. Could this be done in Go? idk
/* Concept idea for command binding.
*
* This concept shows an idea for a way to bind commands
* and subcommands. A fairly simple API, if a little object
* heavy. Having this sort of system could make it easier to
* do things like have privilege levels for subcommands.
*/
/**
BDS data store category.
Implements a database with an API and defines behaviour of
clients and bots using the commands.
Commands must be used in a LINK.
Should probably provide a way to notify users of changes to the data store.
CATEGORY: BDS:STORE
pns = peer ns. Eg for pchats pns = pchat-user1-user2
BDS:PEER:LIST:[channel]
BDS:PEER:OPEN:user,pns,host,connections[,bds_channel]
BDS:PEER:END:user
BDS:PEER:REQUEST:user,pns
BDS:PEER:ACK:user,pns
BDS:PEER:REJECT:pns,user[,reason]
/**
* dAmn video extension.
*/
var dVideo = {};
dVideo.VERSION = '0.0.1';
dVideo.STATE = 'pre-alpha';
dVideo.extension = function( client ) {
this.window.find('.content').damuro({
splashText: 'Test...',
autoload: false
})
.one('click', function( ) { $(this).damuro().open(); } )
.damuro()
.done(function( data ) {})
.fail(function( data ) {});
settings.bds = {
// Main DSP channel.
mns: 'chat:datashare',
ns: [],
// Check if we should be processing messages from a given channel.
channel: function( ns ) {
if( !ns )
return false;
ns = client.format_ns(ns).toLowerCase();
return settings.bds.ns.indexOf( ns ) > -1;
// Get a reference to the client.
var wsc = $().wsc();
// Add a new extension.
wsc.add_extension( function( client ) {
// Create command /foo and provide a handler.
client.bind('cmd.foo', cmd_foo);
var cmd_foo = function( cmd ) {
@photofroggy
photofroggy / tablumps.py
Created December 19, 2012 04:22
Tablumps parsers using regex and string ops.
import re
import time
class ReTablumps(object):
""" dAmn tablumps parser.
dAmn sends certain information formatted in a specific manner.
Links, images, thumbs, and other forms of data are formatted
in strings where the different attributes of these values are
respire-air:wsc Henry$ git checkout dev
Switched to branch 'dev'
respire-air:wsc Henry$ git merge --no-ff setting-box
Merge made by recursive.
css/_control.scss | 80 +-
css/_helpers.scss | 45 +
css/_nav.scss | 123 ++-
css/_popup.scss | 24 +
css/_settings.scss | 152 +++
css/_theme_template.scss | 118 ++-