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

Følg med

Få nye innlegg levert til din innboks.

Bli med 687 andre følgere