{"id":1033,"date":"2017-02-07T22:14:50","date_gmt":"2017-02-08T03:14:50","guid":{"rendered":"http:\/\/codefork.com\/blog\/?p=1033"},"modified":"2017-02-21T17:43:24","modified_gmt":"2017-02-21T22:43:24","slug":"one-liners","status":"publish","type":"post","link":"https:\/\/codefork.com\/blog\/index.php\/2017\/02\/07\/one-liners\/","title":{"rendered":"One-liners"},"content":{"rendered":"<p>I stupidly created some directories with a colon in the filename, which confuses some programs. I wanted to change these colons to underscores. Shell scripting makes my head hurt, so I turned to do it in Ruby instead&#8230;<\/p>\n<p><script src=\"https:\/\/gist.github.com\/codeforkjeff\/44d62355ee4322ae743e78209de5a9df.js\"><\/script><br \/>\nNot a bad one-liner. For all I complain about dynamic languages, they can sure be handy.<\/p>\n<p>What would this look like in Scala (which also has a handy REPL)? Almost a one-liner, if you don&#8217;t count the import:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/codeforkjeff\/204033ebb596c3297c4c35995a434f99.js\"><\/script><\/p>\n<p>Scala will never be a popular scripting tool, obviously, but it&#8217;s cool that you can achieve a Ruby-like level of compactness with it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I stupidly created some directories with a colon in the filename, which confuses some programs. I wanted to change these colons to underscores. Shell scripting makes my head hurt, so I turned to do it in Ruby instead&#8230; Not a bad one-liner. For all I complain about dynamic languages, they can sure be handy. What &hellip; <a href=\"https:\/\/codefork.com\/blog\/index.php\/2017\/02\/07\/one-liners\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;One-liners&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,28],"tags":[],"class_list":["post-1033","post","type-post","status-publish","format-standard","hentry","category-ruby","category-scala"],"_links":{"self":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1033"}],"version-history":[{"count":7,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1033\/revisions"}],"predecessor-version":[{"id":1040,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1033\/revisions\/1040"}],"wp:attachment":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}