Skip to content

Instantly share code, notes, and snippets.

View israrahmed40's full-sized avatar
πŸ‘¨β€πŸ’»

Israr Ahmed israrahmed40

πŸ‘¨β€πŸ’»
View GitHub Profile
@israrahmed40
israrahmed40 / inject-script.js
Created March 18, 2024 05:30 — forked from umayr/inject-script.js
How to inject the script in the body of the document and wait till it has been loaded completely
// injects the script in the body of the document.
// returns a promise that gets resolves once the script has been loaded in the document
export const injectScript = (url, document = window.document) => {
const script = document.createElement('script');
script.src = url;
script.type = 'text/javascript';
script.async = true;
const body = document.getElementsByTagName('body')?.[0] ?? null;
if (body === null) {
@israrahmed40
israrahmed40 / README.md
Created March 4, 2024 17:19 — forked from alyyousuf7/README.md
Ngrok and GoDaddy Connector

Ngrok and GoDaddy Connector

Ngrok provides a paid service to connect custom domain to a service. This script provides similar functionality which requires to be run everytime ngrok is started/restarted.

It updates your custom domain's CNAME record to the ngrok subdomain assigned to your service.

Usage

@israrahmed40
israrahmed40 / recover-deleted-branch.sh
Created March 4, 2024 04:57 — forked from umayr/recover-deleted-branch.sh
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}