Dino’s Journal 📖

A glimpse into the life of a sleep deprived software developer, husband, dad and gamer.

Recently had need of a script that can tell me the time difference in seconds, between two DateTime values in SQL Server. Here is what worked for me:

SELECT DATEDIFF(S, StartDateTime, EndDateTime) AS DurationInSeconds;

Note the first parameter, S, tells the DATEDIFF function to return the difference in Seconds. You can pass in other values as well, like MS for milliseconds or HH for hours.

You can find out more about the DATEDIFF function here.

#SQL #SoftwareDevelopment

Find me on Mastodon (@dino@writing.exchange) or Micro.blog (@Dino)

The biggest development from last week, was that after weeks of thinking about it and talking about it on this journal, I finally published my digital garden online. You can find it here.

It's a work in progress, so there will be changes. In fact, the nature of it means it will probably be forever under construction. When you go through it, don't think of it as a blog. It is not. There are no published dates. There's no RSS feed. There's no email subscription. The URLs to specific notes will probably change every week. It is really a digital garden/personal knowledge-base.


Matt shared this wonderful website on Mastodon. What an amazing find! It allows you to watch, what looks like dashcam videos, from all over the world. In an age where travel and road trips are put on-hold, this website lets you experience virtually driving in another country. It's a mesmerizing and very interesting way to see what other countries/cities look like.


Power outages and water shut-offs all across Texas. People have died in accidents on the road and at their own homes because of the cold. It's extremely disheartening. We've been extremely lucky to not have lost power or water at all. But that wasn't the case for everyone else. Last week's winter storm really showed how the state of Texas is just not ready for this kind of weather. I'm hoping that the state can learn from this and be better prepared for the next one.

Read more...

Cannot remember the last time it snowed this much in our part of North Texas.

It started out as mild snow...

...which was not unusual for North Texas. We didn't get any snow the past few winters, but still this was not unusual. I was excited for Davin to experience his first time playing in the snow.

Read more...

As part of learning React, I'm also trying to shore up my JavaScript skills. Thankfully, the React: Getting Started pluralsight course also offers a modern JavaScript crash course. These are my notes from when I tried to understand JavaScript's Destructuring feature.

Note that you can run the sample code on a JavaScript tester website, like say the JSComplete Playground.

So, the JavaScript destructuring assignment syntax allows you to get just the properties you want from an object. It seems to be like a shortcut for getting to the properties of an object. For example:

const customerInfo = {
	firstName: "Dino",
	lastName: "Bansigan",
	emailAddress: "myemail@email.com",
	website: "dinobansigan.com"
}

const getFullName = ({firstName, lastName}) => {
	return firstName + " " + lastName;
}

console.log(getFullName(customerInfo));

In the code above, you can see how I have created a customerInfo object. Then next is a function called getFullName that takes a firstName and lastName parameter. These parameters are destructured from the customerInfo object.

If you look at the last bit of code where I call console.log, you can see that instead of passing in parameters customerInfo.firstName and customerInfo.lastName, all I had to do, was pass in the customerInfo object. JavaScript through the destructuring feature is smart enough to know to use the firstName and lastName properties from the customerInfo object.

Read more...

Starting a new DevNotes series. This is a spin-off from my Weeknotes series. This one focuses on software development content only. This one won't exactly be a weekly thing. I'll only publish a DevNotes post when I have a number of notes to share. Otherwise I'll bundle them up into a bigger post and publish then. And with that out of the way, let's get started...

I'm starting to notice a trend with the Rust programming language. It seems to be the next big thing. Microsoft even joined the Rust Foundation. It probably should be the next language I should learn after React.


I just realized, after installing the React Browser Dev Tools Extension, that Microsoft's Azure DevOps site was built using React. If Microsoft, who created C# and ASP.NET, uses React on their core products, it is just one more reason for me to really dig into React.


React components can be thought of as building blocks for your website. Instead of creating a button then styling it with the primary-button CSS class, you create a PrimaryButton component then use it wherever you want.

Reference: Get to Know Gatsby Building Blocks


I was building a very basic Gatsby website, the one from their tutorial. It was taking too long to build the output for a static site. Too long compared to building sites using Wyam. I don't have anything against Gatsby. In fact I'm trying to learn Gatsby. I'm just pointing out that it seems slow compared to Wyam.


While going through the Gatsby tutorial, I found another alternative to Netlify for hosting static sites: Surge.

Tags: #DevNotes #Gatsby #React #Rust #StaticSiteGenerator #WebDevelopment #SoftwareDevelopment

Find me on Mastodon (@dino@writing.exchange) or Micro.blog (@Dino)

