Sunday, June 26, 2016

How to indent in Facebook post/comment on OS X

  1. Put your cursor on the text box of the post/comment you want to indent
  2. Go to the menubar at the top of the screen
  3. Edit > Emoji & Symbols
  4. On Characters window, click setting icon. It's a gear nearly the top-left of the window, close to 3 color buttons.
  5. Choose Customize Lists...
  6. Choose Code Tables > Unicode and Done
  7. Go to Unicode section at the end of the most left panel of Characters window
  8. Look for the character number 3000. It's called "IDEOGRAPHIC SPACE"
  9. Double click on that character to insert it to your text box. You can insert it as many characters as you want.
  10. Save your post/comment. This empty space should help you indent your text properly.
  11. You can add this character to Favorites section by click "Add to Favorites" button under the thumbnail of the character in the right most panel of the Characters window.
  12. Or you can just go to "Frequently Used" section and the character should already be there.

Saturday, June 4, 2016

How to comment in Clojure and my use case of each approach

There are 3 ways to comment code in Clojure. I personally use all 3 of them depending on the situation.

; [semicolon]
It's similar to // or # in the other languages. Source code from the point you put it until the end of line won't be executed.

I use it for a quick short documentation of the code or when I want to try remove a line quickly. It's the most easy to use one because all the IDEs and text editors support it out of the box.

(comment (expr)) [comment macro]
Use it to wrap expression you don't want it to be run. It's more convenient to use when using with tool to help maintaining balance of the parentheses such as paredit or parinfer.

I use this one a lot in while I'm doing interactive development via repl. I always put the code to execute function the I'm implementing in the same file with the function definition so that I can quickly test out when I change something. I wrap that code with comment macro so that I won't be execute automatically by Clojure. When I want, I send only the inside code to the repl to see what's the output of the function.

#_ reader macro
It comments out an expression that follows it, from opening to closing parens

This one I've just learnt about it recently. It comes in handy when I don't want to care about where is the end of the expression. I just put #_ and thing will behave as I expected. It's great for multiline comment, similar to the comment macro with a less keystrokes.

ClojureBridge is done a better explanation than me

Clojure how to get JVM options from inside application

(.getInputArguments ( Credit:  How to get vm arguments from inside of java applic...