
Tuesday, 10. February 2009, 22:23:41
Opera, userjs, adblock
I wrote a small UserJS which is blocking all external javascripts. It worked very nicely and sped up ad intensive pages something fierce.
However, the script was blocking all scripts which did not originate from the page you were visiting. This mean that inline youtube videos, google maps and such nice addons didn't work. It didn't take long until I didn't use the script myself. Again I had to live with slow pages...
So I got tired of it again and modified the script. This time, I use a blacklist. Of course this means I have to update the blacklist, but at least this time I won't get broken sites unless I tell the script to do so.
The blacklist is currently very short and I've only used it for a few hours, but it seems to be working nicely so I'm releaseing it. Install the script, read the previous post if you don't know how, and if you'd like to help out you could gather more links to put in the blacklist.
Download
Friday, 4. April 2008, 22:11:40
Opera, backup, session
I have a bad habit of closing Opera when it has opened more than 50 tabs. Needless to say, Opera could take a while to open the next time, even if I just wanted to see a single page very quickly.
So I created a batch file to make a backup of autosave.win.
Create a "session backup.bat" file and put the following code in it:
for /f "tokens=1-5 delims=:" %%d in ("%time%") do copy "autosave.win" "autosaved %date% %%d-%%e-%%f.win"
Place the batch file in the sessions folder (Open the menu item Help->About Opera and open the path that says "Saved sessions") and create a shortcut to the start menu or your desktop. Whenever you run the batch file, "autosave.win" will be copied and have added a timestamp to it.
Now you can start opera with a blank session
Saturday, 2. February 2008, 14:15:42
google, Opera, create search

Google supports several cool features. One is searching a specific site or even a topdomain. By typing "sennheiser px 100 site:no" you can search for Sennheiser PX 100 only for norwegian sites. (And by the way,
Sennheiser PX 100 and MPX 100 are
awesome!) But what if you want a specific "search only norwegian domains" added to Opera? I'll show you how

. Go to
Google and create a search.

Expand details in the dialog and look at the search query. Servers will separate all the values by the "and" sign (&). For Google, the interesting part is the 'q' value. I've highlighted the interesting part in the image.
When you select an input and choose "Create Search", Opera does some light processing and finds which part you want to be variable. For the variable, Opera puts "%s" and will insert what you want to search for where the "%s" is. Everything else is left alone, which means that you can insert more text if you want! So instead of it saying "q=%s", you can change it to say "q=%s site:no". Give the new search a keyword, such as "gn" (for google norway) and click "Ok". Now you're done, and the newly created search will always add " site:no" to any search query you're making!
Thursday, 22. November 2007, 18:28:05
sms, phonebook, phone, Opera
...
Some crazy people are advertising that I can look up names and numbers for peoples phone numbers by sending an SMS message. It only cost 50 cents (3,- NOK), hurray for them! Or ah, em... it costs 50 cents for every suggestion they send you. Which is often
wrong so it usually cost a dollar.
Wouldn't it be sooo great to have an entire phonebook on your cellphone? Just enter the name, phone number or address and you can view an entire list of suggestions. It'd be fantastic if it even was cheap! Let's say 1 cent, or therearound! Man, this sounds like a fantastic deal! Serve it up, dude!
I will comply thy wishes.
Install
Opera Mini and surf the net. The norwegian phonebook is available online at
Telefonkatalogen.no. Just use whichever is available where you live.
If you want to create a search engine, edit the search field and go to options. There is a choice that says "Create Search...". Congratulations, the service is now easily available on the front page of Opera Mini.
Tuesday, 20. November 2007, 23:00:00
hospital, Opera, netcom, 3G
...
I was in a hospital a while back and decided I wanted to order a limitless 3G internet connection. I heard Ice offered one for an acceptable price, but since I was locked to the hospital bed, I had to visit their page using Opera Mini. It looked pretty much like this:
Yes, thank you... 
However, my current employer kindly lent me a Netcom subscription to use for free. Too bad for Ice, lucky me 

Wednesday, 31. January 2007, 13:03:16
inkscape, lecture, Opera, notes
...
I'm at school right now writing this. I had
Inkscape open, so I figured I'd try writing my lecture notes there instead. I'm a slow handwriter, but a fast typer so it works out
very well for me! Try it out.
As a bonus, Opera supports SVG so you can open the documents in your favorite browser as well
Friday, 26. January 2007, 23:43:34
browser, nintendo, google video, Opera
...
I promise I'll stop the Wii puns eventually, I'm just having too much fun right now ;-)
If you have the Wii, you should definately check out Google Video and YouTube with the Opera browser. I'm a documentary guy, I love them and there are a LOT of free BBC documentaries on Google Video. Go check it out and stream video directly to your own TV using Opera! :-)

