Tuesday, March 17, 2020

Keep the faith

Here in the Netherlands, coronavirus has been quite big news. The government had been criticised for being too relaxed, and here in Breda - one of the main cities close to Tilburg where COVID19 was first reported in the Netherlands - it has been quite interesting to see it develop.

Slightly stricter measures apply in Noord Brabant, where its recommended to avoid social contact with others, with some events in the province being cancelled.

Saturday February 22 marked the official start of the Dutch Carnival in North Brabant, except I was laying in bed already hungover from the big party the night before. Some students most likely started even way before that - they really do know how to party in Brabant. When the local Breda football team NAC Breda, whose stadium I believe is smaller than that of AJAX Amsterdam, manages to sell more beer a night, you know they have some crazy supporters. I especially love the proudly shown banner "The only thing we fear is running out of beer". My kind of football team :D I've only been to one match, but it is a great atmosphere, filled with truly proud supporters and citizens of Brabant.



Carnival is filled with the same for pretty much a week long - people drinking beer, dressed up in costumes (otherwise you won't even be let into a pub or venue most likely), not caring about anything but having a good time, even in the cold windy or rainy weather- so windy that this year they postponed/cancelled a few of the carnival float parades that people had been building most likely since last year.

It was a very different atmosphere to the Breda I experienced this past Saturday evening, which normally buzzes at 6.30pm on a Saturday night, but I barely passed 5 people on my way to the local Albert Heijn (AH) supermarket, which thankfully had not run out of groceries (unlike others apparently). I guess I must have missed the panic rush by then perhaps - I also managed to buy a bag of toilet paper a couple of days before, so maybe I didn't notice what was missing on the shelves because I had the essentials already.

The relaxed attitude got slightly more serious on Thursday 12 March, when gatherings of 100 people or more were to be cancelled, working from home being encouraged (I luckily had just started doing this the day before), people feeling sick advised to stay at home, and it wasn't yet serious enough to close schools - universities were being encouraged to offer online studies, instead, but primary, secondary and vocational schools to carry on since they're vital to society and the government didn't want to set them back.

I was surprised by that one actually, usually it's the kids that spread things...

Sunday evening though a less relaxed and more strict measure was put in place, giving a closure order to the horeca (hospitality-restaurant-catering) industry, closing down schools, and putting in more strict measures.

Coronavirus started spreading throughout the Netherlands, with Brabant being a centrepoint, with Tilburg and Breda being two of the hotspots still.

It makes me very anxious. Especially since I have had a bit of a cough for a week or two! Makes me paranoid that maybe I have it already.

The prime minister, Mark Rutte, announced today a strategy aiming at maximum control to try stop the spread of the virus. Reading that news article makes me feel quite confident in the government.

Yesterday my home country South Africa was also addressed by our president, who also announced similar measures to be strict about trying to control the virus.

It's a tough time at the moment. I feel quite stressed, and as hard as I'm trying to stay positive, it is hard at times to do so, and to carry on as if it is all ok. Today was a very hard day to try and stay focused, and that's why I'm trying to kind of write down what is on my mind, as a source of more peace and calm.

My girlfriend is in New Zealand at the moment. She has been away since January on a fantastic sounding four month tour of Myanmar, New Zealand, Singapore, Malaysia and Thailand. I was going to be meeting her in Thailand around Easter weekend in April, but those plans seem to be falling through right now. Luckily KLM is most likely going to allow me to get a refund, or a voucher I may use within the next year - still need to hear back from their most likely swamped to over capacity customer support team who usually respond very quickly (haven't heard back from them the whole day).

My nerves have been quite on edge even just because of this, wondering if she would be okay on her travels. Even just getting to New Zealand she had to bypass China when the start of the outbreak was happening - NZ weren't allowing anyone from China in at that time, and she had to arrange a new flight herself at her own cost since the low cost airline or travel insurance weren't able to help her out then. Most likely she won't hear back from them anytime soon now with the virus being a pandemic.

She is currently in NZ in the queue for Qantas, hopefully she can find the safest option for her and her aunt that she is there with. No more trip to Singapore for them I believe, which is a pity.

All I can think of though, is "Is this cough that I have coronavirus? Am I being paranoid? Even if she comes back, if she comes to see me, is that safe for her? I miss her. I love her"

Then there is the stress of my close family, my Dad, Mom, sisters and their families. My Dad was diagnosed with cancer last year, and I returned to SA to visit while he was in hospital in September. It was meant to be a family trip to Australia to visit Debbie, Etienne and my nephews. We were all going to meet up for a year of milestone birthdays - 40th, 50th and 70th birthdays. In the end, all these plans changed. I used half my month's leave to visit SA first to check up on my Dad, the rock in my life that has provided me so much that I have to be grateful for today. To see my Mom who has also always been there for me, and to also support my eldest sister Michelle who was an absolute angel and star for caring for them, even with a whole lot of drama she had of her own.

It was good to be there, but it didn't feel like a proper holiday. I wished I could have stayed for longer than 2 weeks to be with them.

I then returned briefly to Netherlands for the starting game of the world cup, and a great braai spent with friends and "second family" here in the Netherlands, before making my way a couple of days later down to Australia to visit my other sister and her family. My brother-in-law had experienced a SCAD heart attack while in Australia, and it was the first time I was seeing them since they had left to Oz a few years ago.

My youngest nephew was just over 1 years old when they left, and now he was busy playing with a remote controlled crane (I was kind of jealous, I think I would have loved that toy as a kid, even now :D), talking, playing with his brother. Fighting with his brother. And vice versa :D

They drove me a bit insane at times, but I love them. Justin reminds me so much of myself when I was younger. I guess that's maybe the scorpio part of us - his birthday is two weeks apart from mine. He also had been having issues with his own health, where his white blood cell count was indetectable for a while, due to what seemed to be an auto-immune disease. I was very worried about my family down under for quite some time.

These days though, they seem to be doing better. My nephew's WBC count has increased, and he is on a lower dosage of the medicine he needed, and that makes me so happy. My brother in law can also do a bit more fitness, though, I still think he should be resting - I think he knows it too, he is just stubborn, and can't sit still!

My Dad, his chemotherapy sessions are almost done, and he seems to have been doing great with it. Except this week he also was back in hospital with a pain in his side. The scans seemed to show that it might be kidney stones maybe that passed before the scan, or that can't be seen in the scan. He was in the hospital for two nights and I was dreading that he would get coronavirus while there, especially since they kept him in for the two nights because his white blood cell count was lower than it should be. Luckily today he was released to go home.

On the way he sent a whatsapp text on the family whatsapp group, to see if my Mom needed milk. Rightfully so, she told him to avoid the shops! My Mom also has been having to deal with her eyesight deteriorating, and I guess even worse - having to admit that it is age related! :P

Not to mention my eldest sister, who recently was also in hospital due to a spider bite while working at a new place on the coast - they recently had to change jobs from where they had setup their business for the past, I dunno, 15 years or so... which was also tough for them. Luckily the bite's venom/poison (never remember the difference) didn't reach her muscles, but eina, the wound looks very painful, and took off a nice chunk of her shoulder. Seems to be healing though, so that's good.

Especially since she also had to go back to the hospital due to an allergic reaction to the medicine/ointment/gel being used for the wound care treatment. Was very worried about her then. My other brother-in-law was up and down to visit her as well, between having to work until a new skipper arrived, helping to take care of her, and avoiding riots closing off roads in-between - he'll have to wait for that road to clear... no roads with burning tyres, having to test out 4x4 features of his car to do escape manoeuvres from angry mobs chasing him, not since the last time that's for sure!

It's all just a little stressful.

So ja, it has been quite a year or two.

It is tough to stay positive during times like this. A lot of people are finding it difficult. Some more than others. I can't even begin to imagine what it is like for the poor people of South Africa, and the rest of the world, who don't even have electricity or water normally - nevermind load shedding. I try to stay grateful and positive, and focus on what I have. Focus on what I have been through myself as well to get to where I am today.

I hope this post didn't ramble on too much, and I hope that this whole coronavirus pandemic gets sorted out.

Jim Rohn has said it best in his one seminar, and various books, where he describes life and business as the changing of the seasons. There will always be winters, but they always eventually are followed by summers. There are always springtimes, and there are always autumns and harvests. Sometimes the winters are easy and sometimes they are hard, whether it be the actual weather with snow and wind and miserable rain, or the metaphorical winters of financial burdens, heartbreaks, anxiety. These will always be followed by summer - you'll get through the hard times. The one big important part of his message though, is how it is your responsibility to act. You only reap what you sow. You only get a full harvest, if you take advantage in the springtime and plant the seeds (or vice versa, I'm not a farmer, and don't have very good green fingers).

He was also quite spiritual and religious I believe. And I am too. I strongly believe that I am here, because of the power of prayer and the love of God. I had encephalitis (inflammation of the brain) in university, and could have become brain damaged. I blacked out, I felt like I was descending into hell, and I felt like when I woke up and saw my sister's face the next day, that I had been saved and that I was now safe. While I was not fully concious, I was fighting the nursing staff and my own parents, fists swinging, with them trying to hold me down to my bed so I wouldn't hurt myself, surprised by my strength. The drip in my arm, in my delusion, feeling as if I was stuck in my bed, not able to escape it, being attacked whenever I tried to get out of it. They had to give me a lumber puncture while I was under general anaesthetic because of this. While I was out, I was imagining myself descending into a bottomless pit, and being scared and praying to God to help me.

I experienced Him before that time as well, when someone close to my family, part of my extended family, seemed to want to try and commit suicide. I prayed as he appeared to disappear from our sight, and I pointed to the horizon in the hope that he would come back at the same point. I kept pointing to that point on the horizon, and prayed words for him to come back to shore safe. He did, and at that point in my life I was very shy, and didn't tell him this. But later that day, he was sharing the story of seeing a bird, all the way out there, as if it was calling him back to shore. The words he said after that, were the exact same words I prayed.

Even the time I came back from Contiki, after visiting the Vatican, buying a Catholic cross that stood out on a table full of memorabilia, meeting a Catholic girl and visiting a church with her not long after for my first Catholic ceremony, then the next day my previous employer's CEO sending out a company wide email about a Catholic formation class that he was starting. It all seemed to be too much of a coincidence, to be coincidence, and not fate.

I may be sounding crazy and delusional to some right now, and as your read the above, I wouldn't be surprised either. I have felt the same reading similar things in the past before as well.

It makes me think of when I was in Prof. David Block's classes, studying Astronomy in university. Not only was he a passionate lecturer, he also appeared to be both scientific and spiritual. I was amazed with the way the universe seemed to be explained by these mathematical equations and how much we knew about the universe, and how little we knew too. Dark matter, finding the "God" particle, what caused the "Big Bang" - was it God the creator that caused it? Who knows. Nobody I guess. I also found it fascinating in university, learning about computational molecular biology, how genes are sequences of genomes, and how Computer Science algorithms to match strings, can help with detecting things genetically. How biology can show evolution with mutations of genes. How artificial intelligence can make us question if we ourselves are even intelligent, creative, or designed to think the way we do with an illusion of intelligence - how is someone that can paint, any less creative than a machine that can learn how to paint, when both may be shaped around their environments and experiences? Are we created, just as we have created AI? Is coincidence a thing, or are things predetermined? If so, do we have free will?

I didn't study theology or philosophy really, but these kinds of questions have been quite interesting to me for a while now. I also joke sometimes that if you want to become a really good software engineer, first study psychology :D People are the hardest part of understanding software development :D

Does God exist? We can never prove that. But we can always believe it to be true, and have faith. Is the Bible true? Is the Cathechism true? Which version is right? Nobody truly knows.

I do know though, that I believe in God, I have felt Jesus' presense or the presense of the Holy Spirit, or both, in my lifetime. At least, I believe I have.

I pray that the world can be made safe again, healed. That coronavirus can be stopped, that people can be cared for. That the world will unite.

That is quite a big thing to wish for.

For now, I just wish that my cough will get better for myself. And for my love to be able to see me again so that we may comfort each other, and live a long, happy life together.

I love you Alies, and I miss you.

I feel more calm now, so I will stop writing in this blog post. It is one of the first blog posts I've written in public like this (apart from on social media like Facebook etc.) in a while.

I hope that if you read this far, that you too stay positive.

I hope that we can all enjoy the summer together.

Keep the faith.

Amen.

Tuesday, August 21, 2018

git bash - deleted local branches

You can find out which branches have been merged into a branch by running the below:

$ git branch --merged origin/master
* master
  feature/some-branch
  feature/some-other-branch

This will also print out master as part of it, so we can then pipe that into grep to match results without master:

$ git branch --merged origin/master | grep -v master
  feature/some-branch
  feature/some-other-branch

Obviously, you won't want the name master in your branch name, otherwise it'll be excluded too. You can fancier with regex here.

Now we can take this result and pipe it into xargs, to run git branch -d passing the output as arguments

$ git branch --merged origin/master
  | grep -v master
  | xargs -r git branch -d

I'm splitting up the command onto separate lines for readability. The -r will only run the git command if there is output.

I've noticed this doesn't always delete all old branches, but it can help. For example, perhaps you had a branch that was a work in progress, or a spike, with changes that aren't merged - this won't be picked up.

You can do one more trick to detect old branches that have no upstream branch anymore:

$ git branch -vv

This will list branches without an upstream branch with gone. Those can generally be deleted too.

Monday, August 20, 2018

Today I learned - VSTS CLI and jq

Today I learned about the VSTS command line tool from a colleague.

I might actually have heard about it before, but wasn't able to try it out because I was previously using the on-premise TFS and not the cloud based VSTS, but hey, today I tried it out :)

For example, you can query VSTS for pull requests you've created by doing the following:

$ cd /your-vsts-git-repo
$ vsts login
$ vsts code pr list --creator "James Barrow"

This will return a JSON object containing info about what pull requests you have created.

If you don't really care about the entire structure, you can then use another command line tool I've come across before called jq.

For example, if you only care about the title, status and url of the pull request, you could do the following:

$ vsts code pr list --creator "James Barrow" | jq ".[] | { title, status, url }"

That's a long command, but what it basically does is pipes the JSON result into jq, which parses it by taking each element in the array of the result, and then filtering it to only take the title, status and url properties of each item in the array.

And finally, since we all know the best way to use git is via the command line and git bash, you can then also create a bash alias in your ~/.bashrc file:

alias prs='vsts code pr list --creator "James Barrow" | jq ".[] | {title,status,url}"'

So you can just check for your pull requests now by simply running:

$ prs
{
  "title": "RE #1234 - some pull request",
  "status": "active",
  "url": "https://blah.visualstudio.com/.../pullRequests/2345"
}

Which gives you something like that ;)

Much simpler than having to open up Chrome, go to VSTS, find the right tab for pull requests, etc...

I want to dig more into using jq to pull out info on if the pull requests have had votes as well, so I can just run a command from my command line and see if I need to follow up on a PR or not, but this will have to wait for another day :)

