Skip to content

Instantly share code, notes, and snippets.

View alex-laycalvert's full-sized avatar

Alexander Lay-Calvert alex-laycalvert

  • Essential Personnel
  • Arden, NC
  • 13:29 (UTC -12:00)
View GitHub Profile
@alex-laycalvert
alex-laycalvert / select-session.sh
Last active June 25, 2025 14:46
An interactive script for tmux to create session scripts based on project directories. Includes prefix matching scripts as well.
#!/usr/bin/bash
# select-session.sh - Interactive tmux session selector with FZF
#
# USAGE:
# ./select-session.sh
#
# DESCRIPTION:
# This script provides an interactive session selector for tmux using FZF.
# It searches for projects in ~/git and existing session files in ~/.tmux/sessions,
# then allows you to select one to either create a new session or attach to existing.
@alex-laycalvert
alex-laycalvert / clip.fish
Created November 10, 2023 14:40
Fish function for copying file contents to clipboard
# Requires `xclip` be installed.
function clip
cat "$argv" | xclip -selection clipboard
end
@alex-laycalvert
alex-laycalvert / go_web_starter.go
Last active August 24, 2023 13:49
Simple Go Web Server Starter that uses HTML templating and a file-based routing system
package main
import (
"html/template"
"log"
"net/http"
"os"
)
const (
@alex-laycalvert
alex-laycalvert / server.ts
Created August 17, 2023 16:24
Simple File Base Routing System Using Fastify and Templates
/*
* This is a basic setup for a fastify Node.js app that has one main route `myroute` and
* could have any number of subroutes. It uses the handlebars template engine but that can
* be replace with whatever you want.
*
* file structure for templates in `src/` folder
* views/
* layouts/
* main.html
* pages/
@alex-laycalvert
alex-laycalvert / separator.html
Created August 8, 2023 23:38
Underline/Horizontal Separator with Two Colors and Slanted Divider
<!--
Play around with the various widths/heights/colors to get your desired style. The colors are set to
match up so if you change the left side, make sure to change the other instances where the color is
`black`. Same with right and `red`. The border-width for the slanted-divider should also be half of
the separator height.
-->
<style>
.separator {
width: 100%;
@alex-laycalvert
alex-laycalvert / sliding_animations.css
Created August 8, 2023 23:22
Basic CSS Sliding Entrance Animations
// My preferred animation duration for these is 1 second.
@keyframes slideUp {
0%: {
transform: translateY(10%);
opacity: 0%;
}
50%: {
transform: translateY(0%);
}
@alex-laycalvert
alex-laycalvert / neovim-todo-comment.txt
Created March 16, 2022 16:10
Neovim config snippet to add a TODO comment above the current line (In Lua and Vimscript, using a comment plugin)
# Uses this commenting plugin: https://github.com/terrortylor/nvim-comment
# To use a different one or not at all just edit/delete the <cmd>CommentToggle<CR> section
# from the snippet.
# In Lua
vim.api.nvim_set_keymap('n', '<leader>t', 'OTODO<Esc><cmd>CommentToggle<CR>j', {noremap = true})
# In vimscript
:nnoremap <leader>t OTODO<Esc>:CommentToggle<CR> j