Monday, 10. July 2006, 00:17:53
ecmascript, Opera, FireFox
Laziness is the mother of all inventions... I created a function in javascript which'd help me create DOM nodes quickly, here's the source:
/**
* Shortcut for creating a new html tag using JSON notation.
* @param JSON The tag using JSON notation. The first value of the object
* is the tag name, second child is array of parameters and third child
* is array of children elements. If the first parameter is a string, the
* node is assumed to be a text node and has no further children.
*/
function quickTag(JSON){
var elem;
if(typeof(JSON) == 'string'){
elem = document.createTextNode(JSON);
} else {
// Create the element itself
elem = document.createElement(JSON[0]);
// Add attributes
if(JSON[1])
for( attr in JSON[1] ){
elem.setAttribute(attr, JSON[1][attr]);
}
// Add child elements
if(JSON[2])
for(var j=0;j<JSON[2].length;j++){
elem.appendChild( quickTag(JSON[2][j]) );
}
}
return elem;
}
Here's a quick example of the usage, hopefully you'll see what the syntax is fairly quickly. Note that the parameter uses JSON syntax, you might want to quickly read up on that if you're not too familiar with it. It's very simple and would only take a few minutes.
var p = quickTag(['p',{'class':'test'},["This is a ",['em',,'test']," node."]]);
document.body.appendChild( p );
The first item in the array is the tag name, the second is attributes and their values given as an object and the third parameter is child elements, which means that you can start all over again with a new array, or just pass a string to use as a text node. The above example would produce the output equivalent to
<p class="test">This is a <em>test</em> node.</p>
It has been tested and works with Opera 9 and Firefox 1.5.0.4, I don't have other browsers to test with right here right now, but I suspect Internet Explorer will throw a fit if trying to set class by setAttribute. It's always a hoot with that old thing...

Friday, 26. May 2006, 16:24:37
Opera, school, job, summer internship
A lot of stuff happening this year. I won't disclose everything, but the most recent thing is that I'm moving to Oslo in a couple of weeks for my summer internship at a company we all know and love

before starting my masters degree in september.
Tuesday, 31. January 2006, 18:20:21
Opera Mini, webapplications, Classfronter, Opera
...
I'm currently finishing my bachelor's degree. The school I attend to provide their students with a webapplication called Classfronter. The goal of the tool is that students and teachers communicate among themselves, sharing their experience and help each other out. The application provides "rooms" for each course where students may post on the forum, share documents and chat in real time.
The problem is that many "rooms" are almost as dead as the Sahara desert after a nuclear strike. One reason is of course the chicken and egg problem. Noone use it because noone use it. Another reason, and a far greater one in my opinion, is that it's not a pleasant experience using it!
The application is painfully slow, hard to navigate and during the earlier years it was only fairly usable in Internet Explorer. I run my own website,
hybelmat.com, aimed primarily at students. It's a site where users may send in simple food recipies and search the database for something to eat. My stats shows that norwegian students prefer Opera and Firefox equally well to Internet Explorer. Actually
less than 50% of my visitors use Internet Explorer.
My point with all of this is that the tool we are presented with fails in three important aspects: speed, usability and compatibility. When the tool you provide is so hard to use that it's a nuisance for its users, you've got a huge problem on your hands. When the server is so bogged down with work that it spends 12 seconds generating a page and the users have to switch pages 3 times in order to get to where they want, that is
not user friendly!
During my spare time, I'm working on my own webapplication complete with fancy Ajax, context menus, ECMAScript and dangling shiny things to dazzle the eyes. Well... except that last one

. It started out as a simple tool for my brother and I, but is currently escalating to a project with potential for future profit.
One of the criterias of my webapplication is that it should be accessible from a cellphone provided the user agent doesn't choke on XHTML. Among other things, I
cannot rely on ecmascript for critical functionality or even a display size of more than 128 pixels. Considering this, Opera Mini really came as a blessing for me.
Currently, on broadband, it takes me less than a second to refresh the page, and I would rather sacrifice a semi-nice feature before I sacrificed that.