Skip to content

Instantly share code, notes, and snippets.

View JeffersonCarvalh0's full-sized avatar

Jefferson Carvalho JeffersonCarvalh0

View GitHub Profile
@guilhermedecampo
guilhermedecampo / multiple-push-urls.md
Created February 1, 2019 12:24 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@MrChocolatine
MrChocolatine / TS - More precise return type method Date#toISOString.d.ts
Last active June 3, 2025 07:09
TypeScript – How to accurately type dates in ISO 8601 format
// In TS, interfaces are "open" and can be extended
interface Date {
/**
* Give a more precise return type to the method `toISOString()`:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
*/
toISOString(): TDateISO;
}
type TYear = `${number}${number}${number}${number}`;