That’s doodoo, baby.
Nice list of Ruby one-liners when working at the shell. e.g., emulating nl(1):
# number each line of a file (left justified).
$ ruby -ne 'printf("%-6s%s", $., $_)' < file.txt
# number each line of a file (right justified).
$ ruby -ne 'printf("%6s%s", $., $_)' < file.txt
# number each line of a file, only print non-blank lines
$ ruby -e 'while gets; end; puts $.' < file.txt
Unlike some other things, the -p and -e switches are something I’ve always been glad ruby adopted from perl.
Jeremy Zawodny takes a look at the * is Unix thing and throws in some additional goodness: more on fork(2), the benefits of copy-on-write, and atomic file operations.
Aristotle Pagaltzis comes through with the simple preforking echo server in Perl.
“While I do consider the adjective ‘baroque’ to be a compliment, I must point out that Perl is actually more of a romantic piece, with allusions to various classical motifs. My favorite composer is Mahler, which should surprise no one.” — Larry Wall
Best. Program. Ever.
This was a really great lesscode.org piece by Aristotle. The follow-up discussion in the comments was superb as well. Being in the middle of everything really warped my view of what was going on back then, I think.
chromatic on million-line Java programs: “I can only imagine how much larger the Java code would be without all of those XML files.”
No, but seriously, the only reason we’re not all using Perl for web development is because all the problems are already solved … and have been since around 1995 or so. (See Also: mod_perl, libwww-perl, Fielding et al.)
“maybe try coding something in c”
Brilliant!
:)
“I could whip you up something in Java that would take 2 minutes to design, 30 minutes to implement, a day to write the deployment descriptor for, and 3 months to get sign off from the app support people at the client site _b”
the best shit ever