Attach to Process

Thoughts and Notes on Software Development

On some of the pinned pages on my journal, I added a “Last Updated Date” value right under the title. I did it using a span element, like this:

# Archive📜

<span class="lastUpdatedDate">Last Updated: 2021-03-17</span>

Now, instead of having it show up under the title all the time, I also wanted it to show up to the right of the title, if the screen was wide enough.

So, if the page is being viewed on a wide screen, like on a desktop computer, the “Last Updated Date” will show up on the right side. If the page is being viewed on a small screen, like on a mobile phone, the “Last Updated Date” will show up under the title.

Here is how I made it responsive using Custom CSS:

span.lastUpdatedDate {
   font-size: 0.7em; 
   color: silver; 
}
@media screen and (min-width: 480px) {
   span.lastUpdatedDate {
      float: right; 
      margin-top: -4em; 
      margin-bottom: -4em;
   }
}
@media screen and (max-width: 479px) {
   span.lastUpdatedDate {
      margin-top: -2em;
      padding-bottom: 2em;
      display: block;
   }
}

Here is what it looks like on a wide screen: Last Updated Date showing up on the right side of the title.

Here is what it looks like on a mobile phone: Last Updated Date showing up under the title on a small screen.

If you know of an easier way to do this with less CSS, please let know in the comments below. Or you can do so privately by leaving me a message.

Tags: #HowTo #CSS #WriteAs

Due to the rate-limiting feature that the Write.as team introduced into their API, a number of my Blazor WASM apps, like the WriteFreely Archive Page Generator I created, have stopped working. All of the Write.as related Blazor WASM apps I created, use the WriteAs.Net client/wrapper library that I wrote. And it is actually this client/wrapper library that is running into the rate-limiting problem.

But, as Matt mentioned here, a solution is in place through the use of Application keys.

I've already updated the WriteAs.Net client to make use of Application keys. But before I release the latest version, I also want to give it some caching abilities. That's what I'm working on and testing right now in my spare time. Once that's done, I'll publish the latest version of the WriteAs.Net client to Nuget.

After that, I plan to get the WriteFreely Archive Page Generator working once again. Then I'll work on getting the Search app for my journal working as well.

Tags: #Blazor #WriteAs #WriteAsNet

Visual Studio, when used with TFS (Team Foundation Server), has this feature called “Annotate”. You get to it by right clicking somewhere in the code, then selecting Source, then Annotate.

Doing so shows you who made changes, when those changes were made, and what changeset those changes belong to, for the specific line of code you are looking at. It's pretty helpful especially when you're trying to understand the context or history of a specific line of code.

I've been looking for the same feature in Visual Studio Code. Unfortunately, this feature doesn't exist when using Git with Visual Studio Code. But, you can install an extension called Gitlens that does the same thing and then some.

And just to clarify, there is no “Annotate” command/feature in Git. But there is a corresponding one called git-blame.

Tags: #VisualStudioCode #Extensions #Git

In the past, I used Wyam to generate the website files for my software development blog. I chose Wyam because it is a .NET static site generator and I am a .NET software developer. With Wyam, I got to play around with Razor and C# while working on my blog. And I learned a lot about HTML, CSS, JavaScript and even Markdown. But now it's time to move on.

I've already made some changes at the start of this year. Namely, I decided to start publishing new software development posts onto my journal. As I mentioned in this post, I didn't really like how it turned out. I didn't like how the content was getting mixed in with other totally unrelated posts. So, after only a few months with that setup, I decided to move my dev blog out into a stand alone blog once more.

Instead of going back to a static site generator, I decided to spin up a new blog with write.as. There are two main reasons for this.

Ease of Publishing

First, I loved the ease of publishing new content with write.as. Their Markdown editor is superb. The writing experience is distraction free. And all I really need to write new posts is a web browser. Yes, even the web browser on my mobile phone will work. I can't exactly say the same thing about writing new posts with a static site generator.

Keeping it Simple

Second, I wanted to keep things simple by keeping most of my sites under one roof.

I've realized that it was hard to maintain websites that were on different platforms. To post to my dev blog, I had to do it with Wyam. To post to my microblog, I had to do it at micro.blog. To post to my journal or music blog or photo blog, I had to use write.as.

Keeping my sites under one roof, using the same method of publishing, would make things a lot simpler. At least, that's the idea. So, I'm trying that out.

Whether this new setup will work or not, only time will tell. But the one great thing about owning your domain and personal websites, is that you can do whatever you want. You want to experiment with a different way of publishing, go ahead. You want to try a new theme, give it a go. You want to write longer posts, or shorter posts, it's all up to you. Your websites, your rules.

Anyway, that's all for tonight. I just wanted to publish a formal migrated to write.as post for this blog. I feel better now with that out of the way. So, I'll catch y'all in the next post. Thanks for reading.

Tags: #SiteUpdates #Blog

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.

Tags: #Scripts #SqlServer

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

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 my write.as sites. 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.

Tags: #JavaScript #MicroBlog

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...

If you're trying to publish a SQL Server database project using Visual Studio, but you're not seeing the Publish dialog box show up, check your other Desktop in Windows. I've noticed that every once in a while, the Publish dialog box shows up in another virtual desktop, instead of showing up on the one you're currently working on.

Tags: #SqlServer #VisualStudio

Enter your email to subscribe to updates.