Skip to content

Instantly share code, notes, and snippets.

<CascadingAuthenticationState>
<Router AppAssembly="typeof(App).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)">
<Authorizing>
</Authorizing>
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
@iambacon
iambacon / migrateShelvset.bat
Last active September 29, 2016 08:56
TFS power tools command to migrate a shelveset from one branch to another. Guide: http://benjii.me/2014/04/move-shelveset-to-different-branch-in-tfs/
tfpt unshelve /migrate /source:"$/ProjectName/Branch" /target:"$/ProjectName/Targetbranch" "My Shelveset Name"
@iambacon
iambacon / CustomAppBarButton.xaml
Created September 15, 2015 15:25
Creating an AppBarButton with an image
<AppBarButton>
<AppBarButton.Icon>
<BitmapIcon UriSource="ms-appx:///custom-image.png"/>
</AppBarButton.Icon>
</AppBarButton>
/// <summary>
/// Extension methods for <see cref="DependencyObject"/>.
/// </summary>
public static class DependancyObjectExtensions
{
/// <summary>
/// Gets the visual parent of the specified type of the child.
/// </summary>
/// <typeparam name="T">The type.</typeparam>
/// <param name="child">The child.</param>
@iambacon
iambacon / ValueConverterGroup.cs
Created August 24, 2015 13:25
Value converter that accepts multiple converters
/// <summary>
/// Value converter group.
/// Takes multiple value converters.
/// </summary>
public class ValueConverterGroup : List<IValueConverter>, IValueConverter
{
/// <summary>
/// Modifies the source data before passing it to the target for display in the UI.
/// </summary>
/// <param name="value">The source data being passed to the target.</param>
/// <summary>
/// truncate string at the last full word before char limit and appends ...
/// </summary>
/// <param name="input">The input.</param>
/// <param name="length">The string length.</param>
/// <returns>The truncated string.</returns>
public static string TruncateAtWord(this string input, int length)
{
if (input == null || input.Length < length)
{
@iambacon
iambacon / .gitconfig
Last active November 29, 2016 10:44
Git alias and colour config with SourceGear DiffMerge settings
[diff]
tool = DiffMerge
[difftool "DiffMerge"]
cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' "$LOCAL" "$REMOTE"
[merge]
tool = DiffMerge
[mergetool "DiffMerge"]
cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' -merge -result="$PWD/$MERGED" "$PWD/$LOCAL" "$PWD/$BASE" "$PWD/$REMOTE"
trustExitCode = true
[mergetool]
# Chocolatey
iex ((new-object net.webclient).DownloadString('http://bit.ly/psChocInstall'))
# install browsers
cinst GoogleChrome
cinst Firefox
cinst GoogleChrome.Canary
cinst Opera
# cinst ie11
@iambacon
iambacon / Gruntfile.js
Last active August 29, 2015 14:05
Compiling SASS with libsass, Autoprefixer and grunt
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Sass
sass: {
@base--line-height: 1.2;
@base--font-size: 16px;
.font-size(@font-size; @line-height) when(@line-height = true){
line-height: ceil(@font-size / @base--line-height) * (@base--line-height / @font-size);
.font-size(@font-size);
}
.font-size(@font-size; @line-height:false) {
font-size: @font-size;