Blog posts

Apr 09

CSS Naked Day

Written: Apr 9th 2008, 13:11

This is the third year of CSS Naked Day, and the first time I joint it. So today my stylesheets are turned off.

CSS Naked Day

Permalink for CSS Naked Day
Mar 08

Easy Excel export from PHP

Written: Mar 8th 2008, 09:10

Here is a simple way of exporting data to excel documents. With utf-8 encoding you can use special nordic letters like ø, æ and å.

<span class="Apple-style-span" style="font-family: Arial; line-height: 14px; white-space: normal;"><div>&lt;?php</div><div>header("Expires: 0");</div><div>header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");</div><div>header("Cache-Control: no-store, no-cache, must-revalidate");</div><div>header("Cache-Control: post-check=0, pre-check=0", false);</div><div>header("Pragma: no-cache");</div><div>header("Content-type: application/vnd.ms-excel;charset:UTF-8");</div><div>header("Content-Disposition: attachment; filename=filename.xls"); </div><div>print "\n"; // Add a line, unless excel error..</div><div>?&gt;</div><div>&lt;table border="1"&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>&lt;tr&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>&lt;th&gt;header 1&lt;/th&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>&lt;th&gt;header 2&lt;/th&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>&lt;/tr&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>&lt;tr&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>&lt;td&gt;data 1&lt;/td&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>&lt;td&gt;data 2 - nordic letters æ, æ, å&lt;/td&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>&lt;/tr&gt;</div><div>&lt;/table&gt;</div></span>

Its really all about the headers. For the body of the document, Excel is not very choosy, we just hand it a regular HTML table, and thats it. 

Permalink for Easy Excel export from PHP
Jan 13

Zoho Creator - webapps for your mom

Written: Jan 13th 2008, 18:04

 Zoho Creator lets you export data in many formats

We all got these lists that we keep. Maybe its in a Excel sheet or in a database. Myself I have two: one for my workouts and one for novels I have read. The first is in a database, and the latter is in a Google spreadsheet. Until now it has been a hassle updating them.

But now I have found the perfect tool for these small personal lists: Zoho Creator!

Zoho is a suite of online applications (they compete with Google Docs), and of their tools is Creator, a online web-app “web-app” maker. You create Forms where you input data and Views where you view and filter data. It also supports relationship (they call it Lookup fields) that lets you link between different databases.

Zoho Creator has also its own scripting language named Delugescript that you can use, is support exporting in a variety of formats, and embedding of forms in extern sites. Go check it of on creator.zoho.com

Permalink for Zoho Creator - webapps for your mom
Dec 14

Add your CakePHP project to Google Code

Written: Dec 14th 2007, 20:04

Want to use Subversion with your CakePHP project. This is how you do it:

For developing I got a local copy of my project. Unless you got Subversion installed on your webserver, you have to start importing the local one. Mine in located here:

/Users/gersh/Sites/cakephp/APPS/gersh

  1. First you have to move your config file outside of your project tree since your project will have public access on Google Code. To do this you simply copy database.php out and rather include it by putting these lines inside your app/config/database.php file:
    (?php<br>include dirname(__FILE__) . '/../../database.php.inc';
  2. Google Code has already created a regualar Subversion structure:
    /branches (empty)
    /tags (empty)
    /trunk (content of cakephp app folder goes here)
  3. To import your project, open Terminal.app, and from inside of your /app folder run this command:
    svn import  https://gersh-no.googlecode.com/svn/trunk <br>  --username username -m "Initial import"
  4. Now that your project is hosted at Google Code, you can use SvnX – a mac SVN client to checkout your project. Note that it is a bug in SvnX with importing from https protocol, so you have to do a svn list command. Just accept it permantly
    svn list https://projectname.googlecode.com/svn/trunk/
  5. You might need to reset the permissions for your app/tmp directory in order to make the cache to work:
    chmod -R 777 tmp
Okay, so now know how to share you project with the world!

Permalink for Add your CakePHP project to Google Code
Dec 03

Wordpress as CMS, custom database and $_Get variables

Written: Dec 3rd 2007, 20:58


Screenshot Ironman.no - made with Wordpress


The great blog platform Wordpress does more than serve blogs. Lately I used it, and it’s build in classes for a new norwegian sports site: Ironman.no – hosting all norwegian triathlon results throughout history. Among the things we did there, was serving data from custom databases and ability to search and browse this data.

Permalink for Wordpress as CMS, custom database and $_Get variables
Nov 25

Tutorial: Convert RSS to JSON with PHP and import the JSON into Flash with AS 2

Written: Nov 25th 2007, 21:48

Recently we had a customer at the office who wanted a news feed from a related site displayed on their homepage. As a design element we wanted to extract the first image in the description part of each news item in the feed and display it in a separate container inside the flash file.

Permalink for Tutorial: Convert RSS to JSON with PHP and import the JSON into Flash with AS 2
Nov 05

Leopard Core Data bug affect Worktimer

Written: Nov 5th 2007, 22:01

Last weekend I got a mail from a Worktimer user, concerning a possible bug running Worktimer in the new Mac OS X Leopard. It happens when you open a document, and save it without making any changes. When you reopen the document all your data is lost.

Have been working day and night the last days trying to find the cause, unfortunately without any success. Now it turns out its in Leopard the bug is located, and it has to do with their Core Data framework (that Worktimer use).

Lets stay tune for Software Update from Apple, and meanwhile don’t double-save your document.

Read more about the bug here

Permalink for Leopard Core Data bug affect Worktimer
Oct 31

9 lives but no iLife [Review of Leopard]

Written: Oct 31st 2007, 21:23

Mail.app in Leopard - the new stationary templates features

Just had my mac at home upgraded to the last version of Mac OS X: Leopard. After the 1,5 hour long install session, I was pretty excited when the apple logo reappeared after the last restart. It was way past my go-to-bed time (11 pm), but knowing that I would never get any sleep before I at least had the chance to stroke the new kitten.

Permalink for 9 lives but no iLife [Review of Leopard]
Sep 16

Gersh.no redesign

Written: Sep 16th 2007, 00:00

Screenshot of backend: Showing ajax based autocomplete suggesting allready used tags

 

This week I finally had the change to release my new redesigned blog. Have been been working with a enhanged backend for some time, but at the end I decided to redesign the frontend to. I was looking for something more simple, and at last to move away from my old Wordpress template.

Permalink for Gersh.no redesign
May 17

Implementing ping with phpxmlrpc in CakePHP

Written: May 17th 2007, 21:56

On of the latest things on my to-do list has been implementing a ping function in my CakePHP blog. I was hoping to find some code to copy and paste directly from CakePHP Google Group, but it seems that none has done it yet, and I ended up doing it myself.

Permalink for Implementing ping with phpxmlrpc in CakePHP

Page 3 of 4

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