A script to sum all the numbers on stdin (one per line): #!/usr/bin/env ruby puts STDIN.each_line.map(&:to_i).reduce(:+)
-
-
Replying to @recursecenter
@recursecenter I propose `paste -sd+ - | bc` as even shorter.@nelhage can no doubt improve on that.3 replies 1 retweet 6 likes -
Replying to @patrickc
@patrickc@recursecenter Oh god I swear we already golfed this one to death on Slack. I think I even learned dc(1) to this end.1 reply 0 retweets 1 like -
Replying to @nelhage
@nelhage@recursecenter I was thinking about dc but I couldn't see an obvious short answer...1 reply 0 retweets 0 likes -
Replying to @patrickc
@patrickc@recursecenter As I recall,@antifuchs came up with something truly awful involving conversion to unary and `wc -l`.2 replies 0 retweets 3 likes -
Replying to @nelhage
@nelhage@patrickc@recursecenter@antifuchs well, there goes*my* evening2 replies 0 retweets 3 likes -
Replying to @shu
@nelhage@patrickc@recursecenter@antifuchs how about: sed '1!a+$ap' | dc1 reply 0 retweets 1 like -
Replying to @shu1 reply 0 retweets 0 likes
-
Replying to @patrickc1 reply 0 retweets 3 likes
@gphat @shu @nelhage @recursecenter @antifuchs getting a "command not found" error for that one
-
-
Replying to @patrickc
@patrickc@shu@nelhage@recursecenter@antifuchs oh god now I'm canoed in to this shit1 reply 0 retweets 3 likes -
Replying to @gphat
@patrickc@shu@nelhage@recursecenter@antifuchs try: say nerds1 reply 0 retweets 5 likes - 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
