Every once in a while you need to have access to a json api from another domain.

Thankfully there’s a mechanism to allow this. This Mechanism is called CORS

So before any JSON request is allowed a Options requst will be sent to the corresponding ressource and expects a „Access-Control-Allow-Origin“ header to be present.

There can be different values set for this which is explained in the linked article.

To enable this globally for a NancyFX Module you have to put the following code into it.

Hopefully this will help some folks out there

As I needed to export some data to an xlsx (Excel 2007+) file I first used the Microsoft OpenXML library called DocumentFormat.OpenXML.

At first it look good but had some major performance issued while using the object oriented style. I switched over to the OpenXMLWriter (SAX) but this introduces another class of problems like corrupted files. The Documentation is a pile of shit and after some while i gave up and reimplemented my export with NPOI.

To have it a little simpler i wrote some helper functions to do the cell and row injection. The result is as follows.

 

 

I had a very basic problem while coding on a project and it was simply bulkinsert from a .NET DataTable to the MySQL Server and do this FAST! After crawling the net for a while I came to the conclusion that every one of those methods where either slow or didn’t fit my needs so I hacked together my own Solution!

Tested this within my application. Took around 3 seconds for ~30K rows with this!! Not beatable by anything i’ve found :O

there you go, I hope this helps some ppl out there!

 

Edit: some polishing 😉