Skip to content

Instantly share code, notes, and snippets.

View chadstewart's full-sized avatar

Chad Rhonan Stewart chadstewart

View GitHub Profile
@chadstewart
chadstewart / exponential-back-off-type-safe-function.ts
Created February 11, 2024 00:41
Function that takes a async function as an argument, runs the function and returns the data of the function, preserving the argument and return types
const MAX_RETRIES = 3;
const BASE_DELAY_IN_MS = 1000;
export const exponentialBackOffGenericFunc =
// prettier-ignore
<U extends (...args: any[]) => any>(genericFunc: U) => // eslint-disable-line
async (...args: Parameters<U>): Promise<ReturnType<U>> => {
let retries = 0;
const isUnderMaxRetries = retries < MAX_RETRIES;
@chadstewart
chadstewart / ts-boilerplate.md
Created December 5, 2023 01:00 — forked from silver-xu/ts-boilerplate.md
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@chadstewart
chadstewart / HOW.md
Created September 30, 2023 01:56 — forked from Hacksore/HOW.md
Run tsx in VSCode Debugger
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Run tsx in VSCode Debugger",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "node",
 "runtimeArgs": ["--loader", "tsx"],
@chadstewart
chadstewart / interview-questions.md
Created April 10, 2023 23:35 — forked from colabottles/interview-questions.md
Interview questions to ask interviewer
  1. What is the company vision?
  2. What is your passion with/about the company/your role?
  3. What is the company culture?
  4. How did you get into this role?
  5. What keeps you up at night about this role?
  6. Are there plans to extend the team?
  7. What is the ratio of front end to back end developers?
  8. Walk me through the decision-making process.
  9. What have you learned from people in roles beneath yours?
  10. What have you learned form older/younger developers?
@chadstewart
chadstewart / tatiana-mac-speaker-rider.md
Created November 23, 2022 18:11 — forked from tatianamac/tatiana-mac-speaker-rider.md
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

@chadstewart
chadstewart / backtracking_template.py
Created December 7, 2021 14:59 — forked from RuolinZheng08/backtracking_template.py
[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())
@chadstewart
chadstewart / add-two-numbers.js
Created October 3, 2021 20:09
My attempted solution to the Leetcode problem add two numbers. Used a problem-solving framework to get to the solution.
/*
//Problem Statement
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 itself.
//Examples
@chadstewart
chadstewart / problem-solving-framework-skeleton.txt
Last active October 4, 2021 08:34
Problem-solving framework for solving algorithmic interview questions
/*
Framework Skeleton
Understanding the problem {
//Problem Statement
*Problem Statement in own words go here*