Skip to content

Instantly share code, notes, and snippets.

🐍
Python!

mattmc3 mattmc3

🐍
Python!
Block or report user

Report or block mattmc3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View list.txt
Classic Marcel
Quarter Marcel
Inverse Quarter Marcel
Inverse Marcel
Double Marcel
Inverse Double Marcel
Marcel Sandwich (not to be confused with the Dutch sandwich)
Double Marcel Sandwich
Double Irish Marcel
Double Irish with a Marcel Sandwich
@mattmc3
mattmc3 / modern_sql_style_guide.md
Last active Jun 28, 2019
Modern SQL Style Guide
View modern_sql_style_guide.md
layout author title revision version description
default
mattmc3
Modern SQL Style Guide
2019-01-17
1.0.1
A guide to writing clean, clear, and consistent SQL.

Modern SQL Style Guide

@mattmc3
mattmc3 / .zshrc
Created Jun 19, 2019
ZSH: Antigen heredoc bundle example
View .zshrc
antigen use oh-my-zsh
# themes I like: refined, wezm, juanghurtado, avit, kardan, juanghurtado, steeef
antigen theme avit
antigen bundles <<EOBUNDLES
zsh-users/zsh-autosuggestions
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-history-substring-search
zsh-users/zsh-completions
@mattmc3
mattmc3 / myapp.rb
Created Apr 29, 2019
Homebrew - Tap for private repo
View myapp.rb
# Homebrew formula for private github repo
# Requires $HOMEBREW_GITHUB_API_TOKEN to be set
# WARNING: This is a cheap way to do this. Don't use this method unless you
# really don't care about the security of you private GH token. And, let's
# be clear - this is for a private GH Enterprise repo, so you might not
# care...
class MyApp < Formula
desc "My fake app"
@mattmc3
mattmc3 / sel_schema_from_all_dbs.sql
Created Apr 15, 2019
MSSQL - information_schema all dbs
View sel_schema_from_all_dbs.sql
drop table if exists #cols
select top 0 isc.*, cast(null as varchar(10)) as table_type, cast(null as bit) as is_primary
into #cols
from INFORMATION_SCHEMA.COLUMNS isc
declare @sql varchar(max)
set @sql = '
use ?
insert into #cols
select isc.*, ist.table_type, sys.fn_hadr_is_primary_replica(''?'')
@mattmc3
mattmc3 / split_repo_example.sh
Last active Apr 15, 2019
Bash: split string on delimiter and echo substring before/after
View split_repo_example.sh
# http://tldp.org/LDP/abs/html/string-manipulation.html
function split_repo() {
local gitpath="${1:-github.com/mattmc3/myrepo}"
echo "\$gitpath = $gitpath"
echo "repo part \${gitpath##*/} = ${gitpath##*/}"
echo "user/repo \${gitpath#*/} = ${gitpath#*/}"
echo "url \${gitpath%%/*} = ${gitpath%%/*}"
echo "giturl/user \${gitpath%/*} = ${gitpath%/*}"
echo "user \${\${gitpath%/*}#*/} = ${${gitpath%/*}#*/}"
}
View benchmark.zsh
#!/usr/bin/env zsh
for i in $(seq 1 10); do
/usr/bin/time zsh -i -c exit
done
@mattmc3
mattmc3 / mssql.ahk
Created Mar 29, 2019
AHK - AutoHotKey save MSSQL script execution history
View mssql.ahk
;CTRL+SHIFT+R run a query, but will also copy the script and save it off
;^+r is QWERTY, ^+s is Colemak for ^+r
^+r::
Send, ^c
EnvGet, HomeDir, USERPROFILE
FormatTime, DateString,,yyyyMMdd
FormatTime, TimeString,,hhmmss
FileCreateDir %HomeDir%\Documents\sqlhist\%DateString%
FileAppend, %Clipboard%, %HomeDir%\Documents\sqlhist\%DateString%\%TimeString%.sql
Send, {f5}
@mattmc3
mattmc3 / colemak.ahk
Created Mar 29, 2019
AHK - Colemak remapping
View colemak.ahk
; Colemak layout for AutoHotkey (MS Windows)
#SingleInstance force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode 3 ; Exact matching to avoid confusing T/B with Tab/Backspace.
#Persistent
;top row
@mattmc3
mattmc3 / save_clipboard.ahk
Created Mar 29, 2019
AHK - save clipboard to file
View save_clipboard.ahk
; Save clipboard to file
OnClipboardChange:
EnvGet, HomeDir, USERPROFILE
FileDelete, %HomeDir%\Documents\clipboard.txt
FileAppend, %Clipboard%, %HomeDir%\Documents\clipboard.txt
Return
You can’t perform that action at this time.