Skip to content

Syntax highlighting for your code snippets in wordpress.com

If’ve seen people using screenshots or plugins in the IDE to post their source code in wordpress.com. But it’s much easier. Just use the [sourcecode] tag in HTML mode (example for C# syntax):

[sourcecode language="css"]
your code here
[/sourcecode]

For more information see this

Advertisements

Print all properties of Environment class

If you need a quick overview of the system configuration you can use this code snippet:

public class EnvironmentHelper
{
    public static string GetAllEnvironmentInformations()
    {
        StringBuilder builder = new StringBuilder();

        Type type = typeof(Environment);
        PropertyInfo[] propertyInfos = type.GetProperties();
        foreach (PropertyInfo propertyInfo in propertyInfos)
        {
            object value = propertyInfo.GetValue(null, null);
            if( value != null)
            {
                builder.AppendLine(propertyInfo.Name + ": " + value);
            }
        }

        return builder.ToString();
    }
}

Interactive calendar for FIFA World Cup 2010

Get all details for the World Cup 2010 in South Africa:

  • World Cup 2010 Schedule
  • Cities And Stadiums
  • Groups And Stages
  • National Teams
  • and more

http://www.marca.com/deporte/futbol/mundial/sudafrica-2010/calendario-english.html

image

Rediscovered xkcd

Recently I rediscovered the well-known webcomic xkcd created by Randall Munroe.

Have fun!

Print all folders of enum Environment.SpecialFolder

foreach( Environment.SpecialFolder folder in Enum.GetValues(typeof(Environment.SpecialFolder)))
{
 Console.WriteLine(Enum.GetName(typeof (Environment.SpecialFolder), folder) + ": " + Environment.GetFolderPath(folder));
}

Read more…

April Fool – Google.com

Google has a new measuring unit for displaying the search results.

gigawatts? femtogalactic years? times the velocity of an unladen swallow? nanocenturies? parsecs? nanocenturies? microfortnights? skidoo? …

image

image

April Fool – Stackoverflow.com

First I thought my account was hacked but everybody has a new picture with a fairy-tale unicorn. Nice!

image

image image image image image image

 image image image