Skip to content

Instantly share code, notes, and snippets.

View willwm's full-sized avatar

Will Wolff-Myren willwm

View GitHub Profile
@willwm
willwm / Profile.ps1
Last active July 19, 2020 04:41
User-level PowerShell profile, including aliases
# Helper function to include hidden items (like ls -la)
function Get-ChildItemForce
{
Get-ChildItem -Force
}
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/set-alias
Set-Alias -Name la -Value Get-ChildItemForce
Set-Alias -Name ll -Value Get-ChildItemForce
Set-Alias -Name which -Value Get-Command
@willwm
willwm / Windows10-Setup.ps1
Last active November 11, 2021 00:55
Windows 10 Setup (Chocolatey + Boxstarter)
### Base Windows Configuration ###
# Enable Windows Features...
Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online -NoRestart
Enable-WindowsOptionalFeature -FeatureName Containers -Online -NoRestart
Enable-WindowsOptionalFeature -FeatureName Microsoft-Windows-Subsystem-Linux -Online -NoRestart
### Chocolatey Installs ###
# Install Chocolatey: https://chocolatey.org/install
@willwm
willwm / ubuntu-setup.sh
Last active July 19, 2020 04:41
Fresh Ubuntu install script with NodeJS, Yarn, and Microsoft repositories
#!/bin/bash
# Package Source: Microsoft (https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu)
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list)"
sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/18.04/mssql-server.list)"
# Update package cache, upgrade all packages...
sudo apt update && sudo apt full-upgrade -y
]4;16;rgb:00/00/00\]4;17;rgb:00/00/5f\]4;18;rgb:00/00/87\]4;19;rgb:00/00/af\]4;20;rgb:00/00/d7\]4;21;rgb:00/00/ff\]4;22;rgb:00/5f/00\]4;23;rgb:00/5f/5f\]4;24;rgb:00/5f/87\]4;25;rgb:00/5f/af\]4;26;rgb:00/5f/d7\]4;27;rgb:00/5f/ff\]4;28;rgb:00/87/00\]4;29;rgb:00/87/5f\]4;30;rgb:00/87/87\]4;31;rgb:00/87/af\]4;32;rgb:00/87/d7\]4;33;rgb:00/87/ff\]4;34;rgb:00/af/00\]4;35;rgb:00/af/5f\]4;36;rgb:00/af/87\]4;37;rgb:00/af/af\]4;38;rgb:00/af/d7\]4;39;rgb:00/af/ff\]4;40;rgb:00/d7/00\]4;41;rgb:00/d7/5f\]4;42;rgb:00/d7/87\]4;43;rgb:00/d7/af\]4;44;rgb:00/d7/d7\]4;45;rgb:00/d7/ff\]4;46;rgb:00/ff/00\]4;47;rgb:00/ff/5f\]4;48;rgb:00/ff/87\]4;49;rgb:00/ff/af\]4;50;rgb:00/ff/d7\]4;51;rgb:00/ff/ff\]4;52;rgb:5f/00/00\]4;53;rgb:5f/00/5f\]4;54;rgb:5f/00/87\]4;55;rgb:5f/00/af\]4;56;rgb:5f/00/d7\]4;57;rgb:5f/00/ff\]4;58;rgb:5f/5f/00\]4;59;rgb:5f/5f/5f\]4;60;rgb:5f/5f/87\]4;61;rgb:5f/5f/af\]4;62;rgb:5f/5f/d7\]4;63;rgb:5f/5f/ff\
@willwm
willwm / Open PowerShell Here.reg
Created November 18, 2017 14:54
Add "Open PowerShell Here" command (with icon) to directory, directory background, and drive context menus.
Windows Registry Editor Version 5.00
; Directory menu
[HKEY_CLASSES_ROOT\Directory\shell\PowershellMenu]
@="Open PowerShell Here"
"NoWorkingDirectory"=""
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
[HKEY_CLASSES_ROOT\Directory\shell\PowershellMenu\command]
@willwm
willwm / EnableRemoting.ps1
Last active September 12, 2024 03:12
Includes fix for "WinRM firewall exception will not work since one of the network connection types on this machine is set to Public."
# https://4sysops.com/archives/enabling-powershell-remoting-fails-due-to-public-network-connection-type/#changing-the-network-connection-type-with-powershell
Set-NetConnectionProfile -NetworkCategory Private
Enable-PSRemoting
@willwm
willwm / getHashValueForKey.js
Last active April 15, 2018 11:40
Retrieve the value associated with 'key' from window.location.hash
// https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
function getHashValueForKey(key) {
var hash = window.location.hash.substr(1);
var searchParams = new URLSearchParams(hash);
return searchParams.get(key);
}
@willwm
willwm / index.js
Created December 23, 2017 10:49
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
var oauth = require('oauth-sign');
var action = 'http://lti.tools/saltire/tp';
var method = 'POST';
var timestamp = Math.round(Date.now() / 1000);
var params = {
// LTI Required Parameters
@willwm
willwm / wsl-freshinstall.sh
Last active July 3, 2018 22:12
Awesome installation script for WSL Ubuntu
bash -c "$(curl -fsSL https://raw.githubusercontent.com/jldeen/dotfiles/wsl/configure.sh)"
# Package Source: Node 10.x (https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
# Update package cache, upgrade all packages...
sudo apt update && sudo apt full-upgrade -y
# Install: Development Tools...
sudo apt install -y build-essential git nodejs
Get-ChildItem "C:\path\to\folder" -recurse | Where-Object { (Get-Content $_) -like '*TextToFind*' } | Select-Object { $_.FullName}