Skip to content

Instantly share code, notes, and snippets.

View martin-mok's full-sized avatar

Martin martin-mok

  • /dev/null
View GitHub Profile
@VictorCandido
VictorCandido / README.md
Created March 1, 2024 15:46
NodeJs Typescript Vitest Setup

NodeJs Typescript Vitest Setup

Init project

Run commands above to setup project

  • npm init -y to init NodeJs project
  • npm install typescript tsx @types/node vitest -D to install typescript and Vitest as testing library
  • npx tsc --init to create typescript configuration file

Typescript setup

Edit below items in tsconfig.json

@rain-1
rain-1 / LLM.md
Last active June 28, 2025 14:59
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@Preethi-Dev
Preethi-Dev / git__stash__commands.md
Created March 31, 2022 15:19
Cheat sheet for git stash commands

Stash the changes

  1. git stash
  2. git stash save

Stash the untracked files

  1. git stash --include-untracked
  2. git stash -u

List the stashes

  1. git stash list

show the latest stash

  1. git stash show
@samlaf
samlaf / transfer-vs-send-vs-call.sol
Last active March 11, 2022 21:07
Sending Ether (transfer, send, call)
// In https://solidity-by-example.org/sending-ether/
// They say: call in combination with re-entrancy guard is the recommended method to use after December 2019.
// (see https://consensys.github.io/smart-contract-best-practices/recommendations/#dont-use-transfer-or-send for an explanation)
// and compare the gas fees of the 3 methods:
// transfer (2300 gas, throws error)
// send (2300 gas, returns bool)
// call (forward all gas or set gas, returns bool)
// I tested all 3 methods, by sending 10 eth to a contract and then withdrawing using these functions:
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active July 1, 2025 20:32
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

@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active June 29, 2025 11:04
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@martin-mok
martin-mok / c++_cheat-sheet.md
Created June 9, 2020 18:56 — forked from rubienr/c++_cheat-sheet.md
C++ Cheat Sheet
@fabiolimace
fabiolimace / UUIDv6.sql
Last active June 25, 2025 11:27
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@martin-mok
martin-mok / nativeJavaScript.js
Created January 6, 2020 22:49 — forked from alexhawkins/nativeJavaScript.js
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests