Skip to content

Instantly share code, notes, and snippets.

View Dkowald's full-sized avatar

Derek Kowald Dkowald

  • Brisbane, Australia
View GitHub Profile
@Dkowald
Dkowald / breakAt.less
Last active July 31, 2017 06:36
Sample styles to show / hide based on responsive breakpoints.
@import "breakpoints.less";
/**Font awesome : http://fontawesome.io*/
@mobilePhone: "\f10b"; //fa-mobile
@tablet: "\f10a"; //fa-tablet
@laptop: "\f109"; //fa-laptop
@desktop: "\f11c"; //fa-keyboard-o
@widescreen: "\f108"; //fa-desktop
@tv: "\f26c"; //fa-television
@Dkowald
Dkowald / CircularStack.cs
Last active June 14, 2017 20:14
Simple length-limited stack
namespace kwd.gist {
using System.Collections.Generic;
public class CircularStack<T>
{
private readonly int _max;
private readonly List<T> _items = new List<T>();
public CircularStack(int max)
{
_max = max;
@Dkowald
Dkowald / HostApplication.cs
Created November 26, 2012 22:02
Azure role entry with config for hot-start of sites
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Microsoft.Web.Administration;
using Microsoft.WindowsAzure.ServiceRuntime;
namespace Kwd.Web
{
/// <summary>
@Dkowald
Dkowald / IEnumerableExtension.cs
Created September 12, 2012 01:11
.NET generic Split<T>() extension
namespace derek.kowald.util
{
public static class IEnumerableExtension
{
/// <summary>
/// Generic split operation, behave the same as string split.
/// </summary>
/// <remarks>
/// Other usefull split options, such as count and remove empty from string.split()
/// are better implemented with a little linq code:
@Dkowald
Dkowald / JsTest.cs
Created May 24, 2012 22:13
qunit + mstest; using simple in-proc webserver.
using System;
using System.IO;
using System.Net;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MyApplication.Core.Tests
{
/// <summary>
/// Intergrate a qunit test with mstest.
/// </summary>
@Dkowald
Dkowald / SpringDuck.cs
Created November 15, 2011 21:59
SpringDuck - spring factory for Impromptu
using System;
using ImpromptuInterface;
using Spring.Objects.Factory.Config;
namespace derek.kowald.BaseWebApp.Core.Extensions.Spring
{
/// <summary>
/// Custom <a href='http://www.springframework.net/'>spring.net</a>
/// factory for creating an object that implements
/// a specified interface, using a target object (<a href='http://en.wikipedia.org/wiki/Duck_typing'>duck-typing</a>).
@Dkowald
Dkowald / SubmitActionHandler.cs
Created November 9, 2011 22:21
SubmitActionHandler - MVC multiple submit buttons.
namespace derek.kowald.MVC
{
using System;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
/// <summary>
/// Custom route handler so a form submit button can
/// define the mvc action to take.