Skip to content

Instantly share code, notes, and snippets.

View i-mighty's full-sized avatar
🏠
Working from home

Adegboye Josiah i-mighty

🏠
Working from home
  • University of Ibadan
View GitHub Profile
@i-mighty
i-mighty / Unwrap.ts
Created January 24, 2022 13:22
Unwrap Return type from Promises
export type Unwrap<T> = T extends Promise<infer U>
? U
: T extends (...args: any) => Promise<infer U>
? U
: T extends (...args: any) => infer U
? U
: T;
import axios from "axios";
const getRequest = async (url) => {
try {
const response = await axios.get(url);
if (response.status === 200) {
return response.data;
} else throw new Error("Any error text");
} catch (error) {
console.log(error);
@i-mighty
i-mighty / History|-1040e5a3|entries.json
Last active March 12, 2025 10:26
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/i-mighty/Documents/Zeeh%20Africa/backend-v2/apps/api/src/app/services/get-app.service.ts","entries":[{"id":"HMcy.ts","timestamp":1663772595894},{"id":"LjFh.ts","timestamp":1663773555961}]}
@i-mighty
i-mighty / README.txt
Created December 10, 2020 07:30
AWS S3 Node.js example.
Read up the docs on how to setup the cli.
If you need to setup for pipeline or for production without the CLI, you would need to make some modification to the code.
Blessings
@i-mighty
i-mighty / cloudSettings
Last active June 12, 2022 05:23
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-07-28T18:41:31.661Z","extensionVersion":"v3.4.3"}