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
Created Jul 26, 2020
🦄 Shades of Purple theme for fzf
View .zshrc
# fzf theme.
# Base16 Atelier Plateau Light
_gen_fzf_default_opts() {
local color00='#2D2B55'
local color01='#1E1E3F'
local color02='#A599E9'
local color03='#A599E9'
local color04='#A599E9'
local color05='#A599E9'
@ahmadawais
ahmadawais / .zshrc
Created Jul 3, 2020
manpdf opens man pages as PDF
View .zshrc
# Open man page as PDF.
# USAGE: manpdf cat
function manpdf() {
man -t "${1}" | open -f -a /Applications/Preview.app/
}
@ahmadawais
ahmadawais / javascript.json
Last active Jun 29, 2020
VSCode Console Log Snippets
View javascript.json
{
"Console Log with Name": {
"prefix": "lg",
"body": ["console.log(`${1:variable}`, ${1:variable});"],
"description": "Console Log with name of a variable"
},
"Console Log with String": {
"prefix": "lgs",
"body": ["console.log(`${1:STRING_HERE}`);"],
"description": "Console Log string"
@ahmadawais
ahmadawais / getTwitterImage.js
Created Jun 21, 2020
Scrape a twitter image with JavaScript.
View getTwitterImage.js
const cheerio = require('cheerio')
const got = require('got')
// https://dev.twitter.com/basics/user-profile-images-and-banners
const REGEX_IMG_MODIFIERS = /_(?:bigger|mini|normal)\./
const ORIGINAL_IMG_SIZE = '_400x400'
const getAvatarUrl = url =>
url.replace(REGEX_IMG_MODIFIERS, `${ORIGINAL_IMG_SIZE}.`)
@ahmadawais
ahmadawais / .zshrc
Created Nov 26, 2019
#OneDevMinute: Git archive the current directory and ignore everything in .gitignore file.
View .zshrc
# Git archive the current directory
# and ignore everything in .gitignore file.
# Usage: garc zipname
alias garc="git archive -o $1.zip HEAD"
@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.

You can’t perform that action at this time.