Skip to content

Instantly share code, notes, and snippets.

@visfleet
visfleet / performance_of_yaml_vs_marshal.rb
Created September 22, 2009 05:55
Performance comparison of Ruby's YAML vs Marshal
require 'benchmark'
require 'yaml'
def encode(msg, format)
case format
when :yaml
str = msg.to_yaml
when :binary
str = Marshal.dump(msg)
end
@visfleet
visfleet / BreakDNSSD.rb
Created December 21, 2009 02:47
Breaks DNSSD
require 'rubygems'
require 'eventmachine'
require 'logger'
require 'dnssd'
# The following gist stops DNSSD from registering a service. On Mac OS X you
# can run:
# > dns-sd -B
# to see services being added and removed. Or altnatively look in Safari's Bonjour
# bookmark. When working you'll see a 'BreakDNSSD' service being added, and only
package iv.collections {
import flash.events.IEventDispatcher;
import flash.utils.Dictionary;
import mx.collections.IList;
import mx.events.CollectionEvent;
import mx.events.CollectionEventKind;
import mx.events.PropertyChangeEvent;
package iv {
/**
* Adds some simple String manipulation doofers that are missing from Flex standard libs
* @author grant
*
*/
public class StringHelper {
/**