Skip to content

Instantly share code, notes, and snippets.

Avatar
📟
Recording videos for NodeCLI.com

Ahmad Awais ⚡️ ahmadawais

📟
Recording videos for NodeCLI.com
View GitHub Profile
@ahmadawais
ahmadawais / .zshrc
Last active Oct 17, 2019
🔥 #OneDevMinute: Reload your bash or Zsh shell.
View .zshrc
# Reload the shell (i.e. invoke as a login shell).
alias reload="exec $SHELL -l"
alias rf="source ~/.zshrc"
# Typos addressed.
alias relaod="reload"
alias reld="reload"
alias rld="reload"
View conference-mc-tips.md

👀📎 It looks like you're preparing to MC a conference...

🚨 GIANT DISCLAIMER: This stuff is far from authoritative. But it's what I think works for me, and what I enjoy in an MC when I'm attending a conference.


Biggest tip - enjoy yourself.

View conference-mc-tips.md

👀📎 It looks like you're preparing to MC a conference...

🚨 GIANT DISCLAIMER: This stuff is far from authoritative. But it's what I think works for me, and what I enjoy in an MC when I'm attending a conference.


Biggest tip - enjoy yourself.

View gist:6de8d779f15370a49a781ca10cebbd26

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@ahmadawais
ahmadawais / cloudinary-url-regex.js
Created Aug 27, 2019 — forked from baldurh/cloudinary-url-regex.js
A regex for capturing different parts of cloudinary urls
View cloudinary-url-regex.js
const CLOUDINARY_REGEX = /^.+\.cloudinary\.com\/(?:[^\/]+\/)(?:(image|video)\/)?(?:(upload|fetch)\/)?(?:(?:[^_/]+_[^,/]+,?)*\/)?(?:v(\d+|\w{1,2})\/)?([^\.^\s]+)(?:\.(.+))?$/;
const url = 'http://res.cloudinary.com/oz/image/upload/v1454951830/moments/musicreach/f3432155-1be9-4510-9c3a-c1672c21fc89/f5de39a0-7ad0-48de-b53b-1d148856bcb8_540_pv.jpg';
const matches = CLOUDINARY_REGEX.exec(url);
console.log(matches);
/*
[
'http://res.cloudinary.com/oz/image/upload/v1454951830/moments/musicreach/f3432155-1be9-4510-9c3a-c1672c21fc89/f5de39a0-7ad0-48de-b53b-1d148856bcb8_540_pv.jpg',
'image', // resource_type
'upload', // type
@ahmadawais
ahmadawais / VSCode Course Marketing Material.md
Last active Aug 24, 2019
VSCode Course Marketing Material
View VSCode Course Marketing Material.md

VSCode.pro Marketing Material

BADGES

Learn VSCode

[![Learn VSCode](https://img.shields.io/badge/-VSCODE.pro%20%E2%86%92-gray.svg?colorB=6A788D&style=flat)](https://VSCode.pro/)
@ahmadawais
ahmadawais / git-rename-files.md
Last active Aug 5, 2019
Rename files with git
View git-rename-files.md

Rename a file with git

Normal renamed files are ignored by git so you have to do it like this:

git mv README.md read.md

P.S. Sometimes you need --force param to make it work.

@ahmadawais
ahmadawais / zip.js
Last active Aug 1, 2019
Zip a directory with JavaScript in Node.js.
View zip.js
const fs = require('fs');
const archiver = require('archiver');
/**
* Zip a directory.
*
* @param {String} src Source directory path.
* @param {String} dst Destination path + filename.zip.
*/
module.exports = async (src, dst) => {
View ipapi.com.json
{
"ip": "119.155.50.57",
"type": "ipv4",
"continent_code": "AS",
"continent_name": "Asia",
"country_code": "PK",
"country_name": "Pakistan",
"region_code": "05",
"region_name": "Sindh",
"city": "Karachi",
@ahmadawais
ahmadawais / now.md
Created Jun 18, 2019
Add Sub Domain on Zeit Now as an Alias
View now.md


Add Sub Domain on Zeit Now as an Alias

You can’t perform that action at this time.