This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- this is how you generate unique DOM IDs in XSLT for use in generating HTML --> | |
<!-- generate the unique ID with "uid-" prefix and assign it to the uid variable --> | |
<xsl:variable name="uid"> | |
<xsl:value-of select="concat('uid-',generate-id(.))"/> | |
</xsl:variable> | |
<!-- now use the unique id to generate a <label>-<select> pair --> | |
<label for="{$uid}">Menu:</label> | |
<select id="{$uid}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- footnote heeds to toggle the corresponding footnote div --> | |
<xsl:template match="aos:footnote" mode="aos-content"><xsl:variable name="footnoteNumber"><xsl:apply-templates select="." mode="get-footnote-number"/></xsl:variable><sup id="footnote-{$footnoteNumber}-link" class="footnote-link"><a href="#" onclick="revealFootnote('#footnote-{$footnoteNumber}'); return false"><xsl:value-of select="$footnoteNumber"/></a></sup> | |
</xsl:template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here's how to do basic integer<->byte (string/char) operations in JavaScript. | |
// Took me a good while to dig this up. | |
function intToChar(integer) { | |
return String.fromCharCode(integer) | |
} | |
function charToInt(char) { | |
return char.charCodeAt(0) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'ruby-debug' | |
#gem 'camping', '~> 2.0' | |
#gem 'reststop', '~> 0.3' | |
$: << '../../camping-camping/lib' | |
$: << '../lib' | |
require 'camping-unabridged' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
rollcall = new S3.Rollcall('http://proto.encorelab.org:7070') | |
token = rollcall.getCurrentToken() | |
rollcall.fetchSessionForToken(token, function(data) { | |
console.log(data.session.user.username) | |
console.log(data.session.user.encrypted_password) | |
// log in to xmpp from here using those credentials | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uses jquery.url.js --> https://github.com/allmarkedup/jQuery-URL-Parser | |
var S3 = window.S3 || {} | |
S3.Rollcall = function(url) { | |
this.url = url | |
} | |
S3.Rollcall.prototype = { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'xmpp4r/client' | |
require 'xmpp4r/roster' | |
require 'colored' | |
require 'pp' | |
include Jabber | |
Jabber.debug = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'blather/client' | |
# CONFIGURATION | |
jid = 'tester@proto.encorelab.org' | |
password = "foofoo" | |
chatroom = "s3@conference.proto.encorelab.org" | |
setup(jid, password) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rollcall = new Rollcall.Client('http://rollcall.aardvar.encorelab.org') | |
token = rollcall.getCurrentToken() | |
if (token) { | |
rollcall.fetchSessionForToken(WallCology.token, function(data) { | |
session = data.session | |
// The session hash has the user's account info in it. At this point | |
// we can assume the user is authenticated. | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Let Rollcall take care of asking the user for their login and password. | |
*/ | |
if ($_REQUEST['token']) | |
$token = $_REQUEST['token']; | |
elseif ($_SESSION['token']) | |
$token = $_SESSION['token']; | |
else | |
$token = null; |
OlderNewer