Skip to content

Instantly share code, notes, and snippets.

View raganwald's full-sized avatar

Reg Braithwaite raganwald

View GitHub Profile
View gist:89
with(define_macros) {
if Merb.logger.level == Merb::Logger::DEBUG
def debug(string)
Merb.logger.debug "Foo"
end
else
def debug(string) end
end
}
View gist:90
merb_core = macros {
if Merb.logger.level == Merb::Logger::DEBUG
def debug(string)
Merb.logger.debug "Foo"
end
else
def debug(string) end
end
}
@raganwald
raganwald / gist:1653890
Created January 21, 2012 20:27 — forked from panicsteve/gist:1641705
Form letter template for open source abandonware
View gist:1653890
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
@raganwald
raganwald / gist:3932975
Created October 22, 2012 17:56
Discrepancy between CoffeeScript on Node and "Try CoffeeScript"
View gist:3932975
This CoffeeScript:
name = 'clyde'
do ->
"Hello #{name}" for name in ['algernon', 'sabine', 'rupert', 'theodora']
name
Complies to this on CoffeeScript under Node:
(function() {
@raganwald
raganwald / gist:3976679
Created October 29, 2012 21:33 — forked from thejohnnybot/gist:3976278
Date Issue
View gist:3976679
class Store
constructor: () ->
@services = []
@reservations = []
@requests = []
class Service
constructor: (@name, @time) ->
class Request
@raganwald
raganwald / speaker_proposal.md
Created November 17, 2012 17:01
Speaker Proposal
View speaker_proposal.md

Be different, be unique, be yourself. Inspire us.

Hello, this is Reg Braithwaite, also known to Rubyists as raganwald. You may know me from such conferences as RubyFringe, Stack Overflow Tech Days, CUSEC, and Øredev. I'm passionate about programming and I'll go anywhere to share that passion, like Microsoft Tech Days and True North PHP where I delivered a keynote.

Enough about me. Here's my talk: Succeeding with Ruby in a Post-Rails World.

I propose to talk about working with Ruby in a world where Rails has become a legacy application, where JavaScript, CoffeeScript, Go, and TypeSafe vying to become the new hotnesses, and the patterns we learned writing Rails applications seem dated in a world where programmers are thinking in promises, reactive programming, and big data.

@raganwald
raganwald / speaker_proposal.md
Created November 17, 2012 20:42
Speaker Proposal
View speaker_proposal.md

Be different, be unique, be yourself. Inspire us.

I've already proposed Succeeding with Ruby in a Post-Rails World. This is a second proposal. I'm quite prepared to deliver either or both of these talks.

The subject of this talk is Everything you always wanted to know about Ruby Combinators, but were afraid to ask. It will begin with a review of combinatory logic and some of the straightforward applications in Ruby such as .tap, .into, and hopelessly egocentric null objects.

The first part of the talk is covered in "Kestrels, Quirky Birds, and Hopeless Egocentricity" (If you are a conference organizer, and you haven't read it, please email reg@braythwayt.com and I'll send you a copy). The second part of the talk will move in some new directions, talking about applying combinators to contemporary patterns such as DCI and method combinators.

@raganwald
raganwald / bluebird.js
Created December 11, 2012 12:44
The compose function is called B or "The Bluebird" in Combinatory Logic
View bluebird.js
function bluebird (a) {
return function (b) {
return function (c) {
return a(b(c))
}
}
}
function hard (str) { return "hard " + str }
function rock (str) { return "rock " + str }
View xenops.js
function Xenops (fn) {
return fn(
function S (a) { return function S__ (b) { return function S_ (c) {
return a(c)(b(c))
}}}
)(
function K (a) { return function K_ (b) {
return a
}}
)
@raganwald
raganwald / problem.md
Last active December 11, 2015 20:38
Problem Statement
View problem.md

This is the problem I'm having. I've written a Combinatory Logic interpreter in the oscin.es library. It works with combinators (defined as upper-case letters) and unknowns (lower-case letters). You can write things like this:

interpret('Txy')

And get this:

'yx'

I write this as: