Skip to content

Instantly share code, notes, and snippets.

View sanjeed5's full-sized avatar

Sanjeed sanjeed5

View GitHub Profile

TypeScript

  • Only create an abstraction if it’s actually needed
  • Prefer clear function/variable names over inline comments
  • Avoid helper functions when a simple inline expression would suffice
  • Use knip to remove unused code if making large changes
  • The gh CLI is installed, use it
  • Don't use emojis

React

@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active December 26, 2025 00:21
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@sanjeed5
sanjeed5 / download_kaggle_to_collab
Last active August 16, 2021 08:19
How to download competition dataset from Kaggle to Google Collab easily and unzip
# Copy paste this gist in a Google Collab cell
# Go to your Kaggle competition page -> data, scroll below to see the kaggle api command which looks similar to below line
# !kaggle competitions download -c competitive-data-science-predict-future-sales -p data
# Replace that line accordingly in the below code
# Run the cell
!pip install kaggle
from google.colab import files
files.upload()
@sindresorhus
sindresorhus / esm-package.md
Last active December 25, 2025 12:39
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.