by CodeMonkey
23. October 2009 16:00
I had a small challenge this week as I was wanting to post something where I would include some code. And I had seen on many other webpages how they had syntax highlighting, which I really love when they have, and I wanted something similar. But it's really annoying when you find those few blogs or websites that use a syntax highlighter that, when you try to copy the source, you get the line-numbers aswell as the code.
Enter SyntaxHighligter by Alex Gorbatchev
SyntaxHighligter is a really slick and easy-to-implement JavaScript and Flash-driven syntax-highlighter. It has linenumbers, but includes a feature to open the text from the hightighted area, in a window where the code isn't with line-numbers. You could ask why you need line-numbers in the first place. But I guess the simple answer is, it's alot easier to reference the code if you can point to a specific line instead of having to mark it in some way or form.
Example:
public void MonkeySays()
{
Console.WriteLine("Gimme another banaaana!");
}
All it takes is that you include a heep (or just the ones you know you need (afterall, most of us don't care about every single language, and your readers don't need to download something that is irrelevant) of JavaScript-files, copy some files to your /scripts/ and /styles/ folders, and then you can simply add your code for highlighting like this:
public void MyFirstMethod()
{
}
Now is that easy or what?
And as an added bonus, there are even included some nice themes. Or you could go and theme it yourself!
by CodeMonkey
21. October 2009 20:01
These days I'm ploving through Steve Sanderson's book Pro ASP.NET MVC Framework. The reason why I feel like I need to recommend this book is because of the fact that it isn't just your average "Learn [insert-technology-of-choice]"-book.
No, the author goes to great lengths to get you properly suited before diving into ASP.NET MVC, and indeed MVC in essence. He covers areas like Inversion of Control (IoC), Dependency Injection (DI) and introduces Castle Windsor (which is an IoC-container). He then gets you started writing automated tests (Unit Tests and Integration Tests) and explains why that is cool.
The book is divided into two seperate parts. One where you learn all the things you need to know before getting your hands dirty. And one where you, ofcourse, get your hands dirty. With this book under your belt, I'm quite positive you will be well on your way to becoming a proficient ASP.NET MVC developer.
Happy reading!
by CodeMonkey
20. October 2009 20:13
And so it was written that CodeMonkey-blog had come into existence. And there was much rejoicing!
Hi there, and ofcourse, welcome to my blog. This will be the place where I will do my best to write about the various technologies I work with, or am interested in. I'll probably spend some time whining about things that I dislike, but I'll certainly attempt to make my whining as contructive as possible.
I've added a few Categories that are simply my rough sketch of what fields I think I will be writing about, but this is just a sketch. Plans change, and so will my Categories!
Upcoming
- HTML5 - What can we expect from it, and how will it change the way we think about Webdevelopment.
- ASP.NET MVC - About what I learn while working with ASP.NET MVC
- OR/M - NHibernate? ActiveRecord? Entity Framework? LINQ to SQL? maybe some others.. ?
- Webdevelopment - What's cool and what's not
- Useless Junk - I will definately be posting a few things I find amusing. Maybe you'll enjoy it too.
- Functional Programming - As I'm just beginning my journey into the wonderful world of functional programming I think I'll be writing a bit about that.
- Software Projects - Meanderings about working on software projects.
- Webcasts - I'll begin doing a few webcasts once I get some sort of structure organized. I have a few things I would like to address. So stay tuned.
- ... ?
I hope you'll find some of the posts I write interesting, that you'll take part in discussions by commenting on what I write. Maybe we'll both get just a little bit smarter by sharing our views, ideas and understanding.
With that said, thank you for dropping by. And see you soon 