Attach to Process

Bookmarks

This is a pretty good guide to building a blog using ReactJS and Sanity. That said, I did run into a number of issues while trying to follow it. This post is about the issues I ran into and the solutions for them.


When I got to the part where it says to run sanity init, I got errors in Visual Studio Code saying the PowerShell script is not digitally signed, so it's not allowed to run. The fix for this was to run: Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force in the VS Code terminal.


Then I got the error Error: self signed certificate in certificate chain. Looked it up online and found that it seems to be caused by my VPN connection. I disconnected from my work VPN and it did resolve my issue.


I got all the way to the part of the guide where I was Building the page for all the blog posts. After following the instructions and copying the provided code into src/components/AllPosts.js , I kept running into a post.mainImage undefined error. It turns out, the provided code is expecting all posts I created in Sanity to have a main image. I had one for my first post, but didn't add one to my second post.

The fix for the issue above was to replace <img src={post.mainImage.asset.url} alt="" /> with {typeof post.mainImage !== 'undefined' && <img src={post.mainImage.asset.url} alt="" />}.

What that new line of code does, is check if post.mainImage is NOT undefined, and if so, render the img tag. If it was undefined, as is the case with my second post, it wouldn't render the tag, thereby avoiding the error.


After finishing the guide, I needed to figure out how to deploy the React app to Netlify. Posts online say it is as easy as dropping a Build folder into Netlify. However, there's no Build folder in sight in VS Code. Turns out, I had to run npm run build to generate the Build folder and its contents. After that, it was as easy as dropping the folder into the Netlify's deploy folder. You can find the live site on here.

Initially the site would load, but the blog posts wouldn't show up. The fix for this was to add the site url, https://laughing-lamarr-50f7df.netlify.app, as a CORS Origins entry in my Sanity account's API settings.

Tags: #React #Blog #Bookmarks

Extremely good read on how to advance in your career as a software developer. While this guide was mainly written for Junior software developers working at medium-large companies, I reckon even Senior software developers can learn a thing or two from this guide.

Link: Leveling Up: Career Advancement for Software Developers

Tags: #Bookmarks #Career

Interesting read on “the Spotify model”, why Spotify themselves don’t use it and neither should you.

While Spotify gave teams control over their way of working, many people did not have a basic understanding of Agile practices. This resulted in teams iterating through process tweaks in blind hope of finding the combination that would help them improve their delivery. People lacked a common language to effectively discuss the process problems, the education to solve them, and the experience to evaluate performance. It was not really agile. It was just not-waterfall.

Huh, this seems awfully familiar.

When Agile Scrum introduced new meanings to a bunch of words like burn-down and sprint, it did so because it introduced new concepts that needed names. Spotify introduced the vocabulary of missions, tribes, squads, guilds, and chapter leads for describing its way of working. It gave the illusion it had created something worthy of needing to learn unusual word choices. However, if we remove the unnecessary synonyms from the ideas, the Spotify model is revealed as a collection of cross-functional teams with too much autonomy and a poor management structure.

When I first learned about “the Spotify model”, I loved the idea of getting to work in a tribe, squad or guild. I thought it sounded pretty cool. I bet it appealed to most developers who've played MMOs before.

Link: Failed #SquadGoals

Tags: #Bookmarks #Agile #SoftwareDevelopmentManagement

I was reading this article about Xamarin and Swift when I noticed this useful piece of information at the end:

If Swift continues to take the iOS world by storm, more such documentation may be needed. The February 2020 TIOBE Index, which measures programming language popularity, shows Swift at No. 10, having moved up a full 10 positions from the February 2019 ranking, making it the biggest mover in the top 20. C#, used for Xamarin coding, is at No. 5, moving up from No. 7 last year.

Interesting. That bit of info led me to this, the TIOBE Index.

The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings. It is important to note that the TIOBE index is not about the best programming language or the language in which most lines of code have been written.

The index can be used to check whether your programming skills are still up to date or to make a strategic decision about what programming language should be adopted when starting to build a new software system.

I see this as a very useful tool for software developers, not just in figuring out what programming language to use when building a new application, but also in figuring out what programming language to learn or focus on to improve your career as a software developer.

I'm glad to see C# making its way up on the list. I thought Python would be on top, but I guess Java is still too popular nowadays. Also, I keep reading about Rust in the dev blogs/websites that I follow. I wonder when it will break into the Top 20 list? Either way, I think this index is a good list to keep our eyes on as software developers.

Tags: #Bookmarks #ProgrammingLanguages

This is a great resource for anyone who wants to get started with C# and .NET Core.

Link: Hundreds of practical ASP.NET Core samples to learn the fundamentals

Tags: #Bookmarks #AspDotNet #DotNet #DotNetCore

Update 4/23/2021: The write.as team has introduced some rate-limiting features on their API to combat spam bots. That stopped this Glitch app and my other Blazor WASM apps from working.

I created a Glitch App that displays the most viewed posts on my online journal. I embedded it on my About page. Just to show how easy it is to embed a Glitch app into a Write.as post, I embedded it at the bottom of this post too. For more information on embedding Glitch apps into posts on Write.as, look here.

Read more...

Update 4/23/2021: The write.as team has introduced some rate-limiting features on their API to combat spam bots. That stopped this Glitch app and my other Blazor WASM apps from working.

Took me a couple of days, but I got my journal search page up and running. That was a great learning experience.

If you want to remix my search app, you can find it here. If you want to remix the original Write.as Search app, you can find it here.

Prior to creating a Write.as blog, I've never even heard of Glitch. Below is a list of notes and references I've made while trying to get my search page working.

Read more...

Iris Classon wrote a good lengthy post about the history of .NET web development and how it all lead to the development of the .NET Core that we have today. As someone who doesn't get to work as much on the web dev side of things, this was a very informative read for me. I think it is a good read for any .NET developer, so check out her post by following the link below.

ASP.NET Core and .NET Core and the Web Development Stack Timeline

Tags: #Bookmarks #AspDotNet #DotNet #DotNetCore

Uhm the new Windows Terminal is looking rather... fabulous! Honestly, this looks pretty amazing! It also looks like it will be the only command-line terminal I will need in Windows, as it can also work with Powershell. It even has multiple tab support and emojis, wow!

More info: Introducing Windows Terminal

Tags: #Bookmarks #WindowsTerminal

Recently I ran into an issue where I needed to exclude a property from getting serialized using Json.NET. The easy answer is to add a [JsonIgnore] attribute to the property. The problem with doing that is it will also ignore the same property during deserialization. So I needed a solution that allows me to ignore a property using serialization, but still set that property's value during deserialization. Thankfully I found a blog post from 2013 that explains exactly how to do that. I would have wasted more hours searching for an answer had I not found this solution right away.

There's a little known feature of Json.NET that lets you determine at runtime whether or not to serialize a particular object member: On the object you're serializing, you have to define a public method named ShouldSerialize{MemberName} returning a boolean value. – Marius Schulz

Visit Original Post: Conditionally Serializing Fields and Properties with Json.NET

It was only after I found Marius' blog post that I then found the documentation talking about conditional property serialization on the Newtonsoft website.

This is one of the rare instances where I didn't find the answer in StackOverflow. It makes me grateful for the developers who are still cranking out blog posts and sharing solutions to problems on their personal blogs/websites.

#Bookmarks #JsonDotNet #DotNet #Serialization