Skip to content

Instantly share code, notes, and snippets.

View motdde's full-sized avatar
🤿
Experementing

Uncool Olu motdde

🤿
Experementing
View GitHub Profile
@ivermac
ivermac / gist:471bced069c3928e4033c4c7522b57c1
Last active October 4, 2025 04:30
Renaming user in ubuntu when using WSL2

Recently (well a couple of hours ago 😆) I installed Ubuntu 22.04 on my WSL2 but I misspelled my username and I had to ( wanted to is more accurate 😆) change to my preferred username. I got all my insights from here and here.

 wsl -d ubuntu-22.04 -u root usermod -l <new-username> <old-username>
 wsl -d ubuntu-22.04 -u root groupmod -n <new-groupname> <old-groupname>
 wsl -d ubuntu-22.04 -u root usermod -d /home/<new-home-directory> -m <new-username>

I got excited this worked the first time and I wanted to write about it 😄

@sindresorhus
sindresorhus / esm-package.md
Last active December 16, 2025 09:46
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
# Source: https://gist.github.com/48f44d3974db698d3127f52b6e7cd0d3
###########################################################
# Automation of Everything #
# How To Combine Argo Events, Workflows, CD, and Rollouts #
# https://youtu.be/XNXJtxkUKeY #
###########################################################
# Requirements:
# - k8s v1.19+ cluster with nginx Ingress
# Source: https://gist.github.com/764b402c8979678dfde01fd8f63c22e2
###########################################################
# Kustomize vs Helm #
# The Fight Between Templating and Patching in Kubernetes #
# https://youtu.be/ZMFYSm0ldQ0 #
###########################################################
# Links to referenced videos:
# - https://youtu.be/sUPkGChvD54
# Source: https://gist.github.com/07b0b4642b5694d0239ee7c1629173ce
#######################################################
# Kustomize #
# How to simplify Kubernetes configuration management #
# https://youtu.be/Twtbg6LFnAg #
#######################################################
#########
# Setup #
@RuolinZheng08
RuolinZheng08 / backtracking_template.py
Last active November 20, 2025 09:28
[Algo] Backtracking Template & N-Queens Solution
def is_valid_state(state):
# check if it is a valid solution
return True
def get_candidates(state):
return []
def search(state, solutions):
if is_valid_state(state):
solutions.append(state.copy())
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active December 9, 2025 19:42
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@stepney141
stepney141 / BookmarkAPI_en.md
Last active December 10, 2025 02:53
(DEPRECATED) Twitter Undocumented Endpoints for Bookmark
@singh1114
singh1114 / param_middleware.js
Last active January 25, 2021 20:11
Node.js middleware article
const validateParams = function (requestParams) {
return function (req, res, next) {
for (let param of requestParams) {
if (checkParamPresent(Object.keys(req.body), param)) {
let reqParam = req.body[param.param_key];
if (!checkParamType(reqParam, param)) {
return res.send(400, {
status: 400,
result: `${param.param_key} is of type ` +
`${typeof reqParam} but should be ${param.type}`
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active December 17, 2025 00:27
Conventional Commits Cheatsheet