Skip to content

Instantly share code, notes, and snippets.

View jdalley's full-sized avatar

Jeff Dalley jdalley

View GitHub Profile
@jdalley
jdalley / gitthings.md
Last active July 3, 2021 03:09
Git Things

Git Things

Useful things you can do with git.

  • Cross-repository issue tagging:
    • [org/repo#407]
  • Reset local branch to match origin (throw away local commits):
    • git reset --hard origin/<branch_name>
  • See diff between local and remote:
    • git diff origin/main..HEAD
  • See files changed between local and origin after a fetch:
@jdalley
jdalley / trainingmaterials.md
Last active March 30, 2021 22:49
Learning Materials & Training Courses

What Is This?

A place where I keep learning resources that I've found useful. Started as a list for my team at work, but will likely continue to grow outside that over time.

A chunk of the training courses here are pluralsight as it's what we've had access to at my company traditionally. That being said I'll try to find similar resources for non-pluralsight subscribers as times goes on; it just happens to be a go-to spot for Microsoft-stack teachers and developers.

Books

@jdalley
jdalley / profiles.json
Last active October 10, 2020 01:36
Windows Terminal Settings
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"theme": "dark",
"initialCols": 154,
@jdalley
jdalley / wtfwindows.md
Last active November 26, 2019 22:16
Windows 10 - Console lock display off timeout

If you lock your Windows 10 machine and find that after a period of time (1 minute? 3 minutes?) it goes to sleep and the displays turn off. You may have a value set in a hidden Power Option menu.

  1. Open the registry and go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7
  2. Change the value of 'Attributes' from 1, to 2.
  3. You should now see the Console lock display off timeout options under the Display menu in Power Options for a given profile.
  4. Set the Setting propery for both On Battery\Plugged In to 0 to force it off.
  5. ???
  6. Profit
@jdalley
jdalley / wsl_setup.md
Last active January 9, 2023 14:01
Windows Subsystem for Linux (WSL) - Ubuntu Setup

Steps for setting up a decent looking WSL Ubuntu terminal

Install and configure the WSL/Ubuntu console:

  • Enable WSL on Windows 10 through 'Programs and Features'.
  • Install WSL Ubuntu from the Windows Store.
  • Launch ubuntu.exe and do initial 'Properties/Defaults' config:
    • Right click on the title bar, select Defaults:
      • Under the Options tab, select Use Ctrl+Shift+C/V as Copy/Paste
      • You might want to increase Buffer Size for Command History under the Options tab, and Height under Layout > Screen Buffer Size: 9001 seems like enough 😄
@jdalley
jdalley / Microsoft.PowerShell_profile.ps1
Created November 15, 2018 07:41
Powershell Profile
Set-Location D:\Dev\Source
Set-PSReadlineOption -BellStyle None
# posh-git setup:
Import-Module posh-git
$GitPromptSettings.DefaultPromptPath.Text = '$(Split-Path -leaf -path (Get-Location))'
@jdalley
jdalley / eb_config_alias_cert_swap.ps1
Last active January 1, 2023 18:29
AWS CLI - blue/green deployment via swapping DNS aliases and SSL certificates between two Elastic Beanstalk environments.
# This script gets the DNSNames of two defined Route53 domains (one is a subdomain of the other),
# and swaps the aliases to perform a blue/green deployment. Or for whatever other reason you can imagine.
# Note: If you were doing this for two different non-subdomain domains; you'd have two Hosted Zone Ids here:
$hostedZoneId = '<some-hosted-zone-id>'
$stagingDNSAlias = aws route53 list-resource-record-sets `
--hosted-zone-id $hostedZoneId `
--query "ResourceRecordSets[?Name == 'staging.yoursite.com.'].AliasTarget.DNSName" `
@jdalley
jdalley / d2clannames.txt
Created October 25, 2017 20:14
Destiny 2 Clan Name Ideas
Semaphores
ScopeCreep
ProjectMuteX
AbstractAbomination
NullReference
Drop Table Clans
MicroMonoliths
MonolithMammoth
@jdalley
jdalley / boxstarter.ps1
Last active January 5, 2018 17:12 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jeff Dalley
# Last Updated: 2017-10-10
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@jdalley
jdalley / CacheHelper.cs
Last active May 8, 2019 16:51
MemoryCache Helper
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Caching;
using System.Text;
using System.Threading.Tasks;
namespace TestProj.Helpers
{
/// <summary>