Skip to content

Instantly share code, notes, and snippets.

View gabrielsimplicio's full-sized avatar

Gabriel Simplício gabrielsimplicio

View GitHub Profile
@geerteltink
geerteltink / json-stringify-parse.js
Last active November 5, 2023 16:19
Using JSON.stringify (toJSON) and JSON.parse (fromJSON) to (re)store JavaScript classes
class Commit {
constructor(sha, payload) {
this.sha = sha;
this.repository = payload.repository;
this.created = new Date();
}
toJSON() {
return Object.assign({}, this, {
created: this.created.toString()
## Para configurar o proxy via comando direto no bash(terminal) use 'export' ##
## caso sua senha possua caractéres especiais, substitua desssa forma: ##
! - %21
@ - %40
# - %23
$ - %24
export http_proxy="http://<user>:<pass>@<proxy>:<port>/"
@niksumeiko
niksumeiko / git.migrate
Last active June 28, 2024 21:01
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.