Skip to content

Instantly share code, notes, and snippets.

@alecramsay
alecramsay / solution-135.clj
Last active September 8, 2016 15:42
4clojure: Infix Calculator - Problem #135
(fn [& exp]
(reduce (fn [result instr]
(apply (first instr) (list result (second instr))))
(first exp)
(partition 2 (rest exp))
)
)

Keybase proof

I hereby claim:

  • I am alecramsay on github.
  • I am alecramsay (https://keybase.io/alecramsay) on keybase.
  • I have a public key whose fingerprint is 0075 5C76 4477 D73D 6534 783F F7EE CE00 8EBA E978

To claim this, I am signing this object:

@alecramsay
alecramsay / gist:4adf3208721a82702ada4edd63b6790f
Created May 12, 2016 14:00
Verifying that +alecramsay is my blockchain ID. https://onename.com/alecramsay
Verifying that +alecramsay is my blockchain ID. https://onename.com/alecramsay
@alecramsay
alecramsay / eat_CRLF_in_quoted_strs.pl
Created January 28, 2016 16:02
This Perl script eats CR and LF characters embedded within quoted strings in a .csv file.
#!/usr/bin/env perl
# This Perl script eats CR and LF characters embedded within quoted strings in a .csv file.
# It assumes the file uses comma-separated values quoting rules:
# https://en.wikipedia.org/wiki/Comma-separated_values#Basic_rules
# and should work with any file, .csv or not, that follows them.
# TODO: Doesn't support double double-quotes embedded within the double-quoted strings.
# Args <input file>