Redux Toolkit with Typescript Jan 25, 2020 Redux Toolkit is a really exciting new library from the Redux developers. The project site describes it as “the official, opinionated, batteries-included toolset for efficient Redux development”. When using React with Redux, I’ve always found writing Redux code a bit cumbersome. Defining action types, actions and reducers always feels like a lot of boilerplate. Plus the Redux core team deliberately leaves Redux unopinionated, so it works for as many use cases as possible. ...
Using Microsoft DependencyInjection, Configuration and Logging outside of an ASP.Net project Jan 25, 2020 I wanted to use Microsoft’s dependency injection framework for a console application I was building, a little web scraper for fun. I thought it would be a simple way to get logging and configuration injection for free (using the libraries from ASP.Net). Its a bit overkill for the purpose of this application, but gave me a better idea of how ASP.Net core works under the hood. The tricky part was finding which libraries I needed and knowing what functions to call to setup DI. ...
Getting started with Go Jan 12, 2020 This article is an expression of my thoughts and approach when learning Go recently. I found parts of Go to be a bit confusing (not the language itself, instead the tooling around it), so I documented the things that confused me in the Things I Encountered, Gotchas section. Hopefully that section helps other beginners that run into the same problems that I did. When I get a better idea of how it works I’ll add a updates. ...
React Hooks and Functional Components Sep 17, 2019 Intro Hooks is a relatively new feature in React which allows adding state to functional components. Hooks offer a few advantages over class components, such as easier code reuse. This blog post is a nice overview of hooks. One of my main takeaways from the article is the three dot points at the start that explain rationale behind adding hooks to React. I’d like to extend on some of the points mentioned in the article and rephrase them more as what improvements hooks offer: ...
Getting Started with Nuxt Sep 08, 2019 As the Nuxt.js website says, Nuxt is a framework that makes it easier for building Vue applications. From what I can tell, theres two main uses for Nuxt: Server Side Rendered applications and Single Page Applications. A server side rendered Nuxt application is hosted through a node process on a server, which prerenders the page before sending it to a browser. Personally I’m more interested in the SPA features that Nuxt provides, mainly because theres a plethora of free hosting options for single page applications (after all its just static HTML, JS and CSS). ...
Fedora Server Notes Jun 23, 2019 firewalld configuration I installed Fedora Server on an old laptop and ran into some issues when I tried accessing an application running on it. It ended up being a firewall issue, so Fedora uses firewalld as the firewall, which I haven’t used before, and it blocks most ports be default. So below is the steps for exposing a MQTT broker on port 1883 firewall-cmd --add-port=1883/tcp --permanent firewall-cmd --reload The first command adds the port (1883) and protocol (tcp) as an exception to the firewall, the --permanent flag will apply this rule permanently (otherwise it will reset when the firewall is reloaded) ...
Installing Linux on an External HDD Jun 04, 2019 I wanted to install Linux on a portable SSD I had and make it bootable from my Macbook, so it needed UEFI support. I didn’t find a nice method of doing it online, so I found my own way. Before going over the instructions, I’ll touch base on the difference between BIOS, EFI and UEFI. These are all methods of booting an operating system. BIOS is the legacy boot mode found on older computers. ...
Learning Reactive Programming with RxJS May 31, 2019 Resources Reactive Trader, A large, production scale example application Advanced Caching with RxJS, has examples for designing larger observables Snake Clone tutorial RxJS React Hooks How can I help my team love RxJS? Redux in a single line of code with RxJS Nice services pattern Angular Services I really like the way Angular defines services, here is an example of what I mean: // services/message.service.js import { BehaviorSubject } from "rxjs"; const messages = new BehaviorSubject([]); // Export the service // This is the public API export default { getMessages: () => messages. ...
My Linux Setup May 30, 2019 I’ve been getting back into linux, and started with installing Fedora on my Macbook Pro, below are some notes I used during the install. Fedora Macbook Pro Setup RPM Fusion sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm Wifi brcmfmac drivers aren’t very good, certain wifi channels cause the screen to flicker. To prevent flickering, change the channel mbpfan Project site: https://github.com/dgraziotin/mbpfan Installation steps: 1. Download repo 2. ...
Home Automation with Home Assistant Apr 26, 2019 What is it? Home Assistant is an open source home automation platform. Conceptually it is a central platform that can communicate with smart home devices (such as lights, motion detectors, alarm systems, thermostats and much more). For people familiar with smart home devices, the most annoying problem with them is every manufacturer has a different app to control their devices. Since I have Wemo switches, TP Link switches and Hue lights, I need to constantly switch between the 3 apps to control my home. ...