Skip to content

Instantly share code, notes, and snippets.

View tgroshon's full-sized avatar

Tommy Groshong tgroshon

View GitHub Profile
@tgroshon
tgroshon / index.ts
Last active January 26, 2024 13:41
Tailwind CSS GIMP Color Palette
// Execute with "bun run index.ts > tailwind.gpl"
//
import colors from 'tailwindcss/colors'
type RGB = {r: number, g: number, b: number};
function isObj(data: any): data is object {
return data !== null && typeof data === 'object' && !Array.isArray(data)
}
@tgroshon
tgroshon / alacritty-tmux-vim_truecolor.md
Created October 8, 2023 18:01 — forked from andersevenrud/alacritty-tmux-vim_truecolor.md
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@tgroshon
tgroshon / install_elixir_ubuntu21-10.bash
Last active April 27, 2023 10:36
Installing Latest Erlang and Elixir on Ubuntu 20+
# Install the Erlang Solutions apt key; Alternative way https://askubuntu.com/questions/1286545/what-commands-exactly-should-replace-the-deprecated-apt-key
wget https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
# 'focal' is the latest available but an empty 'impish' directory exists and will probably be ready soon
sudo echo 'deb https://packages.erlang-solutions.com/ubuntu focal contrib' | sudo tee /etc/apt/sources.list.d/erlang-solutions.list
sudo apt update
sudo apt install esl-erlang elixir
@tgroshon
tgroshon / react-patterns-post-draft.md
Last active March 24, 2023 23:24
Draft of "React Patterns in a Post-Hooks World"
title author
React Patterns in a Post-Hooks World
name url
Tommy Groshong

Introduction

React is an amazing library and over the last 5 years has transformed the

@tgroshon
tgroshon / gallery.html
Created March 24, 2023 13:51
Simple Lightbox-style Photo Gallery
@tgroshon
tgroshon / compile_emacs_ubuntu.sh
Last active November 3, 2022 16:54
Compile Emacs from source on Ubuntu-like system
#!/bin/bash
sudo apt install build-essential # compilation tools
sudo apt build-dep emacs # install deps of previous emacs to get headstart
cd ~/Projects # change to dir to store emacs source
wget https://ftp.gnu.org/gnu/emacs/emacs-28.2.tar.xz # clone from github mirror
tar -xf emacs-28.2.tar.xz # checkout desired version branch
cd emacs-28.2/
@tgroshon
tgroshon / README.md
Last active March 29, 2022 14:36
Spacemacs LSP for C++

Setting up Spacemacs for C/C++ Dev

Install CCLS

See included install-ccls.sh.

  1. Install dependencies: sudo apt install clang-9 libclang-9-dev rapidjson-dev zlib1g-dev libncurses-dev
  2. Download archived CCLS source from github release page: Releases-MaskRay/ccls
  3. Unarchive: tar -xzf ccls-0.20210330.tar.gz
  4. CMake build: cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/lib/llvm-9 -DLLVM_INCLUDE_DIR=/usr/lib/llvm-9/include -DLLVM_BUILD_INCLUDE_DIR=/usr/include/llvm-9/
@tgroshon
tgroshon / search_list_of_dicts.py
Last active March 29, 2022 14:34
Because it can be done
from operator import itemgetter, eq
from functools import partial
"""
Find dictionary with ID = 2 in a functional way
"""
records = [{'id': 1}, {'id': 2}, {'id': 3}, {'id': 4}]
def compose(*funcs):
def h(*args, **kwargs):
@tgroshon
tgroshon / .vimrc.vim
Last active February 10, 2022 16:15
Vim Settings (requires Vundle)
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim' " required
Plugin 'mileszs/ack.vim'
@tgroshon
tgroshon / .spacemacs.el
Last active December 4, 2021 18:58
Spacemacs Settings
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'