Skip to content

Instantly share code, notes, and snippets.

View howellcc's full-sized avatar

Clint howellcc

  • 05:50 (UTC -05:00)
View GitHub Profile
@howellcc
howellcc / git-branches-by-commit-date.sh
Created February 28, 2024 18:08 — forked from l15n/git-branches-by-commit-date.sh
List remote Git branches and the last commit's author and author date for each branch. Sort by most recent commit's author date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r
@howellcc
howellcc / APICapCheck.sh
Created September 18, 2023 19:52
API Capitalization Check
#!/bin/bash
#We would occasionally get commits to the Api directory with API in all caps.
#This is incorrect. This script will help me detect that. Put it on a cron job.
cd ~/source/rm-trunk/UI
results=$(/mingw64/bin/git ls-files --full-name | /usr/bin/grep UI/API)
if [ ${#results} -gt 0 ]
@howellcc
howellcc / MultiQuery.ps1
Last active October 6, 2023 19:29
Script for running the same query against multiple MySQL databases on the same server and saving that result to a .csv.
# REQUIREMENTS:
# 1. The MySql connector must be installed and the path properly configured on line 24
param(
[string]$query,
[int]$limit,
[int]$db0x
)
if (!$query) {
@howellcc
howellcc / CreateAnchorTagsForUrls.ts
Created November 30, 2022 15:27
Replace urls in a text block with anchor tags creating clickable links.
private createAnchorTagsForUrls(message: string): string {
/* As it turns out finding a URL within other text is surprisingly hard. Mainly because spaces are technically legal.
However, if we assume that they are not, the following RegEx does a pretty good job and is still readable. */
const regex: RegExp = /\b(https?|ftp|file):\/\/[\S]+/ig ;
let ret: string = message;
/* Check for href. If this exists we can assume that this string already contains anchor tags and should not have its
urls replaced with anchor tags again */
if(ret.indexOf("href=") < 0){
@howellcc
howellcc / git-prompt.sh
Created October 5, 2022 15:48
Git-Prompt for GitBash for Windows
#This files modifies the prompt used by GitBash.
#Place it in ~/.config/git/
#Currently the only modification is that it removes the 'username@machine' and 'MING64' from the default prompt.
PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
PS1="$PS1"'\n' # new line
# PS1="$PS1"'\[\033[32m\]' # change to green
# PS1="$PS1"'\u@\h ' # user@host<space>
# PS1="$PS1"'\[\033[35m\]' # change to purple
# PS1="$PS1"'$MSYSTEM ' # show MSYSTEM
@howellcc
howellcc / pageant-autoload-keys-at-startup.txt
Created August 27, 2022 19:45 — forked from chunter/pageant-autoload-keys-at-startup.txt
Make Pageant autoload keys at startup
To make Pageant automatically run and load keys at startup:
- Find the location of pageant.exe
- Windows key + R to open the 'run' dialog box
- Type: 'shell:startup' in the dialog box
- Create a shortcut to the pageant.exe and put into this startup folder.
@howellcc
howellcc / .vimrc
Last active July 27, 2022 15:50
VimRC
" Import the defaults
source $VIMRUNTIME/defaults.vim
" Turn off visual mode
set mouse-=a
" change the highlight comment color to lightblue so that its actually readable
highlight comment ctermfg=lightblue
@howellcc
howellcc / git-vlog
Created June 21, 2022 20:45 — forked from asabaylus/git-vlog
Git visual log for the console
# Git visual log displays commit tree view with who did what when and in which branch
git config --global alias.vlog 'log --graph --date-order --date=relative --pretty=format:"%C(cyan)%h: %Cblue - %an - %Cgreen %C(cyan)%ar:%Creset%n%s%n" --color'
@howellcc
howellcc / .bash_profile
Created June 21, 2022 15:57
Git Bash .bashrc modifications
# generated by Git for Windows
# location C:\Users\<username>\.bash_profile
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
@howellcc
howellcc / hubitat-ui-enhancements.js
Last active April 26, 2022 02:00
Hubitat userscript for Grease/Tamper Monkey
// ==UserScript==
// @name Hubitat UI enhancements
// @description Hubitat UI enhancements. This is a fork from https://github.com/surfingbytes/hubitat/blob/master/hubitat-ui-enhancements.js. All credit goes to surfingbytes. For more information see this post: https://community.hubitat.com/t/ui-enhancements/89773
// @version 1.2
// @grant unsafeWindow
// @include http://192.168.0.100/*
// @require https://code.highcharts.com/stock/highstock.js
// @require https://code.highcharts.com/stock/modules/data.js
// @require https://code.highcharts.com/stock/highcharts-more.js
// @require https://code.highcharts.com/stock/modules/exporting.js