Skip to content

Instantly share code, notes, and snippets.

View Sam-Gram's full-sized avatar

Sam Graham Sam-Gram

  • Fusionware, Inc.
  • Idaho Falls, ID
View GitHub Profile
@Sam-Gram
Sam-Gram / .tmux.conf
Last active July 7, 2025 21:27
Current tmux config
set -g mouse on
set-option -g default-shell "/bin/bash"
set -g set-clipboard on
set-option -g history-limit 500000
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g base-index 1
set -g @plugin 'tmux-plugins/tmux-resurrect'
run '~/.tmux/plugins/tpm/tpm'
#!/bin/bash
# Show last 10 tags by creation date
git for-each-ref --sort=-creatordate refs/tags --format='%(refname:lstrip=2)' --count=10
import ora from 'ora'
const spinner = ora({
text:'Emoji',
spinner: {
frames: Array(76).fill(0).map((_,i) => String.fromCodePoint(128516+i)),
interval: 100
}
}).start()
@Sam-Gram
Sam-Gram / vscode_sql_cleanup.regex
Created November 3, 2022 19:37
Used for cleaning up useless column aliases, where it's like name as name in vscode.
Search: \.?(?<column>[\w_]+) as \k<column>
replace: .$1
changeBackground ()
{
gsettings set org.gnome.desktop.background picture-uri file://`ls /home/sam/Documents/Wallpapers/*.jpg | shuf -n 1`
}
int GetWeekNumberOfMonth(DateTime date)
{
date = date.Date;
DateTime firstMonthDay = new DateTime(date.Year, date.Month, 1);
return (date - firstMonthDay).Days / 7 + 1;
}
@Sam-Gram
Sam-Gram / cloudSettings
Last active August 30, 2019 20:08
vscodesync
{"lastUpload":"2019-08-30T20:08:34.891Z","extensionVersion":"v3.4.2"}
@Sam-Gram
Sam-Gram / sliceofthemonth.sh
Created June 4, 2019 16:25
Get Lucy's slice of the month
slice-of-the-month ()
{
curl -s -L https://www.lucysnypizza.com/specials | grep --color=auto h2 | perl -pe 's/<[^>]*>//g' | perl -ne 'print if /slice.*month/i' | perl -pe 's/.*: (.+)$/$1/'
}
SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN ('column_name') AND TABLE_SCHEMA = 'table_name';
@Sam-Gram
Sam-Gram / bash_exclamation_explanation.org
Last active June 24, 2025 16:37
Bash exclamation point expansions
ShortcutExplanation
!!Last command
!:nLast command’s nth argument
!*Last command’s arguments
!$Last command’s last argument
$_Last command’s last argument (stays in bash history)
!:m-nLast command’s mth through nth arguments
!:n-Last command’s nth through second-to-last arguments
!:n-$Last command’s nth through last arguments