Skip to content

Instantly share code, notes, and snippets.

View tgroshon's full-sized avatar

Tommy Groshong tgroshon

View GitHub Profile
@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 / 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 / gallery.html
Created March 24, 2023 13:51
Simple Lightbox-style Photo Gallery
@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 / 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 / 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 / README.md
Last active May 25, 2021 22:20 — forked from jcoglan/README.md
JavaScrpit benchmark: reduce, filter, map(), transducers, and for loops

benchmark: reduce(), filter(), map(), transducers and for loops

reduce():            10    x 832,441 ops/sec ±1.11% (87 runs sampled)
reduce():            100   x 56,307 ops/sec ±1.65% (87 runs sampled)
reduce():            1,000 x 1,158 ops/sec ±1.58% (88 runs sampled)

reduce() w/ mutate:  10    x 3,144,202 ops/sec ±1.27% (91 runs sampled)
reduce() w/ mutate:  100   x 556,441 ops/sec ±1.08% (94 runs sampled)
reduce() w/ mutate:  1,000 x 67,205 ops/sec ±0.40% (97 runs sampled)

Formatting: Prettier vs. Standard

A formatting comparison.

How will the two tools format the following input code:

export const f = function(a) { if (a === 0) { return []; } return [1,2,3,4,a].map(int => int * 2); }
@tgroshon
tgroshon / Components.jsx
Last active July 16, 2020 22:13
Interesting Framework Idea
import ReactDOM from "react-dom";
import React from "react";
/*
================
React Components
================
*/
export class ReactClassComponent extends React.Component {

Symmetric Encryption in the Old West

Setup

Roles

You will need 3 teams with 1 or more people on each team (minimum 3 total people).

  • Bankers A: Dodge City
  • Bankers B: Tombstone