Skip to content

Instantly share code, notes, and snippets.

View khellang's full-sized avatar

Kristian Hellang khellang

View GitHub Profile
public class ValidatableModel : INotifyDataErrorInfo, INotifyPropertyChanged
{
private ConcurrentDictionary<string, List<string>> _errors =
new ConcurrentDictionary<string, List<string>>();
public event PropertyChangedEventHandler PropertyChanged;
public void RaisePropertyChanged(string propertyName)
{
var handler = PropertyChanged;

Keybase proof

I hereby claim:

  • I am khellang on github.
  • I am khellang (https://keybase.io/khellang) on keybase.
  • I have a public key whose fingerprint is 4CBC 3C71 8B18 5CCD 2675 3C10 1451 C164 06CD C320

To claim this, I am signing this object:

using System.Threading;
Console.Beep(659, 125);
Console.Beep(659, 125);
Thread.Sleep(125);
Console.Beep(659, 125);
Thread.Sleep(167);
Console.Beep(523, 125);
Console.Beep(659, 125);
Thread.Sleep(125);
public static class Crc32
{
private const uint Seed = 0xFFFFFFFF;
private const uint Polynomial = 0xEDB88320;
private static readonly uint[] LookupTable;
static Crc32()
{
#region License and Terms
// MoreLINQ - Extensions to LINQ to Objects
// Copyright (c) 2008 Jonathan Skeet. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
@khellang
khellang / IoC.cs
Last active August 29, 2015 14:14
public interface IApplicationSingleton
{
void MethodCalledEachRequest();
}
public interface IRequestScopedService
{
void DoSomething();
}
<todo>
<!-- layout -->
<h3>{ opts.title }</h3>
<ul>
<li each={ item, i in items }>{ item }</li>
</ul>
<form onsubmit={ add }>
let buildMode = getBuildParamOrDefault "buildMode" "Release"
let testResultsDir = "./testresults"
let appBuildDir = "./src/**/bin" @@ buildMode
let testBuildDir = "./test/**/bin" @@ buildMode
Target "Clean" (fun _ ->
!! appBuildDir
++ testBuildDir
++ testResultsDir
var utested = {
'harveys': {
name: 'Harveys',
address: 'Tollbodata 3, 4611 Kristiansand',
latitude: 58.1441782,
longitude: 7.993443899999988,
website: 'http://www.harveys.no/news/hjem.html',
openingHours: [
{ days: 'Mandag - Onsdag', open: '1500', close: '2200' },
{ days: 'Torsdag - Fredag', open: '1500', close: '0200' },
/// <summary>
/// This function tries to normalize a string that represents framework version names into
/// something a framework name that the package manager understands.
/// </summary>
public static FrameworkName ParseFrameworkName(string frameworkName)
{
if (frameworkName == null)
{
throw new ArgumentNullException("frameworkName");
}