Skip to content

Instantly share code, notes, and snippets.

View sheldonhull's full-sized avatar
👋
Hi! Who keeps their github status up to date? You get a 🌮 just for reading this

sheldonhull sheldonhull

👋
Hi! Who keeps their github status up to date? You get a 🌮 just for reading this
View GitHub Profile
@tcartwright
tcartwright / GetServerSecurity.sql
Last active July 12, 2021 17:48
SQL SERVER: Get Server Level Security in xml format
/*
TIM C: I wrote this so I can dump server level security and easily glance over it, as well as:
- can be used to compare security from server to server
- automatically exported every so often so changes can be monitored over time
- used to clean up dead accounts
- password hash could be added to the sql users for AG primary->secondary comparison,
- TO ENABLE PWD HASH EXPORT CHANGE @output_pwds BELOW
*/
BEGIN --principals table

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
Hi! Thank you for offering a PR for one of my open source libraries. I really
appreciate it, because in most cases, I have very little time to maintain them.
I often get PRs that lead to a back-and-forth between me and the contributor,
where I ask them to undo many of the changes they have made. To avoid this in
your case, or to at least give you an idea why I'm asking you to adapt your PR,
here are my criteria for accepting PRs.
Every PR should have one, and only one, unique goal. Your PR should make the
absolute minimum number of changes that are required to achieve this goal.
@blwsh
blwsh / better-docker-local-dev.md
Last active October 21, 2020 02:55
An elegant solution to installing docker dependencies twice

If you use a production docker image for your local dev environment it’s very likely one of the builds stages is running a command which installs your dependencies such as npm install, composer install or go get.

Now you don’t want to adjust your production docker image but at the same time, your dependency installs can take a long time and you really don’t want to run the command twice.

An easy solution would be to tell docker to not mount the directory into the container with the rest of your project code but then you don’t get all the useful information provided by your IDE.

Enter docker cp and volume overrides.

Using docker cp and overriding the volume we wish to copy from the container allows us to pull directories such as node_modules out of the built docker image. This is great because it means we don’t need to run our installs twice. It also has the added benefit of reflecting your production environment files better and eliminates the issue of slightly different language versions and in turn, dif

@tig
tig / F7History.ps1
Last active April 16, 2024 16:07
Use F7 as "Show Command History" in Powershell
# See https://github.com/gui-cs/F7Hisoty which replaces this
@kilasuit
kilasuit / historyhandler.ps1
Created September 25, 2020 16:27
PSReadline no keys/secrets/tokens
Set-PSReadLineOption -AddToHistoryHandler {
param([string]$line)
$sensitive = "password|asplaintext|token|key|secret"
return ($line -notmatch $sensitive)
}
@thiezn
thiezn / generate-chrome-cfg.py
Last active October 20, 2020 21:25
Generate config file for Chrome AWS Extend Switch Roles script
#!/usr/bin/env python3
from configparser import ConfigParser
import boto3
from typing import Tuple, List
import operator
MASTER_ACCOUNT_ALIAS = "THEALIASOFTHEMASTERACCOUNT"
# Chrome plugin color codes
@fredjoseph
fredjoseph / AwesomeCliApps.md
Last active July 2, 2025 12:11
Awesome CLI/Terminal Apps

Awesome Apps

  • description: Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, fish, tmux, IPython, Awesome, i3 and Qtile.
  • language: Python
  • description: If you like the interface of HTTPie but miss the features of curl, curlie is what you are searching for. Curlie is a frontend to curl that adds the ease of use of httpie, without compromising on features and performance. All curl options are exposed with syntax sugar and output formatting inspired from httpie.
  • language: Go
Due to some upgrades that are taking place, Gopherize.me is temporarily unavailable.
It will be back this week.
Thanks for your patience.
@olets
olets / zsh-plugin-manager-plugin-installation-procedures.md
Last active July 4, 2025 11:54
zsh plugin manager cross-reference

Instructions for installing zsh plugins, for a variety of plugin managers