Skip to content

Instantly share code, notes, and snippets.

View connoro7's full-sized avatar

Connor Dillon connoro7

View GitHub Profile
@connoro7
connoro7 / .bash_ps1
Created September 26, 2023 19:12
ps1
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off=$'\033[0m' # Text Reset
@connoro7
connoro7 / .ripgreprc
Created September 26, 2023 18:36
ripgrep rc
# Ripgrep Syntax
# rg <search_pattern> <directory_of_file>
# Multiple files
# rg <search_pattern> <directory_of_file> <directory_of_file>
# Print as vim-compatible results
# --vimgrep
# Search hidden files
--hidden
@connoro7
connoro7 / .exa
Created September 26, 2023 18:24
exa config
## exa
export EXA_OPTIONS="-F --group-directories-first --color=always" # classify files and group folders for human readability
alias ls="lg" # Replaces ls with my alias for exa
alias l="exa ${EXA_OPTIONS}" # default
alias la="exa -a ${EXA_OPTIONS}" # default + dotfiles
alias lg="exa -Ga ${EXA_OPTIONS}" # list as grid + dotfiles
alias lg\-="exa -G ${EXA_OPTIONS}" # list as grid
alias lgd="exa -GaD ${EXA_OPTIONS}" # list as grid, directories only
alias ll="exa -lha --git ${EXA_OPTIONS}" # list permissions + dotfiles
alias lld="exa -lhD ${EXA_OPTIONS}" # list permissions + dotfiles + directories
##
## export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$\C "
## export CLICOLOR=1
## export LSCOLORS=ExFxBxDxCxegedabagacad
## source-all: recursively source all files in a path (or the path itself if applicable)
shopt -s nullglob
shopt -s dotglob
source-all () {
@connoro7
connoro7 / custom-bullet-points.html
Created October 11, 2022 20:50
CSS Custom bullet points
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
</head>
@connoro7
connoro7 / async-await examples.js
Created October 11, 2022 19:24
How-to and How-to-not Async Await
async function mainBadTiming() {
setTimeout(() => {
console.log('hello')
}, 1000)
console.log('world')
}
console.log(mainBadTiming());
async function mainWaitForTimeout() {
await new Promise((resolve) => {
@connoro7
connoro7 / base-10 rem.css
Created October 11, 2022 19:15
Safely converts rem units from base-16 to base-10
/* Converts rem units from base-16 to base 10. */
/* No more 76.5px / 16 = 4.78rem, or 25px / 16 = 1.56rem, or 2.2rem * 16 = 35.2px */
/* 2.5rem becomes 25px */
/* 7.65rem becomes 76.5px */
:root {
/* Adjusts rem to base-10 equivalent */
font-size: 62.5%;
}
@connoro7
connoro7 / full-width-bleed-index.html
Created October 11, 2022 19:04
CSS full-width bleed background for section within container
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="full-width-bleed-style.css" />
</head>
<body>
@connoro7
connoro7 / .git_aliases
Last active October 23, 2020 07:13
Collection of git aliases and functions
###############################################################
Please see "PS1 upgrades, with COLORS!" gist for color variables.
https://gist.github.com/connoro7/8c37fb4fb6abd6bca0c5cc13259e30c7
###############################################################
## Git
## add
alias ga='git add'
alias gaa='git add -A && git status'
## branch