Skip to content

Instantly share code, notes, and snippets.

@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@llasram
llasram / euler19.clj
Created December 6, 2012 18:48
Project Euler problem 19 solution
(defn p19-solution []
(let [multiple? #(zero? (rem %1 %2))
leap-year? #(or (and (multiple? % 4)
(not (multiple? % 100)))
(multiple? % 400))
february #(if (leap-year? %) 29 28)
mdays [31 28 31 30 31 30 31 31 30 31 30 31]
mdays (map #(constantly %) mdays)
mdays (apply juxt (assoc (vec mdays) 1 february))
months (mapcat mdays (range 1901 2001))
@wki
wki / css_parser.pl
Created December 22, 2011 19:48
Sample CSS Parser using Marpa::XS
use strict;
use warnings;
use feature ':5.10';
use Marpa::XS;
use Data::Dumper;
#
# a simple CSS snippet for testing
#
my $text = q{