Skip to content

Instantly share code, notes, and snippets.

View jasoncarr95's full-sized avatar

Jason Carr jasoncarr95

View GitHub Profile
@jasoncarr95
jasoncarr95 / chatgpt2md.js
Last active July 12, 2023 15:09
Export ChatGPT Conversation To Markdown.
/**
* Export ChatGPT Conversation to Markdown
* @version 1.1.0
* @Updated 2023-07-02
*/
function getFileName() {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, "0");

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@jasoncarr95
jasoncarr95 / ssh-apple-keychain.md
Last active January 27, 2023 23:39
How to cache your ssh key in the macOS keychain

How to cache your ssh key in the macOS keychain

ssh-add --apple-use-keychain ~/.ssh/id_ed25519

Test

To test that it worked, run ssh-add -L and you should see your key listed.

@jasoncarr95
jasoncarr95 / updateAllKeysToCamelCase.playground
Created January 10, 2023 01:59
How to update all keys in a MongoDB collection to be camel case
// How to update all keys in a MongoDB collection to be camel case
// Run this in the mongo shell
const DB = "my-db"; // Replace with your database name
const COLLECTION = "my-collection"; // Replace with your collection name
// Select the database to use.
use("DB");
// Converts a string to camel case (e.g. "hello world" -> "helloWorld")
@jasoncarr95
jasoncarr95 / grokking_to_leetcode.md
Created November 12, 2022 01:49 — forked from tykurtz/grokking_to_leetcode.md
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