Snippets Collections
 sudo du -ah / --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/home/virtfs | sort -rh | head -n 20
import axios, { AxiosError } from 'axios';

// Crea una instancia de Axios
const instance = axios.create({
  baseURL: '',
  // Aquí puedes añadir más configuraciones si es necesario

// Simula un error 503 en todas las respuestas utilizando un interceptor
  response => {
    // Crea un error de Axios simulado
    const axiosError = new AxiosError(
      "Service Unavailable", // mensaje de error
      "ECONNABORTED", // código de error, este es un ejemplo, puede ajustarlo según sea necesario
      undefined, // config, puedes añadir la configuración de la solicitud aquí si es necesario
      undefined, // request, puedes añadir la solicitud aquí si es necesario
      { // response, aquí construyes la respuesta simulada
        status: 503,
        statusText: 'Service Unavailable',
        headers: response.headers,
        config: response.config,
        data: 'Service Unavailable'

    // Rechaza la promesa con el error de Axios simulado
    return Promise.reject(axiosError);
  error => {
    // Este bloque maneja errores reales de las peticiones
    return Promise.reject(error);

export const extractName = async (
  text: TExtractNamePayload
): Promise<{ data: TExtractNameResponse; status: number }> => {
  instance.defaults.headers['Authorization'] = `Bearer ${process.env.EXPO_PUBLIC_SERVER_SECRET_KEY}`;
  try {
    const response = await<TExtractNameResponse>('/api/v1/conversation/entity-extraction/names', text);
    return { data:, status: response.status };
  } catch (error) {
    if (axios.isAxiosError(error)) {
      // Aquí capturas el error simulado o real y lo devuelves
      return { data: error.response?.data, status: error.response?.status };
    // Manejo de otros tipos de errores
    throw error;
> eval `ssh-agent`
> ssh-add /c/Users/roberto/.ssh/gitlab
<a href="" target="_blank">New Tab</a>
# download a repository on GitHub to our machine
# Replace `owner/repo` with the owner and name of the repository to clone
git clone

# change into the `repo` directory
cd repo

# create a new branch to store any new changes
git branch my-branch

# switch to that branch (line of development)
git checkout my-branch

# make changes, for example, edit `` and `` using the text editor

# stage the changed files
git add

# take a snapshot of the staging area (anything that's been added)
git commit -m "my snapshot"

# push changes to github
git push --set-upstream origin my-branch
1. git checkout dev-david
2. git rebase master
3. git add .
4. git rebase --continue

Successfully rebased and updated refs/heads/dev-david.
5. git push origin dev-david --force
6. git checkout master
7. git merge dev-david 
8. git push

git rebase --continue
git rebase --abort
#!/usr/bin/env bash

# install github-cli
VERSION=`curl  "" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-`
mkdir ~/downloads
curl -sSL${VERSION}/gh_${VERSION}_linux_amd64.tar.gz -o ~/downloads/gh_${VERSION}_linux_amd64.tar.gz
cd ~/downloads
tar xvf gh_${VERSION}_linux_amd64.tar.gz
sudo cp gh_${VERSION}_linux_amd64/bin/gh /usr/local/bin/
gh version
sudo cp -r ~/downloads/gh_${VERSION}_linux_amd64/share/man/man1/* /usr/share/man/man1/
# man gh
gh auth login

rm -r ~/downloads
name: Generate
      - main
      - master
    name: Generate changelog
    runs-on: ubuntu-latest
      - name: Checkout
        uses: actions/checkout@v2
          fetch-depth: 0
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Generate a changelog
        uses: orhun/git-cliff-action@v1
        id: git-cliff
          config: ./cliff.toml
          args: --verbose
          OUTPUT: ./

      - name: Print the changelog
        run: cat "${{ steps.git-cliff.outputs.changelog }}"

      - name: Commit and Push Changes
        uses: actions-js/push@master
          github_token: ${{ secrets.GITHUB_TOKEN }}
    description: Bugfixes in codebase when something is not working.
    colour: 'd73a4a'
    description: New enhancements and features.
    colour: '1B6659'
    description: Improvements or additions to docs.
    colour: '0075ca'
    description: Indicates a new release.
    colour: '108a51'
    description: Configuration and meta-infrastructural changes.
    colour: '8ed92e'
    description: Code refactoring.
    colour: 'D0EFCD'
    description: Further information requested.
    colour: 'd876e3'
    description: Issues pertaining to data or data preparations.
    colour: 'FAA631'
    description: Issues related to tests.
    colour: 'e4e669'
To untrack a single file that has already been added/initialized to your repository, i.e., stop tracking the file but not delete it from your system use: git rm --cached filename

To untrack every file that is now in your .gitignore:

First commit any outstanding code changes, and then, run this command:

$ git rm -r --cached .

This removes any changed files from the index(staging area), then just run:

$ git add .

Commit it:

$ git commit -m ".gitignore is now working"

*Note :- Be sure to merge your branches back to master or move your pointer otherwise you might lose your branch 
 * select Clone or Download and Use SSH
 * You will get a URL for the SSH protocol in the form<user>/<repo>.git
 * Then run the following command in your working tree to tell Git to use this URL instead of the current one
git remote set-url origin<user>/<repo>.git
git push origin <your_branch_name> --force
git branch -d <local-branch> (soft delete)

git branch -D <local-branch> (hard delete)

git push origin --delete <remote-branch-name>
Using Git and Heroku

1) In terminal - git init

This creates a hidden file .git

2) git add .

This will creating a new copy of the work. This is a staging area.

3) git commit -m "Initial Commit"

This will making a commit of the version

[ These stages can be done using GitHub Desktop]

4) Then on terminal: heroku login

This will offers to open a browser. On the window that opened log in and close the window. 

5) $ heroku git:remote -a <name> if already created on heroku - or -   heroku create

this will show something like this in terminal: |

6) Create Procfile

$ touch Procfile 

7) Find Procfile (should be empty) and add: web: node app.js (same file as we use for starting the application with nodemon).

8) Need to change port address to heroku’s dynamic port:

let port = process.env.PORT;if (port == null || port == "") { port = 3000;};app.listen(port, function () { console.log("Server started successfully");});

9) Choose a database host - we already have that so ignore.

10) Language specific setup: 

Need to specify the version of node to heroku:

in terminal: $ node --version, 

then in package.json add: 

"engines": { "node": "12.x" } [or whatever version. No need to be totally specific hence the ‘x’]. Can insert before the dependencies start.

11) Create .gitingnore file:

touch .gitignore and in .gitignore: 





12) Deploy on heroku: 

Before deploying - push to git one more time for last changes to be added:

git add . 

git commit -m “<chanages made to go in here>”

$ git push heroku master

[note: at this point I had an error message: ‘error: src refspec master does not match any’.

I needed to change the branch from ‘main’ on the bottom left of vs code to ‘master’ by adding a branch master through vs code. I then pushed again and it worked.]

Committing directly to git: - below is the relevant content:

1) Navigate to the local project directory and create a local git repository: (already done above)

 git init

2) Once that is successful, click on the 'Source Control' icon on the left navbar in VS-Code.One should be able to see files ready to be commit-ed. Press on 'Commit' button, provide comments, stage the changes and commit the files. Alternatively you can run from CLI (already done abovre)

git commit -m "Your comment"

3) Now you need to visit your GitHub account and create a new Repository. Exclude creating '', '.gitIgnore' files. Also do not add any License to the repo. Sometimes these settings cause issue while pushing in.

4) Copy the link to this newly created GitHub Repository.

5) Come back to the terminal in VS-CODE and type these commands in succession:

git remote add origin <Link to GitHub Repo>     //maps the remote repo link to local git repo

git remote -v                                  //this is to verify the link to the remote repo 

git push -u origin master // or main                      // pushes the commit-ed changes into the remote repo

 6) You can see the success message in the Terminal. You can also verify by refreshing the GitHub repo online.

Once done can change branch used from master to main: 

To switch the default branch used to deploy apps from master to main, first create a new branch locally:

git checkout -b main

Next, delete the old default branch locally:

git branch -D master

From there, the local environment only knows about the main branch.

Reset the GIT repository hosted on the Heroku Platform using the heroku-reset command from the heroku-repo CLI plugin. Doing so will not impact the running application. (Note: Please communicate this change with your team. If you are working with other developers who are not aware of the reset, they might push to "master" which will overwrite the reset).

Re-deploy the application using the new default branch:

git push heroku main

To push directly to github: 

The git push command takes two arguments:

A remote name, for example, origin

A branch name, for example, main

For example:


$ git clone

Mon Mar 25 2024 23:11:11 GMT+0000 (Coordinated Universal Time)

#ssh #git #github #gitlab

Tue Mar 19 2024 22:15:26 GMT+0000 (Coordinated Universal Time)

#ssh #git #github #gitlab

Thu Jan 25 2024 18:19:15 GMT+0000 (Coordinated Universal Time)

#ssh #git #github #gitlab

Fri Aug 25 2023 13:20:18 GMT+0000 (Coordinated Universal Time)

#html #markdown #github

Sat Mar 25 2023 23:33:33 GMT+0000 (Coordinated Universal Time)

#google #developers #github #event #free #learning

Tue Jan 31 2023 07:58:09 GMT+0000 (Coordinated Universal Time)

#github #repository

Sun Jan 29 2023 00:19:11 GMT+0000 (Coordinated Universal Time)

#bash #git #reset #hard #github

Tue Nov 29 2022 16:09:47 GMT+0000 (Coordinated Universal Time)

#contributeto an existing repository #github

Mon Jun 27 2022 03:27:29 GMT+0000 (Coordinated Universal Time)

#javascript #github

Wed Feb 02 2022 22:08:42 GMT+0000 (Coordinated Universal Time)

#installation #linux #bash #wsl #github #cli

Wed Feb 02 2022 22:04:01 GMT+0000 (Coordinated Universal Time)

#docs #config #yaml #github

Wed Feb 02 2022 22:03:00 GMT+0000 (Coordinated Universal Time)

#docs #config #yaml #github

Thu Nov 18 2021 05:05:21 GMT+0000 (Coordinated Universal Time)

#git #github #issue

Wed Sep 15 2021 19:22:09 GMT+0000 (Coordinated Universal Time)

#shell #github

Thu Sep 09 2021 07:28:12 GMT+0000 (Coordinated Universal Time)

#git #github

Mon Aug 09 2021 08:17:54 GMT+0000 (Coordinated Universal Time)

#git #github #gitflow

Fri Jul 16 2021 19:43:21 GMT+0000 (Coordinated Universal Time)

#git #github

Wed May 26 2021 11:11:00 GMT+0000 (Coordinated Universal Time)


Sun May 23 2021 14:30:42 GMT+0000 (Coordinated Universal Time)

#nodejs #heroku #github

Wed Dec 25 2019 18:55:34 GMT+0000 (Coordinated Universal Time)

#commandline #git #github #howto

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension