Skip to content

Instantly share code, notes, and snippets.

View olohmann's full-sized avatar

Oliver Lohmann olohmann

View GitHub Profile
@olohmann
olohmann / Download-Resources.ps1
Created November 9, 2019 17:13
Download Ignite Resources (macOS/Linux) - uses wget
Param (
## The directory into which the user wishes to download the files.
[string]$directory = $PSScriptRoot,
## Optional parameter allowing the user to specifiy the code (or comma seperated codes) of the video(s) they wish to download.
[string]$sessionCodes = "",
[switch]$updateLocalMetadataOnly
)
### Variables ###
$api = 'https://api-myignite.techcommunity.microsoft.com/api/session/all'
@olohmann
olohmann / Index.cshtml
Created March 27, 2019 14:53
PartsUnlimitedWebsite/Views/ShoppingCart/Index.cshtml
@using PartsUnlimited
@model PartsUnlimited.ViewModels.ShoppingCartViewModel
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
@{
ViewBag.Title = "Shopping Cart";
}
@functions
{
public string GetAntiXsrfToken()
@olohmann
olohmann / clean-resource-groups.sh
Created March 14, 2019 18:49
Quickly Clean up Azure Resource Groups in a (Demo) Subscription
#!/bin/bash
GREEN='\033[0;32m'
NC='\033[0m' # No Color
CURRENT_SUBSCRIPTION_ID=$(az account list --all --query "[?isDefault].id | [0]" | tr -d '"')
CURRENT_SUBSCRIPTION_NAME=$(az account list --all --query "[?isDefault].name | [0]" | tr -d '"')
echo -e "${GREEN}[NOTE]${NC} Subscription Context: ${GREEN}${CURRENT_SUBSCRIPTION_NAME} (${CURRENT_SUBSCRIPTION_ID})${NC}"
read -p "Continue to clean up RGs in this subscription (y/n)? " CONT
if [ "$CONT" = "y" ]; then
colorflag="--color=auto"
alias ls="command ls ${colorflag}"
alias l="ls -lF ${colorflag}"
alias la="ls -laF ${colorflag}"
alias lsd='ls -lF ${colorflag} | grep "^d"'
@olohmann
olohmann / navigator.js
Created June 17, 2014 14:17
navigator.js from Visual Studio Windows Store App templates
(function () {
"use strict";
var nav = WinJS.Navigation;
WinJS.Namespace.define("Application", {
PageControlNavigator: WinJS.Class.define(
// Define the constructor function for the PageControlNavigator.
function PageControlNavigator(element, options) {
this._element = element || document.createElement("div");

Keybase proof

I hereby claim:

  • I am olohmann on github.
  • I am olli (https://keybase.io/olli) on keybase.
  • I have a public key whose fingerprint is D452 0BE4 A9F4 2095 268C 85E0 BCBC 33D7 FEB9 9AB3

To claim this, I am signing this object:

<Border Background="White" Margin="10">
<Border.Effect>
<DropShadowEffect/>
</Border.Effect>
<!-- A lot of content -->
</Border>
public class DragDropFriendlyListBoxItem : ListBoxItem
{
private List<object> previousSelection = new List<object>();
private List<object> currentSelection = new List<object>();
private bool capturedSelectionOnMouseDown;
/// <summary>
/// Finds the parent DragDropFriendly list box.
/// </summary>
public class DragDropFriendlyListBoxItem : ListBoxItem
{
private List<object> previousSelection = new List<object>();
private List<object> currentSelection = new List<object>();
private bool capturedSelectionOnMouseDown;
/// <summary>
/// Finds the parent DragDropFriendly list box.
/// </summary>
public class DragDropFriendlyListBox : ListBox
{
/// <summary>
/// Gets the container for item override.
/// </summary>
/// <returns>The DragDropFriendlyListBoxItem container.</returns>
protected override DependencyObject GetContainerForItemOverride()
{
return new DragDropFriendlyListBoxItem();
}