Skip to content

Instantly share code, notes, and snippets.

View hanssens's full-sized avatar

Juliën Hanssens hanssens

View GitHub Profile
@hanssens
hanssens / NormalizedAddress.cs
Created March 22, 2012 21:37
[C#] NormalizedAddress
/// <summary>
/// Converts a single full address string into a streetname, housenumber and -suffix.
/// </summary>
public class NormalizedAddress
{
public string Streetname { get; private set; }
public string HouseNumber { get; private set; }
public string HouseNumberSuffix { get; private set; }
public NormalizedAddress(string address)
@hanssens
hanssens / LinkLabelExtensions.cs
Created March 29, 2012 13:49
[C#] LinkLabelExtensions
/// <summary>
/// Additional extensions for the LinkLabel UserControl.
/// </summary>
public static class LinkLabelExtensions
{
/// <summary>
/// Adds a NavigateUrl() function to the LinkLabel component.
/// </summary>
/// <param name="url"></param>
/// <remarks>
@hanssens
hanssens / gist:2237647
Created March 29, 2012 13:49
TEMP - LinkLabel Click's
private void Form1_Load(object sender, EventArgs e)
{
linkLabel2.Click +=new EventHandler(delegate {
System.Diagnostics.Process.Start(@"http://hanssens.com");
}
);
linkLabel2.Click += new EventHandler(linkLabel2_Click);
@hanssens
hanssens / Pluralizer.cs
Created May 30, 2012 12:30
[C#] Pluralizer
/* **********************************************************************************
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* This source code is subject to terms and conditions of the Microsoft Permissive
* License (MS-PL). A copy of the license can be found in the license.htm file
* included in this distribution.
*
* You must not remove this notice, or any other, from this software.
*
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace ShowAndHideTaskbar
{
/// <summary>
@hanssens
hanssens / Sitemap.xml
Created September 20, 2012 13:43
[C#] SitemapReader.cs
<?xml version="1.0" encoding="utf-8" ?>
<XmlSiteMap>
<Menu id="home" controller="Home" action="index" title="Mijn Homepage" url="http://www.mydomain.org" />
<Menu id="producten" controller="Products" action="overview" title="Mijn Producten" url="http://www.mydomain.org/internet/" />
</XmlSiteMap>
@hanssens
hanssens / vs2012-nocaps.reg
Created September 28, 2012 08:52
Disables UPPERCASE menu-items in Visual Studio 2012
Windows Registry Editor Version 5.00
; Visual Studio 2012 - Stop Screaming!
; This will simply add a DWORD (32-bit) key with value "1" to the registry node,
; disabling THE SCREAMING MENU CAPS in Visual Studio 2012.
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\General]
"SuppressUppercaseConversion"=dword:00000001
@hanssens
hanssens / Sitemap.xml
Created October 18, 2012 09:49
[C#] XML SiteMapReader
<?xml version="1.0" encoding="utf-8" ?>
<XmlSiteMap>
<Menu id="home" controller="Home" action="index" title="Mijn Homepage" url="http://mijnhomepage.nl" />
<Menu id="producten" controller="Products" action="overview" title="Mijn Producten" url="http://mijnhomepage/producten/" />
</XmlSiteMap>
@hanssens
hanssens / Randomizer.cs
Created November 12, 2012 09:10
[C#] Randomizer, a generic Randomizer (incl. seeds) and extension method for IEnumerable.
namespace Hanssens.BeyondRandomizing
{
/// <summary>
/// Utilities for randomizing.
/// </summary>
public class Randomizer : IDisposable
{
protected Random randomizer { get; private set; }
public Randomizer()
@hanssens
hanssens / ExternalLanguages.cs
Created November 15, 2012 08:08
[C#] Array of strings, to array of enum values
public enum ExternalLanguages
{
NL, BE, DE, RU, JP, FR, SP
}