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
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

@ahmadawais
ahmadawais / parser.ts
Created Apr 19, 2019 — forked from MaxGabriel/parser.ts
Date parsing code
View parser.ts
import * as P from 'parsimmon'
import Day from '~/utils/Day'
import Month from '~/utils/Month'
const shortMonths = {
jan: 1,
feb: 2,
mar: 3,
apr: 4,
may: 5,
View github-usernames-list.js
/**
* Get GitHub usernames that contributed in a file.
*
* @author AhmadAwais <https://github.com/AhmadAwais>
* @since 2019-04-03
*/
const usernames = [];
// Select the right data of anchor links and loop over it.
You can’t perform that action at this time.