Skip to content

Instantly share code, notes, and snippets.

@Samuel-Isirima
Samuel-Isirima / github-action-ssh.md
Created January 18, 2024 11:16 — forked from raviagheda/github-action-ssh.md
Github Action with EC2 using SSH
// npm i axios
const axios = require('axios').default;
axios.interceptors.request.use( x => {
// to avoid overwriting if another interceptor
// already defined the same object (meta)
x.meta = x.meta || {}
x.meta.requestStartedAt = new Date().getTime();
return x;
@Samuel-Isirima
Samuel-Isirima / api.js
Created November 25, 2023 07:58 — forked from gnurgeldiyev/api.js
How to get the response time from Axios
const axios = require('axios').default
const API_BASE_URL = 'https://api.spacexdata.com/v3'
const API = axios.create({
baseURL: API_BASE_URL
})
/*
* setting interceptors to be able
* to know response time of the each request
@Samuel-Isirima
Samuel-Isirima / base64_mime_type.json
Created October 21, 2023 21:02 — forked from Bryan-b/base64_mime_type.json
Mime type from base64 image
{
"/9j/": "image/jpeg",
"iVBORw0KGg": "image/png",
"R0lGODdh": "image/gif",
"UklGR": "image/webp",
"Qk0": "image/bmp",
"AAAA": "image/x-icon"
}
@Samuel-Isirima
Samuel-Isirima / laraws_nginx.md
Created October 14, 2023 05:21 — forked from ErxrilOwl/laraws_nginx.md
Deploy Laravel on AWS EC2 Ubuntu (nginx)
@Samuel-Isirima
Samuel-Isirima / Response.php
Created January 24, 2023 00:37 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;