Skip to content

Instantly share code, notes, and snippets.

package be.baes
import org.wasabi.app.AppServer
import org.wasabi.app.AppConfiguration
import org.wasabi.interceptors.parseContentNegotiationHeaders
fun main(args: Array<String>) {
val config = AppConfiguration(4000, "This is me on port 4000", true)
val server = AppServer(config)
@chrissie1
chrissie1 / gist:5458274
Created April 25, 2013 08:17
Hanselman newsletter thing
<td align="left" valign="top" class="content_bg3">
<table width="100%" cellspacing="5" cellpadding="5" border="0" bordercolor="#636531" height="250">
<tr>
<td align="left" valign="top" class="content_bg3">
<font class="content_text"><p>Hi Interfriends,</p>
<p>Thanks again for signing up for this experiment. Here's some interesting things I've come upon this week. If you forwarded this (or if it was forwarded to you) a reminder: You can sign up at <a href="http://hanselman.com/newsletter">http://hanselman.com/newsletter</a> and the <a href="http://www.hanselman.com/blog/CategoryView.aspx?category=Newsletter">archive of all previous Newsletters is here</a>.</p>
<p>Remember, you get the newsletter here first. This one will be posted to the blog as an archive in a few weeks. </p>
@chrissie1
chrissie1 / GoodLanguage
Created February 22, 2013 10:46
I don't want ICommandWithParameter<object> to be of object I want it to be this ICommandWithParameter<TParameterType>. Where am I going wrong. I now wrote badtest to make it pass but I would like to write whatIWantTest. But I could not find a good way to configure the method constraints to do that. I can make this work perfectly in VB.
Namespace Commands
Public Class CommandExecuter
Public Sub Execute(Of TCommand As {ICommand, New})()
Dim command = New TCommand()
command.Execute()
End Sub
Public Sub Execute(Of TCommand As {ICommandWithParameter(Of TParameter), New}, TParameter)(ByVal parameter As TParameter)
Dim command = New TCommand()
@chrissie1
chrissie1 / PackageSorter.cs
Last active December 13, 2015 18:58
Sorting chcolatey Pacakges On version
using System;
using System.Collections.Generic;
namespace OrderPackages
{
public class PackagesSorter:IComparer<string>
{
private static readonly char LevelSeperator = ".".ToCharArray()[0];
private const string PreRelease = "-pre";
@chrissie1
chrissie1 / gist:4299744
Created December 15, 2012 22:09
This should work but needs some locking on the set.
internal static class Container
{
private static class PerType<T>
{
public static ILog Log;
}
public static ILog GetOrAdd<T>()
{
var log = PerType<T>.Log;
Module Module1
Sub Main()
Dim s = New subclass
s.test()
Console.ReadLine()
End Sub
Public Interface IInterface
Sub test()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
@chrissie1
chrissie1 / gist:3372616
Created August 16, 2012 18:53
this should fail. In old VB.
Imports System.Dynamic
Module Module1
Sub Main()
Dim c2 As Object = New C
using EasyHttp.Infrastructure;
using Machine.Specifications;
namespace EasyHttp.Specs.Specs
{
public class When_baseuri_is_null_and_query_is_null
{
Establish context = () =>
{
uriComposer = new UriComposer();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlServerCe;
namespace SimpleDataC
{
class Program
{