Skip to content

Instantly share code, notes, and snippets.

# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@xhh
xhh / HTMLLayout.java
Created January 23, 2010 14:45
Fix html-not-escaped bug with logback's HTMLLayout
import static ch.qos.logback.core.CoreConstants.LINE_SEPARATOR;
import org.apache.commons.lang.StringEscapeUtils;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.pattern.Converter;
/**
* Extend the {@link ch.qos.logback.classic.html.HTMLLayout} to escape HTML content.<br/>
* TODO remove when the bug if fixed by logback. See http://jira.qos.ch/browse/LBCLASSIC-180