Skip to content

Instantly share code, notes, and snippets.

View cwiederspan's full-sized avatar

Chris Wiederspan cwiederspan

View GitHub Profile
@cwiederspan
cwiederspan / README.md
Last active November 20, 2024 04:08
New Machine WinGet
@cwiederspan
cwiederspan / README.md
Last active November 18, 2024 22:49
Setup WSL Linux Environment
@cwiederspan
cwiederspan / README.md
Last active October 31, 2021 19:43
Setup WSL 2 and Windows Terminal

Install the Fonts

Cascadia Code PL - Used for Windows-based apps like VS Code

Caskaydia Cove - Used for GitHub Codespaces in the browser (works on iPad)

'CaskaydiaCove Nerd Font' in VS Code Settings

Install Go

@cwiederspan
cwiederspan / setup-github-cli.sh
Created January 27, 2021 22:05
Setup and use GitHub CLI
# Install the GitHub CLI
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh
# Log into GitHub
gh auth login
# Create a repo from a template
@cwiederspan
cwiederspan / GitHub CLI Download and Setup
Created March 7, 2020 19:35
GitHub CLI Download and Setup
curl -L -O https://github.com/cli/cli/releases/download/v0.6.1/gh_0.6.1_linux_amd64.deb
sudo dpkg -i gh_*_linux_amd64.deb
@cwiederspan
cwiederspan / devcontainer.json
Created January 29, 2020 00:47
My Development Container Settings
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/azure-cli
{
"name": "ATeamSW Devcontainer",
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspace",
// Uncomment the next line to have VS Code connect as an existing non-root user in the container.
// On Linux, by default, the container user's UID/GID will be updated to match your local user. See
@cwiederspan
cwiederspan / Create ACI VSTS Build Agent.txt
Created July 28, 2018 22:26
Create Azure Container Instance with VSTS Build Agent
az container create \
--name vsts-agent \
--resource-group {MY_RESOURCE_GROUP_NAME} \
--image microsoft/vsts-agent \
--cpu 1 \
--memory 1 \
--ip-address public \
--environment-variables VSTS_ACCOUNT={MY_VSTS} VSTS_TOKEN={MY_TOKEN} VSTS_POOL="{MY_PRIVATE_POOL_NAME}"
@cwiederspan
cwiederspan / PlainTextFormatter.cs
Created September 9, 2016 23:47
Quick snippet to allow plain text POST data to an ASP.NET Core Web Api
public class PlainTextFormatter : IInputFormatter {
public bool CanRead(InputFormatterContext context) {
return context.HttpContext.Request.ContentType.ToLower() == "text/plain";
}
public Task<InputFormatterResult> ReadAsync(InputFormatterContext context) {
var reader = new StreamReader(context.HttpContext.Request.Body);
var content = reader.ReadToEnd();
@cwiederspan
cwiederspan / MefConfig.cs
Created October 17, 2013 21:38
This uses MEF configuration to enable dependency injection for the MVC 5 AccountController based on the new OWIN. The critical lines are 54-55 and 83-86.
using System.Linq;
using System.Composition.Convention;
using System.Composition.Hosting;
using System.Reflection;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Mvc;
using SourceMax.Web.IoC;
using Microsoft.AspNet.Identity;
@cwiederspan
cwiederspan / EnablePauseCountdownAds.js
Created September 24, 2012 22:02
Adwords automated Javacript file that enables or pauses Adwords ads based on a tags within the destination URL. We use the file to enable/pause a series of "countdown" ads for a dated event. The data driver for the tags is a simple Google Docs spreadsheet
// AUTHOR: Chris Wiederspan on 09/24/2012
// PURPOSE: Enable/Pause countdown ads based on a schedule provided in a Google Docs spreadsheet
// DATA FILE: A sample of the data driver file can be found here: http://bit.ly/Ts7Dih
function main() {
// Put the URL to the file that contains the data to be used
var SPREADSHEET_URL = "https://docs.google.com/spreadsheet/ccc?key=0At0IH9OYviWWdFVqa0FBVU5RR2dpQ3dPMkdJRnBoLUE#gid=0";
// Get today's date
var date = getFormattedDate();