grunt-codekit now supports js concatenation

9. juni 2014

A final missing piece was added to the plugin for Grunt I made a few months ago: javascript concatenation using CodeKit’s prepend and append directives. Now you might think that this is a useless feature, as we have had the grunt-contrib-concat plugin for ages, but to use that you would have to change your existing project for it to work. Adding support for handling inline build comments like these

// @codekit-prepend "some-file.js"
// @codekit-append "some-other-file.js"

makes it possible to keep using CodeKit&tm; and Grunt at the same time. That means non-Mac developers can still contribute to you project, you don’t have to change any code, and you can keep the nitty-gritty of various builds in Grunt, and just use CodeKit like you normally do. Which was kinda the point for me, since CodeKit < 2 sucked at sharing config between team members (build file changed all the time). Les resten av dette innlegget »


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): http://blog.iamvdo.me/post/42510603205/styler-les-input-inactifs-disabled-sur-ios-iphone


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
France

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 »