Last week I intentionally decreased the amount of stuff I've been reading. This is to give my brain a chance to digest what I've just read.

I've also taken to adding articles/posts that I want to read, into my Are.na Bookmarks/Reading List bucket. This seems to help decrease the unease that I feel, from not being able to immediately read interesting articles/posts. Since I know that I will eventually get to them someday in the future, it allows my brain to relax and focus on the current task at hand.


Since I have been trying to read less, a problem that I'm running into is what to do with my free time when I can't read. I would prefer to work on my digital garden, but I cannot do so when I'm not at home. This is because my notes in Obsidian, while synced to a Github repo, are not easy to work with via my phone. So, I now have a lot more time to think through things because I'm trying to read less, but during those times I can't work on my digital garden. That's one big limitation with my Obsidian setup.

That said, maybe I should look at it as a benefit in some way. I shouldn't be using my phone that much anyway.

Read more...

A must-watch for any Papa Roach fan. It talks about the origin of their hit song “Last Resort”.

Did you know that it was originally written on a piano? I never would have guessed.

I didn't use to be a Papa Roach fan back then. But they kept coming out with great tracks throughout the years. And some of their songs really resonated with me. So, I couldn't really help but become a fan. And now I know why.

The video also talks about the battles with alcohol and suicide that Jacoby, the lead singer went through. It gives you an inside look into the humanity behind the band. Now I understand why their songs are deep and heavy. Any song writer who goes through hell, always comes out with great tracks. And we need to treasure these song writers while they're still around. Because not all of them survive their battle against depression and suicide.

For other really good Papa Roach tracks, check out these ones that I shared on my music blog.

Tags: #MusicLog #PapaRoach

Find me on Mastodon (@dino@writing.exchange) or Micro.blog (@Dino)

Had this conversation with another blogger about a book he read. Similar to what I learned from reading The Great Cholesterol Myth, the same advice is given on a book about Alzheimer’s. And that is to limit carbs and lower/avoid sugar intake to reduce inflammation.

That's two different diseases — Alzheimer’s and Heart Disease — that gets pretty much the same recommendation to reduce carbs and sugar intake. This should really make you rethink how much sugar you should be ingesting everyday.


It took you years to put on all that weight. Don't be too hard on yourself if you're not losing weight fast enough. Think of losing weight more as a marathon than a sprint.


I've found a compromise for using my gel pen and fountain pen. When I'm at home, I use my fountain pen to write on my bullet journal. Anywhere else, and on any other notebook, I use my gel pens or ballpoint pens.


A few days ago I wrote this on my journal:

“Almost to the end of the k-drama Iris. It's a really good show!”

Then I got to the end. And wow. That ending was horrible! I had planned to say so many good things about this show. There's the amazing plot. The great acting. The pretty good fight scenes. The great story about love and friendship. But it was all brought down by the horrible ending. I can't even recommend it to my wife anymore, not after I've seen the ending. Such a disappointment. The show was great 95% of the time, until it got to the ending. Unless you're a sucker for horrible endings, don't waste your time on it.

Read more...

I am using the Lanyon theme on my micro.blog hosted photo-blog. I noticed that the Published Date was showing up on my about page. Here is how I managed to hide it using some JavaScript.

<script type="text/javascript">
var isAboutPage = /\/about\/$/i.test(window.location.href);
if (isAboutPage) {
  var x = document.getElementsByClassName("post-date");
  if (x) {
    x[0].remove();
  }
}
</script>

I added the script to the layouts/partials/default_foot.html file, just before the closing </body> tag.

This is a result of me playing around with Custom JavaScript on this site. I was able to carry over what I learned here and use it to fix something on another website. One of the best benefits of maintaining a personal website, is brushing up on your HTML, CSS and JavaScript skills.

#JavaScript #SoftwareDevelopment #WebDevelopment

Find me on Mastodon (@dino@writing.exchange) or Micro.blog (@Dino)

My first attempt at learning the React JavaScript library was by reading the ASP.NET Core 3 and React book. I started reading that book a few months ago. I've gone through the first six chapters, which mostly covers how to build a web app front-end using React. While I did learn a lot reading those chapters, I was barely keeping up.

There's so many new concepts, new libraries, new methods, new syntax to learn. It felt overwhelming at times. It didn't help that I kept getting distracted at the JSX syntax — which looked insane to me at times.

I found myself simply typing what was in the book. But I actually couldn't tell you why the code worked. I was honestly struggling to keep up. But more importantly, I was confused and frustrated at it all. Why would you even want to go through all this trouble of writing a React app? I didn't get it. And consequently, I wasn't too excited to learn more. But I had to.

Read more...

Enter your email to subscribe to updates.