A Greasemonkey script for reddit users.
by elbekko on Dec.24, 2009, under Uncategorized
I wrote this little script to convert imgur links into their fast version, because the imgur site often loads very slowly for me (don’t ask me why, I have no clue).
So, behold:
// ==UserScript==
// @name Reddit Pics
// @namespace http://www.reddit.com/r/
// @description Makes imgur links into the proper link
// @include http://www.reddit.com/r/
// ==/UserScript==
var entries = document.getElementsByTagName("a");
for(var i = 0; i != entries.length; i++)
{
var link = entries[i];
// Is link to imgur
if(/*link.className.indexOf("title loggedin ") != -1 && */link.href.indexOf("imgur.com") != -1)
{
if(link.href.split(".").length < 3)
{
link.title = "Original at: " + link.href;
link.href += ".png";
link.href = wtf_replace(link.href, "imgur.com", "i.imgur.com");
}
else if(link.href.indexOf("i.imgur.com") == -1)
{
link.title = "Original at: " + link.href;
link.href = wtf_replace(link.href, "imgur.com", "i.imgur.com");
}
}
}
function wtf_replace(str, text, rwith)
{
return str.substr(0, str.indexOf(text)) + rwith + str.substr(str.indexOf(text) + text.length);
}
Don't mind the custom replace function, it was to debug the regex, but I figure this could well be faster and I can't be arsed removing it.
Just set it to work on all of Reddit, and every link to imgur will be turned into the fast version.
RobotMC Team Building Day
by elbekko on Sep.24, 2009, under Robots
On the 19th of September 2009, RobotMC organised its second Team Building Day.
In the months before the contest, a few hints are given out, like telling you which sensors you’ll be needing lots of. On the day itself though, you have around 6-7 hours of time to build and program your robot. And in my case an hour or so of that was wasted on reading a tutorial, as it had been a rather long time since I last worked with NXC.
CTFBot 1: The Beginnings
by elbekko on Apr.19, 2009, under Robots
At my robot club’s meeting on the 18th, I threw around the idea of making a capture the flag game using the Lego NXT.
There was at least one person who liked the idea, Xander, and we agreed to make some plans (and robots ofcourse) for it. So yesterday I got cracking in Lego Digital Designer, and poked something together. And today I got out the Lego and started building. Thanks to LDD’s building guide, it was done rather quickly, although I spent 90% of my time reordering my Lego in order to find the components I need. It’s very small, and hopefully quite agile.
(continue reading…)
Ogame style corrections
by elbekko on Mar.12, 2009, under Uncategorized
Not too long ago I was asked to join in playing Ogame with a few classmates. But the first pageload was already a huge facepalm, a style so horrendous it nearly made me cry. Nearly. What it did make me do, is whip out Stylish and Firebug, and get cracking.
(continue reading…)
A love/hate relationship
by elbekko on Mar.02, 2009, under Rants
This could apply to many things, but today it shall apply to… PHP.
I know, I know, I’m not the first one to rant about this, and I most certainly won’t be the last.
PHP is pretty much the only language I know deeply, and I’ve been working with it for ages. About 6-7 years I think, I’m never sure. It’s an excellent tool for building websites, but it has a dark side. And this side is very dark indeed; it’s called simplicity. PHP is so simple every idiot with a keyboard can slap his hand onto it and find a functional piece of code. (continue reading…)
On functional programming
by elbekko on Feb.28, 2009, under Contemplations
I’ve been thinking a bit about the subject of functional programming lately, especially since it seems to be quite popular nowadays.
So naturally I look up guides and wiki pages and whatnot about the subject, research a language (I took Haskell because everyone says it’s awesome), etc. But every time I do so I just scratch my head and have a rather blank stare… It seems completely alien to me, and there’s hardly any aspect of it that I understand or even find remotely logical. (continue reading…)
A first contemplation
by elbekko on Feb.26, 2009, under Contemplations
Is contemplation really a good title for this category?
I suppose only time will tell…
First post!
by elbekko on Feb.26, 2009, under Rants
This is starting to look good, actually.
Well done Wordpress, you’ve certainly improved!