Skip to content

Instantly share code, notes, and snippets.

@nomaanp
nomaanp / multiple_ssh_setting.md
Created October 11, 2016 13:08 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@nomaanp
nomaanp / axios-catch-error.js
Created December 9, 2019 15:25 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@nomaanp
nomaanp / useWebSockets.tsx
Created November 15, 2020 12:21 — forked from jonasgroendahl/useWebSockets.tsx
useWebSockets()
import {useEffect, useRef, useState} from 'react';
import io from 'socket.io-client';
type Props = {
userId: number;
enabled: boolean;
onConnected?: () => void;
};
type Message = {