Skip to content

Instantly share code, notes, and snippets.

👨‍🏫
Edutaining at VSCode.pro

Ahmad Awais ⚡️ ahmadawais

👨‍🏫
Edutaining at VSCode.pro
Block or report user

Report or block ahmadawais

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ahmadawais
ahmadawais / .zshrc
Last active Oct 22, 2019
🔥 #OneDevMinute: Type `git open` to open the GitHub page or website for a repository.
View .zshrc
# Type `git open` to open the GitHub page or website for a repository.
# Step #1: npm install -g git-open
# Step #2: cd local_repo_directory
# Strep #3 git open
# More examples: https://github.com/paulirish/git-open
# Bonus use the following aliases
# @usage gio
alias gio="git open"
@ahmadawais
ahmadawais / .zshrc
Created Oct 21, 2019
Check the whois of a domain from the command line.
View .zshrc
# Check the whois of a domain or form a URL.
# @usage: whois google.com
# @usage: whois https://google.com
function whois() {
local domain=$(echo "$1" | awk -F/ '{print $3}') # get domain from URL
if [ -z $domain ] ; then
domain=$1
fi
echo "Getting whois record for: $domain"
@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) => {
You can’t perform that action at this time.