Skip to content

Instantly share code, notes, and snippets.

View dmtrek14's full-sized avatar
🍁

Danielle M. dmtrek14

🍁
View GitHub Profile
@dmtrek14
dmtrek14 / Nord.lua
Created November 6, 2022 03:53
Nord theme for Gittyup
-- For Windows: Place this file in C:\Users\{username}\AppData\Local\Gittyup\themes
--
--
-- Many colors support 'active', 'inactive', and 'disabled' states.
-- They can all be set to the same color with the syntax:
--
-- key = '<color>'
--
-- Or set individually with syntax like:
--
@dmtrek14
dmtrek14 / CopyFolderStructure.ps1
Created July 15, 2022 17:07
Powershell script to make a copy of just the structure of a folder
param
(
[parameter(Mandatory = $true)]
[String] $ExistingFolderName,
[parameter(Mandatory = $true)]
[String] $CopiedFolderName
)
function Create-FolderStructureCopy {
[CmdletBinding()]
param
@dmtrek14
dmtrek14 / SqlStuffManyValuesIntoRow.sql
Created July 15, 2022 16:56
Sample SQL script of a STUFF. In this example, there is a Deadlines table and if a date has more than one deadline, we want a single row per date and all deadlines to be in a comma-separated list.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Description: Returns table with deadlines.
-- If there's more than one deadline on a date, all are added to a single row and are comma separated
-- =============================================
CREATE FUNCTION [dbo].[Deadlines]
@dmtrek14
dmtrek14 / MSSQL_Docker.txt
Created July 15, 2022 16:37
Commands for spinning up SQL Server in a Docker container with persistent storage to a volume and creation of a backup folder.
sudo docker pull mcr.microsoft.com/mssql/server:2022-latest
sudo docker run -e "ACCEPT_EULA=Y" -e 'MSSQL_SA_PASSWORD=<my-secure-password>' --name 'my-db-name' -p 1433:1433 -v my-db-name-data:/var/opt/mssql -d mcr.microsoft.com/mssql/server:2022-latest
sudo docker exec -it my-db-name mkdir /var/opt/mssql/backup
@dmtrek14
dmtrek14 / GetFileSizes.ps1
Created July 15, 2022 16:24
A little Powershell script to iterate through files (including those in subfolders), get file sizes, and write out all data to an Excel file.
$files = Get-ChildItem "{path to folder being analyzed}" -Recurse
## new up an excel file
$ExcelObj = New-Object -comobject Excel.Application
$ExcelWorkBook = $ExcelObj.Workbooks.Add()
$ExcelWorkSheet = $ExcelWorkBook.Worksheets.Item(1)
$ExcelWorkSheet.Name = 'File sizes'
$ExcelWorkSheet.Cells.Item(1, 1) = 'Filename'
$ExcelWorkSheet.Cells.Item(1, 2) = 'Size (MB)'
$ExcelWorkSheet.Rows.Item(1).Font.Bold = $true
@dmtrek14
dmtrek14 / WindowsTerminalNordTheme.json
Last active August 22, 2022 18:06
Nord theme for Windows Terminal
"schemes":
[
{
"background": "#2E3440",
"black": "#2E3440",
"blue": "#5E81AC",
"brightBlack": "#4C566A",
"brightBlue": "#5E81AC",
"brightCyan": "#88C0D0",
"brightGreen": "#8FBCBB",
@dmtrek14
dmtrek14 / .gitconfig
Created July 15, 2022 16:09
Some useful Git aliases
[alias]
s = status
d = diff
co = checkout
cob = checkout -b
cane = commit --amend --no-editor
aa = add --all
cam = commit -am
delb = branch -D
br = branch --format='%(HEAD) %(color: brightBlue)%(refname:short)%(color:reset) - %(contents:subject)%(color:green)(%(committerdate:relative)) %(color: magenta)[%(authorname)]' --sort=-committerdate