Skip to content

Instantly share code, notes, and snippets.

View sdsanchezm's full-sized avatar
🧩
Focused

Sergio sdsanchezm

🧩
Focused
View GitHub Profile
@sdsanchezm
sdsanchezm / gist:248ad4fdbfdf901d1e8cee3bc27fad89
Last active July 13, 2023 15:38
Axios Helper for React.js
// const axios = require('axios');
import axios from 'axios';
const BASE_URL = `https://somewhere123.website`;
function getData1(url_path){
// Make a request for a user with a given ID
// axios.get('/user?ID=12345')
const URL1 = `${BASE_URL}${url_path}`;
@sdsanchezm
sdsanchezm / getWithHeadersAxiosReact.jsx
Last active July 22, 2023 19:33
GET request with headers in React using axios
import React, { useEffect, useState } from 'react';
function ComponentExample() {
const [data, setData] = useState([]);
const [loading, setLoading] = useState(true);
const axiosInstance = axios.create({
baseURL: 'https://example.com/api',
@sdsanchezm
sdsanchezm / postWithHeadersAxiosReact.jsx
Created July 22, 2023 19:33
POST request with headers in React using axios
import React from 'react';
import axios from 'axios';
const ButtonTest = () => {
const handlePostRequest = () => {
const url = 'https://example.com/api/endpointpath';
const data = {
valueA: 'valueA',
valueB: 'valueB',

Linux Terminal Efficiency

  1. Ctrl + a - Move cursor to start of line
  2. Ctrl + e - Move cursor to end of line
  3. Ctrl + b - Move back one character
  4. Alt + b - Move back one word
  5. Ctrl + f - Move forward one character
  6. Alt + f - Move forward one word
  7. Ctrl + d - Delete current character
  8. Ctrl + w - Cut the last word