Skip to content

Instantly share code, notes, and snippets.

@Vaccano
Vaccano / app.html
Created March 29, 2016 21:38
Aurelia Gist
<template>
<require from="./boxes-vm"></require>
<h1>${message}</h1>
<form role="form">
<boxes boxes.bind="shipment.boxes"></boxes>
</form>
<button click.delegate="clearBoxes()">Clear All</button>
</template>
@Vaccano
Vaccano / app.html
Last active April 21, 2016 18:30
Aurelia Gist - Bind causes bindable callback failure
<template>
<require from="./boxes-vm"></require>
<h1>${message}</h1>
<form role="form">
<boxes boxes.bind="shipment.boxes"></boxes>
</form>
<button click.delegate="clearBoxes()">Clear All</button>
</template>
@Vaccano
Vaccano / app.html
Last active May 30, 2017 20:11 — forked from jdanyow/app.html
Aurelia Gist
<template>
<h1>${message}</h1>
</template>
@Vaccano
Vaccano / input-mask.ts
Created February 26, 2016 17:26
Masked Input for Aurelia using jquery.mask
import {inject, customAttribute, bindable, bindingMode} from 'aurelia-framework';
@customAttribute('input-mask')
@inject(Element)
export class InputMaskCustomAttribute {
@bindable({ defaultBindingMode: bindingMode.twoWay, changeHandler: 'onUnmaskedValueChanged' })
unmaskedValue: any;
onUnmaskedValueChanged(newValue, oldValue) {
@Vaccano
Vaccano / Update Property on an Identity Column
Created September 9, 2015 18:29
Update Property on an Identity Column
USE pubs
GO
EXEC sp_configure 'allow update', '1'
RECONFIGURE WITH OVERRIDE
GO
DECLARE @col varchar(128), @table varchar(128)
-- for find identity column (if colstat =1 then identity is on)
CREATE SCHEMA Customer
GO
CREATE SCHEMA detail
go
CREATE TABLE Customer.Customer
(
CustomerId BIGINT IDENTITY(1,1) PRIMARY KEY,
CurrentCustomerIdentifierId BIGINT NULL
@Vaccano
Vaccano / gist:6324223
Last active December 21, 2015 15:08
Automapper reusing the same instance
void Main()
{
Mapper.CreateMap<SourceTest, DestTest>()
.ForMember(x=>x.CommonIgnoredValue, opt=>opt.Ignore())
.IgnoreAllNonExisting();
var source = new SourceTest{ CommonValue = "FromSource", CommonIgnoredValue = "Ignored Value from Source"};
var dest = new DestTest { CommonValue = "FromDest", CommonIgnoredValue = "Ignored Value from Dest", DestOnlyValue = "Value Only In Dest" };
Mapper.Map(source, dest);
@Vaccano
Vaccano / gist:5173613
Last active December 15, 2015 00:29
Custom Control for Stack Overflow Question
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Chromes="clr-namespace:Xceed.Wpf.Toolkit.Chromes;assembly=WPFToolkit.Extended"
xmlns:Controls="clr-namespace:OMStudio.Wpf.Controls"
xmlns:utils="clr-namespace:Arup.Wpf.Utils.Converters;assembly=Arup.Wpf.Utils"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
>
<xctk:InverseBoolConverter x:Key="InverseBoolConverter" />
<xctk:VisibilityToBoolConverter x:Key="VisibilityToBoolConverter" Inverted="True" />
@Vaccano
Vaccano / DebugBinding.cs
Created November 12, 2012 17:08
DebugBindings.cs
public class DebugConverter : IValueConverter
{
public static DebugConverter Instance = new DebugConverter();
private DebugConverter() {}
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Debugger.Break();
@Vaccano
Vaccano / Syle.xml
Created November 9, 2012 23:52
Syle.xml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Styles="clr-namespace:MyProject.Wpf.Controls.Styles">
<!--Setup the look of the tool tips-->
<Style TargetType="{x:Type ToolTip}">
<Setter Property="Foreground" Value="#2E2E2E"/>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">