Okay I am sneaking this in before the year ends. Funny how this will end up being my last post of the year.
-
posts
-
An app that shows everything I am learning about image processing
-
OpenCV 4.2 on Apple M1 (Pro) with Python3.8 bindings
I wasted 2 hours on building OpenCV 4.2.0 from source on Apple M1 Pro with Python3.8 bindings. Here are the steps if anyone else is stuck on this. I am on Mac OS Mojave btw.
-
A Custom segment for Powerlevel10K
-
Setting up esp-idf on CLion for ESP32 development on Apple M1
-
Drug wars in Rust
I remember the OG Drugwarz. It was a tiny game with a text UI. Then I played it on Windows with a small UI. It was a lot of fun. I want to now build it using JS. But I want to use Rust to create the core of it. So the idea is to use Rust with wasm-bindgen to create a javascript backend and use it with something like PhaserJS as a UI.
-
10 days 5 games
BYOG is back in town and we’re getting a lot of time to get ready. I’ve tried and tried to build a game and then build on top of that but for some reason my engergy fizzles out. Usually it’s because things aren’t moving as fast as I’d like them or I am fighting the framework/game engine. I mean half the time you’re trying to figure out how to do something in Unity and then you lose out on the momentum to actually build the next thing on the list.
-
CUPS Printer Server on the Raspberry Pi
Recently acquired a $30 laser printer from a flash sale. The B/W Brother HL-L2320D. Decided to use CUPS on the RPi to share the printer on the local network. First things first, Brother doesn’t provide drivers for the printer compiled for the ARM architecture. But the brlaser project mercifully has support for many series.
-
Rust ownership notes
So Rust has a steep learning curve. I keep coming back to the ownership documentation to clear a few things up. Here are some of the things I might find useful for later.
-
Javascript const, let, var and other things like expressions vs declarations
ES2015 introduced
let
andconst
which has really increased the readability of javascript code and helps fix an important issue with how variables are declared. Before this, we hadvar
, the only way to declare variables. Turns out it was quite a bad idea sincevar
didn’t allow block scoping. It used to pierce throughfor
,if
etc. blocks which meant you could have an unexpected output on your hands. It was especially bad since you didn’t have to declare the variable to initialize it and use it in code lexically. -
What is async/await? Is it the same thing across different languages?
So I have the basics down, all programs run sequentially. You have a single thread running tasks one at a time irrespective of the time they take to execute.
-
What is Async/Await? Exploring this using Javascript
Okay so I spent way too much time on this and in the end the most basic question kept ringing in my head “What is the purpose of async code?”. I understand (now) what the
async
await
keywords do but the fundamental question is what is asynchronous code and why is it useful? So I am going to tackle that first. -
Questions I am too afraid to ask
Okay full confession - there are things I’ve used regularly in the past that I don’t understand. Coming from an engineering background, implementation has taken precedence over core knowledge. Getting the job done was more important than understand how the tool works internally or what the building blocks where. I’ve never had to know or learn how the compiler works intrinsically to use it. But I want to remedy that
-
Docker Notes - Part 4
While working with celery workers it’s important to understand scale. Recently while trying to stand up celery workers for development I was confronted with an opportunity to stand up independent celery boxes to run multiple workers.
-
Typescript imports
So to work with Typescript we need to get a type definitions for the packages we’re using. But we generally see this error when we try to import the package.
-
Docker Notes - Part 3
Multi container applications. You need multiple docker containers to do your bidding because every component might need to be scaled. And obviously because you hate yourself so you resort to automating this stuff that takes you longer than it would if you were to use bare deployments using Ansible.
-
Docker Notes - Part 2
Now that the basics are down, time to actually create a simple app and dockerize it. A simple python Flask app should do it.
-
Docker Notes - Part 1
I am not a big fan of Docker because I think it creates more problems than it solves. However I’ve needed to use it for work because well - nevermind. Anyway, here are some Docker notes I am keeping for myself so that I can refer them later.
-
Learning Typescript
I’ve decided to learn Typescript since I am on a roll - learning strongly typed languages. I am currently working on Rust and Python and it’s only fair to start using Typescript to build all my Electron/React/Native projects.
-
Rust async is only available in 2018 edition error
A common issue while working with a cargo project is seeing an annoying squiggly line under
async
keyword with the error -
Nifty cargo package to update dependency
The cargo-edit package allows you to update dependency in your Cargo.toml file instead of having to write it down manually
-
Some GIT stuff I keep forgetting
Some git stuff I use often but for some reason I keep forgetting
-
Unity2D - Orthographic camera size
I’ve decided to learn Unity2D by building old games. I started off by building Pong from this tutorial. Obviously, learned a lot.
-
Raspberry Pi - Chromium on boot in kiosk mode
Recently, I built this using Django. It’s my Gym’s leaderboard running on a Digital Ocean droplet. I decided to use a Raspberry Pi running perpetually displaying the leaderboard in the gym. Apparently it has become a huge motivator (even for me).
-
Goodbye Ghost. Hello again Github
I am moving away from Ghost. It’s just hard to maintain on your own and I am not paying for a pro account. I mean I can see its merits if I were a pro blogger but I write to keep track of stuff mostly. So Github will do. I am pretty sure I am behind on 2 major updates and at this point it’s just too much work to integrate all those minor and major updates.
-
Python 3.5.X base64 encoding
I swear to god, I am not dark, but I have pretty much thought about drowning myself ten times in the last hour trying to figure this out. So I guess this is worthy of a post.I’ve been working with the GMail Python API and in order to send data it has to be b64 encoded.