Skip to content

Instantly share code, notes, and snippets.

View mumairofficial's full-sized avatar
Trying to invent useful tools

Muhammad Umair mumairofficial

Trying to invent useful tools
  • Toronto, ON
View GitHub Profile
mumairofficial /
Created April 10, 2024 01:59 — forked from noelbundick/
Optimizing Rust container builds

Optimizing Rust container builds

I'm a Rust newbie, and one of the things that I've found frustrating is that the default docker build experience is extremely slow. As it downloads crates, then dependencies, then finally my app - I often get distracted, start doing something else, then come back several minutes later and forget what I was doing

Recently, I had the idea to make it a little better by combining multistage builds with some of the amazing features from BuildKit. Specifically, cache mounts, which let a build container cache directories for compilers & package managers. Here's a quick annotated before & after from a real app I encountered.


This is a standard enough multistage Dockerfile. Nothing seemingly terrible or great here - just a normal build stage, and a smaller runtime stage.

Specification Keyword RGB hex value
CSS Level 1 black #000000
CSS Level 1 silver #c0c0c0
CSS Level 1 gray #808080
CSS Level 1 white #ffffff
CSS Level 1 maroon #800000
CSS Level 1 red #ff0000
CSS Level 1 purple #800080
CSS Level 1 fuchsia #ff00ff
CSS Level 1 green #008000
mumairofficial /
Created March 18, 2020 13:04 — forked from mscharhag/
Examples for using the Java 8 Date and Time API (JSR 310)
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {

What I Use

WIP: Personal blog & portfolio; will migrate this list once done!


  • Dell 27" Monitor: P2719H
  • Dell Precision 7520
    • 2.90 GHz
    • 1TB SSD
    • 32GB Memory
  • Logitech MX Master 2 Mouse
mumairofficial / sublime-settings.json
Last active July 14, 2022 22:33
sublime text 3 settings
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Agila Theme/Agila Classic Oceanic Next.tmTheme",
"default_encoding": "UTF-8",
"draw_minimap_border": true,
"draw_white_space": "all",
mumairofficial /
Created October 19, 2019 01:52 — forked from ygotthilf/
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out
cat jwtRS256.key
mumairofficial /
Created September 19, 2019 11:28 — forked from anhldbk/
TLS client & server in NodeJS

1. Overview

This is an example of using module tls in NodeJS to create a client securely connecting to a TLS server.

It is a modified version from documentation about TLS, in which:

  • The server is a simple echo one. Clients connect to it, get the same thing back if they send anything to the server.
  • The server is a TLS-based server.
  • Clients somehow get the server's public key and use it to work securely with the server

2. Preparation

name = mumair
email =
gcmsg = commit -m
# Git Commit, Add all and Push — in one step.
cap = "!f() { git commit -m \"$@\"; }; f" # git push; <- can add this as well | git add .;