Skip to content

Instantly share code, notes, and snippets.

View almeidx's full-sized avatar
:shipit:

Almeida almeidx

:shipit:
View GitHub Profile
@Tsugami
Tsugami / remove-methods-from-interface.ts
Last active December 8, 2023 07:43
Type to remove methods from interface in Typescript
interface Base {
a: unknown;
b: unknown;
c: unknown;
foo(): unknown;
bar(): unknown;
}
type RemoveMethods<T> = { [P in keyof T as T[P] extends (...args: any) => any ? never : P]: T[P] }
@sindresorhus
sindresorhus / esm-package.md
Last active May 3, 2024 10:19
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.
@advaith1
advaith1 / discordjs-slash-commands.md
Last active April 20, 2024 05:39
Slash Commands in Discord.js
@karbassi
karbassi / Git gpg stuck.md
Created February 5, 2020 15:26
If your git process gets stuck during the `gpg` signing phase, you can restart `gpg` by running

If your git process gets stuck during the gpg signing phase, you can restart gpg by running

gpgconf --kill gpg-agent
[alias]
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
@Beneboe
Beneboe / how-to-setup-verified-commits.md
Last active March 20, 2024 18:20
How to Setup Verified Commits on Github
@matthewzring
matthewzring / markdown-text-101.md
Last active May 2, 2024 20:07
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream