Blog posts

Oct 22

A generic delegation template in Objective-C

Written: Oct 22nd 2010, 23:44

I don’t use this pattern every day, but when I do need it, I always have to look into earlier project trying to find what I need to apply to my current objective-c prosject in order to do this.

Not anymore because I made this template:

Permalink for A generic delegation template in Objective-C
Sep 10

Default styling of sections headers in UITableView Grouped

Written: Sep 10th 2010, 21:31
Style section header uitableview rounded

I needed to add an button to the right of the section header in an UITableView (grouped style), and I wanted to keep the default style of the headers. The result was good:

[image:12 size:full lightbox:true]

Permalink for Default styling of sections headers in UITableView Grouped
Aug 14

My first iPhone and iPad apps

Written: Aug 14th 2010, 20:59

After some years away from any Cocoa and Objective-C development (my last build of Worktimer was in 2007) I started looking into the iOS development in November last year. Sadly I was busy writing another web application during the winter, but in this spring and summer I finally was able to submit some apps to AppStore.

Bike Meter was my first app, and its a simple utility to calculate your training zones in cycling. In the other app Surdeig I was trying out the “Universal Application” targeting both iPhone and iPads in a single bundle.

The workflow with iOS apps is nice and pretty stright forward, compared to web-apps where the development process involving everything from server-side, databases, php and frontend stuff like HTHML, CSS and JS. Not to mention the deployment..

Permalink for My first iPhone and iPad apps
Jun 25

eZ Publish summer conference 2010 in Berlin

Written: Jun 25th 2010, 12:36
Ez conference berlin keynote

In Netmaking where I work, we work with an Open Source CMS/framework named eZ Publish which has community and business partners in many parts of the world. Every year these partners gather on eZ Summer Conferance to learn new things about the framework, meet each other and to see who gets the glorious eZ Awards. This year it all happened in Berlin.

Permalink for eZ Publish summer conference 2010 in Berlin
Dec 07

JQuery Live and draggable event with elements created on the fly

Written: Dec 7th 2009, 22:20

Draggable and Droppable in jQuery UI is very handy, but if you are adding new draggable items to your DOM tree on the fly, they will not work since the events is binded when the document is created. jQuery Live comes to rescue, but how do you use it jQuery.live?

The answer is to add the draggable behavior when the user first mouse over the item. To avoid binding the behavior twice we a init check:

Permalink for JQuery Live and draggable event with elements created on the fly
Sep 13

Back in the Cocoa business

Written: Sep 13th 2009, 22:30
Hello Polly - screenshot IPhone app

Some years have gone since I wrote the last version of Worktimer, but know I am back in the Mac development business again, working with Objective-C and the Cocoa and UIKit framework.

Permalink for Back in the Cocoa business
Aug 24

Embed images anywhere in CakePHP

Written: Aug 24th 2009, 22:38

Inspired by the Ez publish’s way to embed images inside rich text fields, this CakePHP code takes the same principle in the true CakePHP way, with two helpers to extend David Persson’s Media Plugin.

Permalink for Embed images anywhere in CakePHP
Aug 09

Getting started with OpenID and PHP

Written: Aug 9th 2009, 14:14
Open ID

Growing number of web applications and multiple numbers of user accounts can be a headache for the end user. Luckily the big players have started to agree on standards that makes the personal information flow between these services.

Permalink for Getting started with OpenID and PHP
Jul 26

Basic sorting with HABTM relation in CakePHP

Written: Jul 26th 2009, 23:23

After struggling with doing a basic filter pattern on my new Portfolio section, I found the clues I needed in this tutorial. Here is the basic function.


function index($cat = null) {

if($cat == null) { // If no category chosen, just use the basic paginate function $portfolios = $this->paginate(); } else { // Set basic params with conditions form $this->paginate $params = array( ‘contain’ => false, ‘fields’ => array(‘DISTINCT (Portfolio.id) as id’), ‘conditions’ => $this->paginate[‘conditions’], ‘joins’ => array() );

// Add the search on the habtm relations table $joins1 = array( ‘table’ => $this->Portfolio->tablePrefix.‘portfolios_categories_portfolios’, ‘alias’ => ‘CategoriesPortfolio’, ‘type’ => ‘inner’, ‘foreignKey’ => false, ‘conditions’=> array(‘CategoriesPortfolio.portfolio_id = Portfolio.id’) ); $joins2 = array( ‘table’ => $this->Portfolio->tablePrefix.‘portfolios_categories’, ‘alias’ => ‘Category’, ‘type’ => ‘inner’, ‘foreignKey’ => false, ‘conditions’=> array( ‘Category.id = CategoriesPortfolio.category_id’, ‘Category.slug’ => $cat ) ); array_push($params[‘joins’], $joins1); array_push($params[‘joins’], $joins2);

$tmp = array(); foreach ($this->Portfolio->find(‘all’, $params) as $row) { array_push($tmp, $row[‘Portfolio’][‘id’]); } // Final paginate query with the Portfolio ID’s as ‘scope’ $portfolios = $this->paginate(null, array(‘Portfolio.id’ => $tmp)); } // Send var to the view $this->set(‘portfolios’, $portfolios);
}

Permalink for Basic sorting with HABTM relation in CakePHP
Jul 22

Gersh.no is updated

Written: Jul 22nd 2009, 22:33
My new homepage

Finally I managed to get my new homepage ready. I have been working on building the logic I needed since spring, but with the ironman season and my involvement of the new homepage for Norseman Xtreme triathlon I got a little delay.

Permalink for Gersh.no is updated

Page 1 of 4

<< previous
| 1 | 2 | 3 | 4 | next >>