Stay focused! A customized starting-page

Yesterday I started creating this  to help me stay focused on my priorities whenever I start my browser.

my scustomized starting page
a starting page to stay focused online

I made this page, hosted it on github and bookmarked it as my starting page, and Voilà! 🙂

There’s room for improvement, you can contribute on the repo.


R2D26 JavaScript Calculator and WordPress Work

Today I worked on the JS calculator (Free Code Camp project) and with WordPress.

Calculator: I did the basic layout yesterday. So this morning was all for the javascript part. I wanted the digits to apear on my “screen” div when the buttons are clicked on. Of course, I thought of .innerHTML for this, but it has a drawback: it erases the previous content of the selected element. So I started looking for something else and found .insertAdjacentHTML. Will try it tomorrow.

I did a lot of things with wordpress later in the afternoon.

First, I installed wordpress locally to see how it works. I want to learn how to create and edit wordpress themes.

So I used this tuto: Setting up a Local Server Environment by Tania Rascia.

Then I started following this other tuto by Tania Rascia again: Developing a WordPress Theme from Scratch.

This tuto was shared to me by Hannah. Thank you! 🙂

Then I took care of this weblog, the one you’re reading right now. I changed the prefix! For this I followed this tuto : How to Change the WordPress Database Prefix to Improve Security (because I had forgotten to do it during the install! Ooops. :P)

As always, I had a little anxiety doing things that could have consequences (what if everything crashes?) But I did a backup and everything is working fine. I know it’s a built-in fear I have from my education.

“Don’t tinker with the computer, you’re going to break it” was something I heard a bit too much! And it has prevented me from going into programming otherwise I would have done it way sooner. I’ve always loved computers.

Well, conquering one’s fears is always exciting. I’m tired but happy.

R2D24 Regular Expression: Validate US Telephone Numbers

Today I solved the first advanced JS alogrithm challenge at Free Code Camp with regular expressions: Validate US Telephone Numbers.

I cannot recommend enough! It is very useful if you want to understand and test regular expressions. It was recommended to me by @BillGlover on Twitter a little while ago. There’s also this RegEx cheatsheet that is quite helpful!

What I learned specifically was the alternator  |  and the quantifier {}.
Say you want to find all occurences of this pattern :

0 followed by a space, followed by 3 digits (0-123, 0-987…),

and all occurences of a pattern beginning with 0, followed by an hyphen -, followed by 3 digits (0-456, 0-246),

then your regex would be:

/0 [0-9]{3}|0-[0-9]{3}/g

(g is for global, meaning the search will continue after the first match to find all the other matches)

I had stopped working on those challenges about a week ago in order to set up my website. I have missed those! My brain feels very good when solving coding puzzles. 🙂