This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
# Add the following to your shell init to set up gpg-agent automatically for every shell | |
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
source ~/.gnupg/.gpg-agent-info | |
export GPG_AGENT_INFO | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const visit = require('unist-util-visit') | |
module.exports = () => (tree, file) => { | |
visit(tree, 'heading', node => { | |
console.log('node: ', node); | |
visit(node, 'text', textNode => { | |
console.log('textNode: ', textNode); | |
const text = textNode.value ? textNode.value.trim() : '' | |
// const textNoWidows = text.replace(/\s+([\S]*)(\s*)$/gm, "\xA0$1$2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open man page as PDF. | |
# USAGE: manpdf cat | |
function manpdf() { | |
man -t "${1}" | open -f -a /Applications/Preview.app/ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}.`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git archive the current directory | |
# and ignore everything in .gitignore file. | |
# Usage: garc zipname | |
alias garc="git archive -o $1.zip HEAD" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 …" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |