There are, roughly speaking, three ways to develop large user-facing programs, which we will refer to here as 0) the Unix way, 1) the Emacs way, and 2) the wrong way.
Disclaimer: This post is in no way a rant about NodeJS or Ruby on Rails. It merely reflects on our decision and the reasoning behind it. Both the frameworks are great for the purpose they are built, and yes that is why a part of our stack is still running on NodeJS.
I am huge fan of NodeJs and…
Enigma in a spreadsheet!
Back in the summer of 2009 a friend of mine read a few of my books covering cryptography.
This is his interpretation of the Enigma cipher machine; the distillation of a mental model he formed from reading those popular-science treatments of the machine.
He is not a programmer or anything but he just proved his aptitude; and he’s super-leet at Excel too!
I think we can all agree this is programming, even when done by someone who is not a professional programmer and who has no formal programming education.
When I asked him if I could post his old Enigma spreadsheet, he was skeptical that anyone would be interested. Outside the programming world, normal people think making complicated spreadsheets in their spare time is creepy and to be suppressed ;)
Now the Internet is awash with Engima machines in Flash applets and such; none seem to agree with any other, and this spreadsheet is no exception to that. So it would be most unlikely this is a truly accurate representation of the real machine.
However, my friend is a good visual learner; I think if we could just get him to Bletchley Park he’d refine and fix his mental model and build a better, more correct spreadsheet :)
I figure we all just have to give him encouragement - comments and code review and such - and get his appetite whetted for doing more of this computer type of thing! So if you enjoy his work, please say
Discussion on Hacker News and Reddit; saw it somewhere else? please say :)
Convert Ruby 1.8 to 1.9 hash syntax
In vim, for an entire file:
:%s/:\([^ ]*\)\(\s*\)=>/\1:/gIn the shell, for an entire project:
perl -pi -e 's/:([\w\d_]+)(\s*)=>/\1:/g' **/*.rbNow, instead of those old-school hashes like this:
get '/', :agent => MOBILE_BROWSERS doYou’ll have new-school hashes like this:
get '/', agent: MOBILE_BROWSERS do
Quite interesting and comprehensive