-
Recent Posts
- Using a Zend view helper inside a partial
- Problems connecting to unix:///var/mysql/mysql.sock
- Using rails and respond_to to include nested data
- Handle different environments with PHP
- MySQL 5.5, Mac OS X and startup item security error
- Rails plugin development using WebMock
- Read more, continue reading, and how to easily fix it using WP
- Windows clients with CUPS and Samba
- Making a Cafe Latté without a “do it all” machine
- Using form_tag and collection_select with Rails3
Tags
ajax apache api authentication cakephp coffee configuration cups cxf daily365 design firebug gedit hibernate history java javascript jcs job language linux mac mvc mysql non-tech opensource paginate php plugin projects prototypejs quick tip rails ror ruby samba smashingmag snapopen spring terminal test twitter usability wordpress wpml
Using a Zend view helper inside a partial
When rendering a page using one or more partials, I often need to call a helper to do some extra stuff for me. One caveat I found was, that the view variables was not available in my helper. After some …
Continue reading “Using a Zend view helper inside a partial” »
Problems connecting to unix:///var/mysql/mysql.sock
In this post I’ll go through fixing the problems with PHP and connecting to your local mysql install, using “localhost”.
The problems began a while back, with lots of errors in my apache error log saying:
[error] [client ::1] PHP Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in …
Continue reading “Problems connecting to unix:///var/mysql/mysql.sock” »
Tagged mac, mysql, osx, php
3 Comments
Using rails and respond_to to include nested data
I want to display data from a nested table in my XML output using respond_to. I browsed the docs a bit and it seems :include is the way to go. However I had some problems getting this to work properly.
I have two models (customer and user) that are linked together. When I fetch the data for a single user, I want my xml output to include the customer data.
Continue reading “Using rails and respond_to to include nested data” »
Tagged rails, rails3, respond_to, rest
Leave a comment
Handle different environments with PHP
Being both a Rails and PHP developer, I’m often lacking a few things when I’m switching from Rails to PHP.
One of the things I miss the most, is the different environments that Rails has, which makes testing, developing, staging and production environments easy.
However, I found a way to do this in PHP as well, without using frameworks like Zend, CakePHP etc.
Continue reading “Handle different environments with PHP” »
Tagged apache, php, test, unittest
Leave a comment
MySQL 5.5, Mac OS X and startup item security error
A few days ago I got a shiny new macbook at work and I needed to install my dev environment again.
I came across a few problems when installing the new MySQL community server package though, which had been upgraded to 5.5 instead of the 5.1 release I had on my old Mac.
Continue reading “MySQL 5.5, Mac OS X and startup item security error” »
Tagged mac, mysql
2 Comments
Rails plugin development using WebMock
I had a few problems getting WebMock working with my rails 3 setup.
When I used webmock in my rails 3 app, the tests ran and all was nice.
But when I wanted to create a plugin using the exact same code as I just tested inside my rails app, I went into some problems.
To start, I created a new plugin using
rails generate plugin myclient
The files were generated and all seemed fine.
Continue reading “Rails plugin development using WebMock” »
Tagged plugin, rails, test, webmock
Leave a comment
Read more, continue reading, and how to easily fix it using WP
Yesterday I updated my grayish blog theme to a new blue and white theme, with more whitespace and less constraints.
While the new theme is isn’t perfect, I shined my website up a bit and it seems nice.
However, scrolling through my twitter list today, I read a blog post by Karan over at mardahl.dk, where she discusses the usage of “Read more” and “Click here” links on webpages. (Direct link to the blog post here).
This made me investigate what my own website was doing, and while the wording was a bit different, I had the same usability problem she describes in the blog post (you should really read it). People tend to overlook the wording, since lots and lots of advertisements use it. So when I use excerpts on my blog front page, and use the wording “Continue reading”, I’m actually scaring the user off, because my message will be misunderstood.
Continue reading “Read more, continue reading, and how to easily fix it using WP” »
Tagged php, usability, wordpress
2 Comments
Windows clients with CUPS and Samba
After starting my new job, I battled a bit with getting a printer/scanner working on the local network. The fileserver was a mess as well… a real mess. My boss gave me permission to install linux on it (since I …
Continue reading “Windows clients with CUPS and Samba” »
Tagged cups, linux, samba
Leave a comment
Making a Cafe Latté without a “do it all” machine
As you properly know, if you know me in real life, “I love coffee”.
(I also like tea though, but that’s a whole different story.)
Today when I wanted to make me a Latté, I thought to myself:
Why not tell other people how it’s done, so they also can enjoy a Cafe Latté without buying an expensive espresso machine.
Continue reading “Making a Cafe Latté without a “do it all” machine” »
Tagged coffee, non-tech
Leave a comment
Using form_tag and collection_select with Rails3
After being away from rails for a while, i’m coming back en version 3 to check it all out again.
I had a problem with how to create a simple select, using the FormHelper.
I had two models, a user and a customer. They are defined as follows:
class User < ActiveRecord::Base belongs_to :customer end
class Customer < ActiveRecord::Base has_many :users end
Continue reading “Using form_tag and collection_select with Rails3″ »
Tagged rails, ror
Leave a comment