Skip to content

Instantly share code, notes, and snippets.

View Steakeye's full-sized avatar

Andrew Keats Steakeye

View GitHub Profile
@Steakeye
Steakeye / git-prompt.sh
Created October 16, 2025 09:18
bash/zsh git prompt support - copy
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
@Steakeye
Steakeye / nvm-use.sh
Created October 9, 2025 15:43
Standalone NVM use script to be included in the bash profile/rc file
# This script will trigger nvm use is there is an .nvm-use file with auto set to true
cdnvm() {
command cd "$@" || return $?
upfind () {
local res=$(ls -f $1 2>/dev/null)
if [ ! -z $res ]; then
echo $res
return 0;
@Steakeye
Steakeye / firewall-enable-port.ps1
Last active September 24, 2024 18:42
Sharing WSL2 hosted server with host LAN
param(
[Parameter(Position=0,mandatory=$true)][String] $port
)
echo "Enabling port in firewall..."
echo "Port $port"
netsh advfirewall firewall add rule name="Open Port $port" dir=in action=allow protocol=TCP localport=$port
@Steakeye
Steakeye / enable-adb-port-for-wsl2.ps1
Last active August 28, 2025 15:07
Setup ADB on WSL and the Windows host so you can connect to the Android device from WSL
netsh advfirewall firewall add rule name="ADB WSL2: Open Port 5037" dir=in action=allow protocol=TCP localport=5037 remoteip=172.16.0.0/12 profile=domain,private
@Steakeye
Steakeye / System Design.md
Created June 1, 2023 14:51 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@Steakeye
Steakeye / system-design-cheat-sheat.md
Created June 1, 2023 14:50 — forked from krebernisak/system-design-cheat-sheat.md
System design cheat sheet - It can be used for interviews or assessments (forked from Nikolay Ashanin)

System design cheat sheet

It can be used for interviews or assessments.

1. Understand problem and scope:

  • Recognize stakeholders and prioritize them. Create RACI matrix
  • Understand business drivers of the project
  • Recognize end-users of the project and understand how they will use that system
  • Check functional requirements
  • Define external dependencies
  • Suggest additional features
  • Remove items that interviewer considers out of scope
@Steakeye
Steakeye / singleton-pattern.ts
Last active November 29, 2021 15:38
TypeScript singleton pattern
export const singleton = new (class Singleton {
constructor(p: string) {}
})('param');
@Steakeye
Steakeye / list-scripts.sh
Created July 22, 2021 13:32
Run a single line node command to get the scripts listed in package.json
#!/usr/bin/env bash
node -e "console.log(require(require.resolve('./package.json')).scripts)"
html-react-parser #parse strings to React elements
react-ga #Google Analytics for React
react-cookie-consent #cookie consent banner
const Units = {
one: 'I',
five: 'V',
ten: 'X',
fifty: 'L',
hundred: 'C',
fiveHundred: 'D',
thousand: 'M',
}