Home > Uncategorized > Bloggs containing nicely formatted code

Bloggs containing nicely formatted code

This post is just an exercise for me. The purpose is simply to find a reasonably simple and nice looking way of posting code. So… this is a sample of some random c# code using the CopyAsHtml visual studio-addin available at the code project:

    1 using System;


    3 namespace GeneratorUtils

    4 {

    5     public class PropertyMetaData

    6     {

    7         public string Name { get; set; }


    9         public ClassMetaData Type { get; set; }


   11         public string TypeName { get; set; }

   12     }

   13 }



The indention did not work properly on wordpress. This is another random strip of python code:

import mechanize
import sys

if len(sys.argv) != 3:
  sys.exit("Usage: upload.py <directory> <filename>")
directory = sys.argv[1]

Allright, not too shabby.

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: