Skip to content

Instantly share code, notes, and snippets.

View jt-ziolo's full-sized avatar

JT Ziolo jt-ziolo

View GitHub Profile
@jt-ziolo
jt-ziolo / snippets.md
Last active March 20, 2024 22:14
Next.js TypeScript Snippets

Simple component

const ComponentName: FC = () => {
  return (
    <div>
      <p>$0</p>
    </div>
  );
};
@jt-ziolo
jt-ziolo / bats-pre-commit.md
Last active July 22, 2023 23:08
Pre-commit hook for running bats-core tests (bash script testing)

Motivation

bats (Batch Automated Testing System) is a testing framework for Bash scripts. If you're like me, you like to have a pre-commit or pre-push hook in place that runs your program's tests and prevents you from doing dumb things like pushing failing code. I found a pre-commit python framework named pre-commit, which allows you to manage and import git hooks from various repos across multiple languages. However, I did not see any examples involving bash and bats.

After searching online for a bit and getting some help using Phind, I came up with the following config that will run bats on pre-commit and pre-merge-commit. It assumes you have a similar project folder structure to the bats tutorial.

project/
    .git/
    .pre-commit-config.yaml
@jt-ziolo
jt-ziolo / init.lua
Last active July 23, 2023 16:56
My VsCode-Compatible NeoVim Config
vim.g.mapleader = " " -- Make sure to set `mapleader` before lazy so your mappings are correct
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
@jt-ziolo
jt-ziolo / Up To Date Web Dev Tools by Category.md
Last active March 29, 2023 00:35
Up To Date Web Dev Tools by Category
@jt-ziolo
jt-ziolo / Remembering VS Code Common Commands.md
Last active February 22, 2023 23:00
Mmenomics to help me remember the VS Code commands that are central to my current workflow.

Fuzzy Search on Ctrl+Shift+P

You may need to type more characters than shown initially, depending on the extensions you have installed, but VS Code will learn which commands you use most frequently and show those first.

  • rewind = Reload Window
  • kat = Kill All Terminals
  • new = Create New File
  • maxp = Toggle Maximized Panel
    • Very useful when there is a lot of terminal output to read through
    • With this command and other toggle-type commands, it can be convenient to follow up with ctrl+shift+p (repeat last command)
  • tone = (Todo Tree Extension) Todo Tree: Go To Next
@jt-ziolo
jt-ziolo / cheatsheet.md
Last active March 28, 2023 21:07 — forked from jbarson/cheatsheet.md
Personal vim/fzf/tmux cheatsheet

nvim

Focus is limited to commands that I need to work on.

Plugin Command Demonstrations

vim-surround

cs"'                        # Change surrounding double quote to single quote
cs'<q>                      # Change surrounding single quote to <q></q> tags
cst"                        # Change surrounding >>t<<ags to double quote
ds"                         # Delete surround double quotes