Skip to content

Instantly share code, notes, and snippets.

View stephenbelyea's full-sized avatar
🤟

Stephen Belyea stephenbelyea

🤟
View GitHub Profile
@stephenbelyea
stephenbelyea / belwerks.zsh-theme
Created May 24, 2023 13:48
Slightly custom ZSH theme with double line readout and emoji
# Based on Bira ZSH Theme
# ZSH Theme - Preview: https://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? 🍕%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='🤷‍♂️ %{$terminfo[bold]$fg[red]%}%n %{$reset_color%}'
local user_symbol='#'
else
local user_host='🧑‍🚀 %{$terminfo[bold]$fg[green]%}%n %{$reset_color%}'
local user_symbol='$'
@stephenbelyea
stephenbelyea / .zshrc
Created August 14, 2020 22:57
Helpful terminal profile aliases
alias cdc="cd ~/Code && ls"
alias gfcp="git stash && git fetch && git checkout master && git pull && git status"
alias rmin="rm -rf ./node_modules && rm package-lock.json && npm install"
alias inst="npm install && npm start"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function generateId() {
return Math.random()
.toString(36)
.substring(2);
}
@stephenbelyea
stephenbelyea / a11y.css
Last active March 8, 2019 02:18
Accessibility Helpers
.visually-hidden {
border: 0 !important;
clip: rect(0 0 0 0) !important;
height: 1px !important;
margin: -1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
}

Keybase proof

I hereby claim:

  • I am stephenbelyea on github.
  • I am belwerks (https://keybase.io/belwerks) on keybase.
  • I have a public key ASDOrCguZ56msNTmhvHA-OS6iEjELYEV2G9p0UNjHUI5KAo

To claim this, I am signing this object:

@stephenbelyea
stephenbelyea / sample-data.js
Last active March 23, 2017 14:27
Quantity type product option
/* REMOVE vvv */
if (!modifiers.optiongroups.map(g => { return g.id === 63732210}).includes(true)) {
modifiers.optiongroups.push({
"choicequantityincrement": "1",
"description": "Sweetener",
"id": 63732210,
"mandatory": false,
"maxaggregatequantity": "15",
"maxchoicequantity": "3",
"maxselects": "5",
@stephenbelyea
stephenbelyea / functions.php
Created December 2, 2016 18:08
Format YouTube video link for embed without cross domain origin error.
if (get_field('video_link')) :
// Video_link is the field from WP's ACF (can be any URL string
// from YouTube), while embed_link will be the string we use.
$video_link = get_field('video_link');
$embed_link = "";
// Proper embed link, move along.
if ( strpos($video_link, '/embed/') !== false ) {
$embed_link = $video_link;
}
// Share link, will need to grab video ID.
@stephenbelyea
stephenbelyea / main.css
Created September 28, 2016 19:50
Media query to detect IE 10+
/*
Found here:
https://paper-leaf.com/blog/2014/09/targeting-ie-10-11-browsers-css/
*/
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* IE10+ specific styles go here */
}
@stephenbelyea
stephenbelyea / helpers.js
Last active September 13, 2016 18:26
Load and place SVG icons within wrapper container (ES6).
// Loop context for svg icons to load.
// Wrap arg defaults to main wrapper,
// but will accept any query string.
export function setSvgIcons(wrap = "#wrap") {
let ctx = $(wrap + " [data-svg-icon]:not(.loaded)");
if (ctx.length) {
let path = window.location.origin;
for (let i = 0; i < ctx.length; i++) {
let c = ctx[i];