Skip to content

Instantly share code, notes, and snippets.

View jasonappah's full-sized avatar
:shipit:

Jason Antwi-Appah jasonappah

:shipit:
View GitHub Profile
@pesterhazy
pesterhazy / building-sync-systems.md
Last active May 18, 2024 21:47
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@kddnewton
kddnewton / natalie.svg
Created February 4, 2022 20:29
Natalie logo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sindresorhus
sindresorhus / esm-package.md
Last active May 18, 2024 09:04
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.
@cnp96
cnp96 / delta-sync.sh
Created November 3, 2020 18:55
Sync MongoDB instances
#!/bin/bash
# DB info
old_db="source_database_name"
# Connection info
uri="source_db_connection_string"
to_uri="target_db_connection_string"
# Storage info
@antonkomarev
antonkomarev / git-io-custom-url.md
Created September 15, 2020 08:50 — forked from dikiaap/git-io-custom-url.md
git.io custom URL

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
  • https://*.github.com/*
  • https://*.github.io
@hyperupcall
hyperupcall / change-master-branch-to-main.sh
Last active May 14, 2021 04:35
Cross-platform shell script to change the 'master' branch to 'main' for the local and remote repository
#!/bin/sh -eu
# code licensed under BSD 2-Clause "Simplified" License
# see `change-master-branch-to-main.sh --help` for usage
# see twitter thread for more details: https://twitter.com/EdwinKofler/status/1272729160620752898
site="github.com"
oldDefaultBranch="master"
newDefaultBranch="main"
@KATT
KATT / favourite-ts-tricks.md
Last active July 26, 2023 06:16
🧙‍♂️ Favourite non-obvious TS tricks

Record<string, x | undefined>

Represent maps

// rather than 
const map: {[ key: string ]: string} = {
  foo: 'bar',
}
According to all known laws of aviation, there is no way a bee should be able to fly.
Its wings are too small to get its fat little body off the ground.
The bee, of course, flies anyway because bees don't care what humans think is impossible.
Yellow, black. Yellow, black. Yellow, black. Yellow, black.
Ooh, black and yellow!
Let's shake it up a little.
Barry! Breakfast is ready!
Coming!
Hang on a second.
Hello?
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 19, 2024 16:16
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 19, 2024 10:52
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example