Skip to content

Instantly share code, notes, and snippets.

View belden's full-sized avatar

Belden Lyman belden

View GitHub Profile
@belden
belden / y-combinator.js
Created August 22, 2012 20:26
y-combinator.js
// Here's a simple lambda combinator; it'll turn the function passed in
// into a function which, when called, returns a recursible copy of itself.
function y_combinator(curried) {
return function(f1){
return curried(function () { f1(f1)(arguments) });
}(function (f2) {
return curried(function () { f2(f2)(arguments) });
});
}
@belden
belden / toy-exception.pl
Created May 23, 2012 13:36
Locally replace die to not.
#!/usr/bin/env perl
use strict;
use warnings;
use Want qw(rreturn);
use Test::Resub qw(resub);
BEGIN { *CORE::GLOBAL::die = sub { CORE::die(@_) } }
use Data::Dumper;
@belden
belden / The output
Created May 9, 2012 17:20
Perl functions by prototype
# this is for Perl v5.10.1
#
($$$$$)
msgrcv
($$$$)
semctl
shmread
shmwrite
@belden
belden / gist:1958828
Created March 2, 2012 14:44 — forked from Ovid/gist:1957853
perlfind -- perldoc on steroids
#!/usr/bin/env perl
use strict;
use warnings;
use Carp qw(cluck);
use autodie ':all';
use Getopt::Long 2.33 qw(:config auto_help);
use File::Find::Rule;
use File::Basename 'basename';