Donnerstag, 2. Mai 2019

Make use of the "zero width no-break space" character

There's one character in Unicode I really like: The zero width no-break spaceor . I use it for giving an element the line height it would have, would it contain text but when it should in fact stay empty - e.g. for vertically aligning an input field in a row with other input field, where the one in question does not have a label text above it.

Simply use the escaped unicode form in CSS adding a pseudo element:

.zero-width-no-break-space::before {
    content: '\FEFF';
}

Dienstag, 2. April 2019

Make IntelliJ format HTML files nicely (from a frontend developer's perspective)

I am using IntelliJ now with my current job, and I dislike the way it does formatting of HTML files (and of course all the backend and Java developers do not really care the same way I do).

Fortunately I finally figured out how to do it:
  1. Install NodeJS (I recommend doing it using nvm) and Yarn (npm is fine as well, but I prefer Yarn)
  2. Set up a package.json file, e.g. by running yarn init
  3. Install Prettier, Babel-eslint, eslint and eslint-plugin-babel:
    yarn add --dev prettier eslint babel-eslint eslint-plugin-babel
  4. In IntelliJ, go to File > Settings > Plugins > Marketplace and install "File Watchers" and "Prettier"
  5. In IntelliJ, set up File Watchers for HTML under File > Settings > Tools > File Watchers and add a watcher for the file type HTML, set up the arguments --parser html --write $FilePathRelativeToProjectRoot$ and under "Advanced Options" make sure that the options "Auto-save edited files to trigger the watcher" and "Trigger the watcher regardless of syntax erorrs" are unchecked.
  6. Create a .prettierrc file in the project's root directory with at least this configuration: {
      "htmlWhitespaceSensitivity": "ignore"
    }
     - this will prevent Prettier formatting closing ">" characters from inline HTML tags to sometimes end up on separate lines.
Hooray, now IntelliJ does a nice HTML file formatting the way a frontend developer like me can enjoy it.

Freitag, 18. Januar 2019

New book arrived!

Yay, last weekend I finally received the new second edition of Martin Fowler's "Refactoring - Improving the Design of Existing Code".

I just started reading the introduction, but it already turns out that this book is more than just a repetition of stuff I thought I already knew. I guess it will finally teach me how to really refactor JS code, how to write proper tests and how and when to apply design patterns in JS.

It's easy to read and I already love this book. Highly recommended!

Montag, 7. Januar 2019

Learning React & Redux

I am currently learning React & Redux - yep, I didn't catch up with FE frameworks mainly because I did not care about learning more and blamed it on working alone and having two little children at home.

But now I am catching up finally with videos:

  1. I started watching Wes Bos'  "React for beginners" more than one year ago and stopped because I wanted to switch learning Vue.js with a Udemy course which I also only started watching.
  2. I watched Frontend Masters' "Complete Intro to React v4" which I think is pretty cool and compact. It helped that I had been starting with Wes Bos' React course long ago.
  3. I watched Wes Bos' (updated) "React for beginners" completely and having watched 2) before helped a lot.
  4. Currently, I am watching Wes Bos' "Learn Redux" and I guess I have to watch it once again. Without a current personal React project, it is hard to store all this information in my mind and understand it.
  5. Then I plan to watch Wes Bos' "Fullstack Advanced React and GraphQL", which I have already bought during the winter season sale.
I'm having a hard time learning, but I do not give up. Sometimes it all seems to be so elegant and easy, but then again when I want to do something on my own it turns out that I am missing the big picture still. Unfortunately, there is no "React pill" I simply can swallow and get it all. Also, I don't know what the best way for learning would be for me - I guess having a buddy pairing me would be best.
Anyways, it makes things easier now that I have accepted that watching video tutorials several times is not a bad thing. If it helps me understand things, then it's good.


Sonntag, 6. Januar 2019

Weekend

Spending my weekend with my (married) family - this is way more important than Clean Code and Software Craftsmanship, and especially not contradictory.
It always helps to get back down on earth.

Freitag, 4. Januar 2019

My reading list

I just finished the current version of my reading list, featuring all technical or scientific books I've read and could easily track down (because these are the ones I bought online at Amazon). There are way more books I've read - I do not mention the crime and SciFi stories I always read in-between, and there are more books I've read but did buy elsewhere, so I didn't want to track those down as well, although one day I might add some of those.
From now on I will try to keep this list up-to-date as good as I can. The latest reads are on the top of the list.

Donnerstag, 3. Januar 2019

Possibly nice for all (not only new) GIT users

I Just found this really old entry in my drafts folder and decided to release it (the links had partly to be replaced with archived versions):


1,5 months ago I started working with GIT, whilst I've been using SVN before. These days I found this really nice tutorial on GIT (I've given the official "pro git" manual a try, but didn't become happy enough):
GIT in a nutshell by Jonas Jusélius. These 20 pages (properly typeset in LaTeX - for those who know what it means) are a really nice hands-on tutorial for everyone who has to quickly dive into the daily GIT usage at work.
Then if things go wrong, this very neat poster might become handy: GIT pretty by Justin Hileman. Print it out and hang it onto the wall next to your working place.