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. ...
VSCode tips Apr 08, 2019 Keyboard Shortcuts Command Shortcut Toggle sidebar Ctrl+B Quick Fix Ctrl+. Open Settings Ctrl+, Indent/Outdent Ctrl+[, Ctrl+] Vim Bindings Shortcuts Command Shortcut Show tooltip gh Text reflow (on selection) gq Jump to definition gd Autocomplete and Linting in Python Create a . ...
Dockerise Wordpress Apr 07, 2019 Rationale A friend of mine has a startup and is after a Wordpress site that is easy to maintain. His startup is looking at developing a suite of small web applications to compliment the site, with that in mind I chose to build it with Docker, as it low maintenance, easy to change hosting providers and easy to host applications side by side. What is Docker Docker makes it easier to develop and deploy applications by using containers (which are kinda like virtual machines, but more lightweight). ...
Crafting Restful APIs Mar 02, 2019 Resources Resources represent an entity, for example a car, building, person, etc. I usually use name my resources as plural, as most of the time I’m working with a collection of entities. Its easiest to think of your API like a database, it is used to create, read, update or delete data. HTTP Verbs HTTPS verbs describe the action thats going to take place, for example: - GET: Used for retrieving resources - POST: Used for creating resources - PUT: Used for updating resources - DELETE: Used for deleting resources ...