Running Karma tests on BrowserStack

27. mai 2014

Browserstack is a great setup and Karma is a great test runner for javascript, so the two should be a pretty good fit right? In practice it took me quite a lot of time to get the settings right, including discussions on the karma users group and some help from the good folks at BrowserStack. What follows are some brief notes on how I set this up to run with Grunt and on the Jenkins build server. Les resten av dette innlegget »

Grunt plugin for the Kit language

25. februar 2014

Just made a Grunt plugin to compile files written using the Kit templating language used in CodeKit. An NPM package for download is available.

Using the Node Package Manager (npm) with Cygwin

12. februar 2014

Case is that if you have tried installing NodeJS and tried running it under Cygwin you have gotten something like this:

/cygdrive/c/Dev/nodejs/npm: line 2: $'r': command not found
/cygdrive/c/Dev/nodejs/npm: line 4: $'r': command not found
/cygdrive/c/Dev/nodejs/npm: line 5: syntax error near unexpected token `$'inr''
'cygdrive/c/Dev/nodejs/npm: line 5: `case `uname` in

This is due to the Cygwin environment expecting Unix line feeds, whereas Windows (and the Node version compiled for it) are expecting Windows style line feeds. The trick here to using Node is simply to create an alias for it, making it run using the normal CMD shell. The fix is as easy as putthing this in your $HOME/.bashrc file:
alias npm="cmd /c npm"

Now you can npm install all you want!

Lage gyldige bankkontonummer

7. januar 2014

Når man utvikler en løsning som krever gyldige inputverdier for f.eks. bankkontonummer er det ofte et problem at man må ha testverdier som passerer en gyldighetssjekk. Les resten av dette innlegget »

Dealing with Quotas in WebSQL on iPhone

6. august 2013

This post details various scenarios related to the user being prompted for more storage by the browser. You as a developer must handle these to avoid data loss. Some solutions are presented.

In this post I specify Safari, but that is only because I have tested this solely on that platform. It probably applies to most mobile webkit browsers. Les resten av dette innlegget »

Non-interactive remote distribution upgrades of Ubuntu

6. juni 2013

This is mostly a note to myself on how to remotely upgrade a ubuntu server using ssh. Also available on AskUbuntu.
Les resten av dette innlegget »

Styling disabled inputs in iOS (WebKit)

21. mai 2013

Ever tried to style a disabled input in a WebKit browser? No matter what you do, it seems to refute your efforts. Changing opacity? Nope, not enough. Setting ‘-webkit-appearance: none;’? Nope, does nothing. Setting the color? Sort of, but not if you want it to be black.
It turns out there is a hidden (as in only being present in the so-called «shadow DOM») property called ‘-webkit-text-fill-color’, that in combination with setting the opacity to 1.0 controls the look of the text.

Info found in this French blog (with pictures and examples):

Ignoring changes to tracked files in Git

9. april 2013

This took me some time to figure out, as most results to googling «ignore committed file» sent me on a wild goose chase with most answers on StackOverflow really answering how to remove a previously committed file and ignore it.

My scenario is not like that. I have a build folder checked out along with other folders, and the files in this build folder is updated by build scripts when I develop. I am not interested in checking in these results, as these files change all the time, but I do want to keep them in the repo. Unfortunately, putting the file patterns in .gitignore does not work (which was what sent me googling in the first place).

It turns out you can modify your local index to ignore changes to tracked files in the repo by issuing a flag called «–assume-unchanged» when calling update-index. So, given that you have a file foo.exe that you want to keep unchanged on the remote repo, issue the following command

git update-index --assume-unchanged foo.exe

SNCF: France in a nutshell

10. mars 2013

To enable the SNCF to investigate your application please send a letter to:

Service relation clients SNCF
62 973 ARRAS Cedex 9

We hope this information will answer all your questions and that TGV-europe keeps your trust, wishing you a pleasant day.

Best Regards
Samuel TOPET

After forming a complaint letter, and managing to send it through the labyrinth of a web page SNCF keeps, this is what I got as a response. One thing is that SNCF is so hopelessly stuck in the past that they do not even accept e-mail inquiries on the service level. Another thing is that they would rather have you send snail mail into the black hole they call their service department than forward your complaint to the right person. Somehow I sense that even if I should be able to get hold of the right department (eventually), my complaint would never be read, because it is not in the right language (which would be French, of course). Les resten av dette innlegget »

Mass killing Oracle connections

4. februar 2013

If you have started to run out of connections due to some rogue program running wild, hanging your connections, you might need to kill a session or two. This is how to achieve this Les resten av dette innlegget »