One last note is that use of single and double quotes might be important depending on your shell of choice, so keep that in mind too.

Hope this helped someone.

UPDATE: There is also vsts code pr list -o table which prints a nice format

Thursday, June 28, 2018

AngularJS to Angular, JavaScript to TypeScript, Gulp to webpack to Angular CLI

So I jotted down a whole lot of links for when I was learning webpack, and thought maybe someday I'd write a blog post, but that I probably wouldn't really. That day may come, but that day is not now :P Posting this in case others may want to browse through the links that I found useful when trying to convert an application in AngularJS 1.x with Gulp, using ngupgrade with Angular5 and webpack, onto just one build with the Angular CLI.

https://youtu.be/ivQ7HrnBJe8

https://webpack.academy/p/web-fundamentals

https://what-problem-does-it-solve.com/webpack

https://survivejs.com/webpack/foreword/

https://webpack.js.org/configuration/

https://webpack.js.org/api/

https://webpack.js.org/api/loaders/
https://medium.com/@MarkPieszak/using-pug-or-jade-templates-with-the-angular-cli-9e37334db5bc
ng add ng-cli-pug-loader
https://www.npmjs.com/package/pug-html-loader
https://www.npmjs.com/package/exports-loader
https://github.com/webpack-contrib/copy-webpack-plugin
https://github.com/webpack-contrib/mini-css-extract-plugin
DONT USE > https://github.com/webpack-contrib/extract-text-webpack-plugin
https://github.com/s-panferov/awesome-typescript-loader
v4.0.0-beta.0 Release Notes

https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693
https://gist.github.com/gricard/e8057f7de1029f9036a990af95c62ba8
https://webpack.js.org/configuration/optimization/#optimization-minimizer
https://webpack.js.org/plugins/uglifyjs-webpack-plugin/

http://dmachat.github.io/angular-webpack-cookbook/
https://github.com/dmachat/angular-webpack-cookbook/wiki/Angular-Template-Cache

https://github.com/frederikprijck/angularjs-webpack-starter
https://egghead.io/courses/angular-and-webpack-for-modular-applications