Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am kristofclaes on github.
  • I am kristofclaes (https://keybase.io/kristofclaes) on keybase.
  • I have a public key whose fingerprint is 45E3 3C6B 51FF EA89 69E9 A572 2C0A 2AAE 5014 D451

To claim this, I am signing this object:

public class InschrijvingenController : Controller
{
private readonly ICommandDispatcher dispatcher;
public InschrijvingenController(ICommandDispatcher dispatcher)
{
this.dispatcher = dispatcher;
}
public ActionResult Create(CreateModel model)
development
| \
| FeatureX
| |
| *commit A*
| |
| *commit B*
| |
| *commit C*
| |
@kristofclaes
kristofclaes / gist:5088850
Created March 5, 2013 08:40
I found the query that made the system a bit... slow...
select * from SomeTable where ID in
(10177,2702,8437,8096,4308,943,6788,5859,8325,12315,6672,12558,8498,6226
,12534,11771,6385,7464,11544,9623,11625,6571,6280,3616,3011,2502,7623,84
82,8576,11872,7895,7493,12004,4191,12428,8941,12052,11427,6863,7459,8768
,853,9895,9170,12316,2563,11989,7551,7660,2464,10137,9914,2248,9212,1252
2,6754,5264,12043,7178,12122,9999,10289,4148,11711,9663,9281,10087,12137
,11417,5962,10611,11790,11924,3155,4178,10354,8368,7919,11817,6675,7097,
8185,12335,6304,2586,7102,11686,9667,8651,9639,9856,12197,5084,8455,1040
3,10341,8017,11992,12199,10157,2641,10095,11293,1022,6758,8088,10423,347
4,11497,6988,6213,9267,8454,6449,7024,10179,10290,11714,10096,12461,1237
@kristofclaes
kristofclaes / Exception
Created March 1, 2013 10:08
What a wonderfully helpful exception... :-(
Quiksoft.EasyMail.SMTP.FileIOException: Error sending base64 stream.
?: Error writing to socket.
at ?.?(String A_0, Boolean A_1, Encoding A_2)
at ?.?(String A_0, Boolean A_1)
at ?.?(Stream A_0, ISMTPSSL A_1, ? A_2, Int64& A_3, Int64 A_4) ---> ?: Error writing to socket.
at ?.?(String A_0, Boolean A_1, Encoding A_2)
at ?.?(String A_0, Boolean A_1)
at ?.?(Stream A_0, ISMTPSSL A_1, ? A_2, Int64& A_3, Int64 A_4)
--- End of inner exception stack trace ---
at Quiksoft.EasyMail.SMTP.SMTP.?(String A_0, EmailMessage A_1, ? A_2, SMTPQueueType A_3, Boolean A_4)
public interface IQuery<out T>
{
T Execute(IDataContext dataContext);
}
public interface IQueryHandler
{
T Handle<T>(IQuery<T> query);
}
public class Person
{
public string Name { get; set; }
public string Email { get; set; }
}
var people = new List<Person>
{
new Person { "Troy", "[email protected]" },
new Person { "John", "[email protected]" }
@kristofclaes
kristofclaes / gist:3818942
Created October 2, 2012 13:05
Is there a better way to replace multiple dashes with one dash?
string stringToClean = "a-string----with--too-many-------dashes";
while (stringToClean.Contains("--"))
{
stringToClean = stringToClean.Replace("--", "-");
}
@kristofclaes
kristofclaes / LessMinify.cs
Created August 30, 2012 07:12
LESS minifier for use in ASP.NET 4.5 bundling
public class LessMinify : IBundleTransform
{
public void Process(BundleContext context, BundleResponse response)
{
response.Content = dotless.Core.Less.Parse(response.Content);
response.ContentType = "text/css";
var cssMinifier = new CssMinify();
cssMinifier.Process(context, response);
}
public void InitializeDatabase(TContext context)
{
RuntimeFailureMethods.Requires((object) context != null, (string) null, "context != null");
bool flag;
using (new TransactionScope(TransactionScopeOption.Suppress))
{
flag = context.Database.Exists();
}
if (flag)
{