Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am loganb on github.
  • I am loganb (https://keybase.io/loganb) on keybase.
  • I have a public key ASAGlXePrddeZWUAXmipbgX3NXysdTj3wAWp5CRZK-DyXQo

To claim this, I am signing this object:

@loganb
loganb / merge_join.rb
Last active September 7, 2015 20:54
Merge-Join in Ruby
STOP_SENTINEL = Object.new
#
# Merge joins +Enumerable+s +a+ and +b+ assuming they're in sorted order.
# +block+ should return the sort key for a given item.
#
# Method returns a new +Enumerable+ that is the merged list
#
def merge_on(a,b, &block)
a,b = a.to_enum, b.to_enum
@loganb
loganb / gist:6488882
Created September 8, 2013 22:09
meh: Like nil but always returns meh.
class MehClass
def method_missing(*args)
self
end
def !@
true
end
end
logan@bender (OSX) ~/Work/tapestry $ ruby test.rb
1: PASS
2: PASS
3: FAIL
4: PASS
5: FAIL
6: FAIL
7: FAIL
8: PASS
9: FAIL
function MyObject() {
this.x = 'somevalue';
}
var tmp = new MyObject();
tmp.x // <- 'somevalue'
<head>
<title>test page</title>
<script type='text/javascript' src='yui/build/yui/yui.js'></script>
</head>
<body>
<script type='text/javascript'>
var Y = YUI();
Y.use('base','node','event',function(Y) {
console.log('setting event');
Y.on('available',function(e) {
Y.use('io-xdr', function(Y) {
Y.io.transport({
id: 'flash',
yid: Y.id,
src: 'http://bender.local:8888/io.swf'
});
});
Y.use(function(Y) {
function doit() {