About This Website

This is the website of Leslie Viljoen. I am a Disciple, Husband, Dad, Programmer, Gamer, Geek, Gardener. Perhaps even in that order. I live in Auckland and work at Visfleet, doing mostly Ruby on Rails and a little Devops on the side.

Comments are welcome!

Contact me AT gmail, using the address leslieviljoen.

I usually post more current info about what's happening with me on my LiveJournal page. Sadly I am also on Facebook. I know, Facebook is not for contrarians, but Facebook helps me keep tabs on what my far flung friends and family are up to, so I go on now and then. I'm also on Twitter: @leslieviljoen.

This Website

I've had some sort of website going for ages now.

First I had a Flash website, which was never completely finished before the source was lost, so now I can't finish it. Take a look, its quite pretty but hasn't changed since 2005. I had some great Genetic Algorithm stuff in there and I called it my "Home" page because I modeled the pages after the rooms in my house.

Later I started a MoinMoin wiki. Then I moved it to Instiki, then to Junebug. Many of these sites ran at home on my Mac Mini, but after the power failures in South Africa because government forgot to build new power stations, I decided I'd have to move servers. And while moving, I might as well move to a platform better suited to what I was doing: a blog engine.

I signed up at Blogger, because that was the easiest, but I soon realised that their nifty HTML editing website widget was a hindrance to moving my articles across. The HTML mode helped but I still ended up spending way too long formatting by hand. And the only option for code syntax highlighting seemed to be highlighting it with Maruku and pasting the resulting HTML into the blog, which was really painful.

So I tried Wordpress which was just as bad, and BlogSpirit. Then I tried Hobix but it seemed to have died. And then Webby. Which served me well for many years and then finally in 2013 I found it unmaintained and broken. Rather than fix it I decided to hack something together in Rails. This is the result - though it's only a few hours into the project so far!

And look, I have Markdown! And syntax highlighting!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Array
  # return this array with elements shuffled
  # 
  def shuffle
    source = self.clone
    out = []
    while !source.empty?
      out << source.delete_at(rand*source.length)
    end
    out
  end
  # drop random elements in the array to 
  # produce a smaller (ordered) array of size n
  #
  def reduce(n)
    out = self.clone
    while out.length>n
      out.delete_at(rand*out.length)
    end
    out
  end
end

Back

Metadata

Home

Leslie

This is the website of Leslie Viljoen. More info



This website is powered by Rails 4
log in