A Foolish Manifesto

fREWdiculous!

OLOTD

1
gvim `grep 'strip_tags' * -Rl | xargs`

This will open all of the files that have the string ‘strip_tags’ in them in a single gvim window. (Can I call this one-liner: too lazy to even copy paste?)

  • 2 Comments
  • Filed under: Uncategorized
  • OLOTD

    perl5

    1
    join(' ', map { ucfirst } split(/s+/, lc($words)));

    perl6

    1
    $words.lc.split(/s+/).map({ ucfirst }).join(' ')

    This really should be a builtin. It is in perl6 and (I think) ruby.

    *Update*: So I was on the perl6 mailing list and this happened:

    19:42 <@TimToady> std: $a ==>>= $b
    19:42 < p6eval> std 25080: OUTPUT«00:05 84m␤»
    19:42 <@TimToady> oops
    19:42 < frew> nice
    19:43 < pugs_svn> r25081 | lwall++ | [STD] catch ==>>=
    

    p6eval is a bot that you can check your perl6 code on. pugs_svn says when someone checks into the source repository. It was then that I realize that TimToady was Larry Wall.

    He has actually spoken with me numerous times, which is pretty awesome. A lot of times I would ask a question and he would answer and add extra details. So that’s pretty great. I asked him a lot of questions about various things and he kindly answered. One of the things he told me was a shorter implementation of the code above in perl5:

    1
    $words =~ s/(S+)/uL$1/g

    How many of you have spoken to your language’s benevolent dictator?

  • 0 Comments
  • Filed under: Uncategorized
  • One liner of the day

    1
    test=29-array/pairs; cp ~/tmp/pugs/t/spec/S$test t/spec/S$test.t  && make t/spec/S$test.t

    Maybe I was doing it wrong, but this sure did make it nicer!

  • 0 Comments
  • Filed under: Uncategorized