Skip to content

Instantly share code, notes, and snippets.

Avatar

AJ Tatum ajtatum

View GitHub Profile
@ajtatum
ajtatum / ConcatSalesRepsCommission.sql
Created May 1, 2012
Function to Concat Sales Rep Commission
View ConcatSalesRepsCommission.sql
CREATE FUNCTION [dbo].[ConcatSalesRepsCommission]
(
-- Add the parameters for the function here
@SalesRepID INT, @LocationID INT, @SurgeonID INT
)
/*
EXAMPLE:
SELECT dbo.ConcatSalesRepsCommission(14,45,36)
RETURNS:
@ajtatum
ajtatum / ChangeRemotePort.ps1
Created May 17, 2017
Simple script that allows you to easily change the port number for RDP connections by updating the Registry, Firewall, and the Restarting Terminal Services.
View ChangeRemotePort.ps1
param (
[int]$port = $(Read-Host "Please enter the new RDP port number")
)
# Set the registry value for the port
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Terminal*Server\WinStations\RDP-TCP\ -Name PortNumber -Value $port
#Diable existing remote desktop rules
Set-NetFirewallRule -DisplayName "Remote Desktop - User Mode (TCP-In)" -Enabled False
Set-NetFirewallRule -DisplayName "Remote Desktop - User Mode (UDP-In)" -Enabled False
@ajtatum
ajtatum / boxstarter.ps1
Last active Feb 20, 2018
Boxstarter Commands for a new Windows box.
View boxstarter.ps1
# Description: Boxstarter Script
# Author: AJ Tatum <aj@ajtatum.com>
# Last Updated: 2018-02-19
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/ajtatum/455d0d8edd2652ef96cf4525f45b76ee/raw/188f6c48dfc47add91f3ae6aecc5839e588bfd16/boxstarter.ps1
# OR
@ajtatum
ajtatum / systools-packages.config
Last active May 28, 2018
Chocolatey - System Tools
View systools-packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="angryip" />
<package id="bulk-crap-uninstaller" />
<package id="ccenhancer" />
<package id="ccleaner" />
<package id="crystaldiskinfo" />
<package id="crystaldiskinfo.portable" />
<package id="partitionmasterfree" />
<package id="rufus" />
@ajtatum
ajtatum / cloudSettings
Last active Aug 30, 2021
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2021-08-30T02:26:20.541Z","extensionVersion":"v3.4.3"}
View AlwaysOnTop.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
^SPACE:: Winset, Alwaysontop, , A
@ajtatum
ajtatum / ProtonMailDarkCyan.css
Created Dec 29, 2019
ProtonMail Dark Cyan Theme
View ProtonMailDarkCyan.css
/* =========================================== *
* DARK CYAN THEME
* Version: 1.0.0
* Author: AJ Tatum
* Website: ajt.io
* Tweets @ajtatum
* =========================================== */
.headerDesktop-container {
background-color: #025a6c;
@ajtatum
ajtatum / UpdateGitRepositories.ps1
Created Dec 29, 2019
A short little PowerShell script that updates all the repositories in a given directory. In this scenario, I have an environment variable called repos that goes to that folder.
View UpdateGitRepositories.ps1
function Get-UrlStatusCode([string] $Url) {
try {
(Invoke-WebRequest -Uri $Url -UseBasicParsing -DisableKeepAlive).StatusCode
}
catch [Net.WebException] {
[int]$_.Exception.Response.StatusCode
}
}
$username = "";
@ajtatum
ajtatum / Program.cs
Created Feb 24, 2020
Serilog Configuration
View Program.cs
public class Program
{
public static async Task Main(string[] args)
{
await CreateHostBuilder(args).Build().RunAsync();
}
public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
@ajtatum
ajtatum / azure-function-kraken.cs
Created Jun 25, 2020
azure-function-kraken.cs
View azure-function-kraken.cs
using OptimizeSetWaitRequest = Kraken.Model.Azure.OptimizeSetWaitRequest;
using DataStore = Kraken.Model.Azure.DataStore;
namespace CreateMedia
{
public class HttpCreate
{
private static readonly string BlobStorageConnectionString = Environment.GetEnvironmentVariable("AzureWebJobsStorage");
private static readonly string KrakenApiKey = Environment.GetEnvironmentVariable("KrakenApiKey");
private static readonly string KrakenApiSecret = Environment.GetEnvironmentVariable("KrakenApiSecret");