Skip to content

Instantly share code, notes, and snippets.

View drgsn's full-sized avatar

Dr. Gos drgsn

View GitHub Profile
@drgsn
drgsn / cert.sh
Created March 31, 2024 00:32
generate ssl certificate using acme.sh and store into azure keyvault
#!/bin/bash
# Initialize an array for domains and define a password variable
DOMAINS=()
KEYVAULT_NAME=""
KEYVAULT_RESOURCE_GROUP=""
PFX_PASSWORD=""
# Function to display usage
usage() {
@drgsn
drgsn / git_secrets.sh
Created March 2, 2023 21:37
[git secrets install] install git secrets and do a basic config
#!/bin/bash
pretty_print() {
# BLACK=$(tput setaf 0)
# RED=$(tput setaf 1)
# GREEN=$(tput setaf 2)
# YELLOW=$(tput setaf 3)
# LIME_YELLOW=$(tput setaf 190)
# POWDER_BLUE=$(tput setaf 153)
# BLUE=$(tput setaf 4)
@drgsn
drgsn / add_hook
Last active March 6, 2023 14:45
add hook files to all repos in path
#!/bin/sh
# execute example:
# sh add_hooks.sh /Users/drgos/work/projects /Users/drgos/hooks/templates/.git/hooks/prepare-commit-msg
# this will add the hook found at hooks/templates/.git/hooks/prepare-commit-msg
# to all .git folders found in /Users/drgos/work/projects
echo $1
@drgsn
drgsn / prepare-commit-msg
Last active March 15, 2023 13:13
add jira ticket number to commit message
#!/bin/sh
# hook identifies jira ids in branch names, adds on more goodies if we are a hotifx or release branch and attempts to prevent blank commit messages...although this needs a bit more work...
COMMIT_FILE=$1
COMMIT_MSG=$(cat $1)
#First and foremost check whether the commit message is blank. if so then abort the commit. strip any spaces out too
#this one only works at present when someone tries to do git commit -m "" or git commit -m " "
#if anyone uses tools such as sourcetree, then these GUIs typically present a prompt...eg. "do you want to commit wihtout a message" and pass in optional attributes to git commit to allow this.
@drgsn
drgsn / forms.css
Created December 21, 2020 13:37
make inputs look nicer
.form-control {
position: relative;
margin-bottom: 10px;
}
.form-control-group {
display: flex;
justify-content: flex-start;
}
@drgsn
drgsn / buttons.css
Last active December 21, 2020 13:36
.button,
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
display: inline-flex;
background-color: #fff;
border-color: #dbdbdb;
border-radius: 4px;
border-style: solid;
@drgsn
drgsn / flexbox-grid.css
Last active December 21, 2020 13:35
A simple grid system using display: flex
.container {
max-width: 1200px;
margin-left: auto;
margin-right: auto;
padding: 10px;
}
.container-full-page {
display: flex;
flex-direction: column;