Hermes allows google to index the parcel tracking?

While waiting for my iPhone 4s today I received a message about my tracking status and so I was checking the Hermes tracking page. When it told me the status of my packet I was curious when it will arrive so I decided to google for that, and was kind of surprised what showed up…

why_hermes_one.png

Oh well so It seems like google is indexing the Hermes tracking system, you can even click it and view the links for another persons’ packages….

why_hermes_two.png

It’s actually not a big deal, I’m just confused why Hermes would allow google to index this. It’s not really useful for anybody and even though it is publicly available information feels kind of weird to have another persons delivery as the first google result.

Use a different single template per category in WordPress

In a recent WordPress project the posts are displayed on different pages differentiated by category instead of type. In this case different designs are loaded based on categories as well, since the theme needs to match the design of the current page. WordPress does not provide a build in mechanism to do this, it only does for post types.

The solution is rather simple, use the single.php file to first check the category and load the matching template. Since in my development environment the categories might match to different IDs than in the deployed instance it’s more practical to match by name instead of ID. Importantly first the category ID needs identification by name, and is stored to load the matching template, since matching via the $post variable can only be achieved via ID not name or slug. For anybody interested I put example code up on github.

https://gist.github.com/1272148.js

Using shell script to deploy automatically

Automatic deployment is essential for any project which is supposed to be worked on and run continuously. Until recently I was using capistrano to do this, but since development seems to have kind of stalled recently I decided to look around for an alternative, which I found in deploy a shell script by TJ Holowaychuk. To check it out I am currently using it to deploy a small Codeignitor project I am working on the side and use to try out new stuff. It really is easy to use and quite flexible due to allowing pre and post deploy hooks as well as automatic tests to check if the deployed version is working, and rollback if it is not. The use with CI is quite simple the only thing todo is to make sure that the right permissions are set which can be easily handled by a post-deploy shell script.

Usage

On the server it creates a simple directory structure with

ENV_ROOT/current
ENV_ROOT/shared
ENV_ROOT/source

in my case for both staging and production. This is done via an initial

deploy [ENV] setup

all following deploys are done by issueing

deploy [ENV]

deploy shell script

Modifications

For some reason some commands were not working for me in Bash ond my Mac so I had to do some small ajustments, I guess it is due to the version of bash I am using being not current maybe. You can find them in my fork

Integrate doctrine 2 in zend 1.11

Just some quick notes on zend and doctrine. Right now I am in the process to rewrite a web application which is based on zend and doctrine, and in the process is ported over to the latest versions of both. Since doctrine does not integrate completely seamless in zend, yet, there is some glue code to be included to make it work. While looking for the right way to do it I came across a video which explains everything nicely. The code which holds everything together is Bisna which is available as part of NOLASnowball. To make it work simply check out the
“doctrine2-managed-crud” branch


$ git clone https://github.com/ralphschindler/NOLASnowball
$ git co doctrine2-managed-crud

and copy Bisna, Symphony, Doctrine from the library folder to your project, also the application.ini file needs to be adjusted to. For a more extensive explanation check out the video mentioned above.

Scaling images in Titanium (JPGCompressor Update)

Since I wrote the initial version of jpgcompressor for titanium, I needed scaling of images as well. The only way to do this in titanium is to overlay an Ti.UI.imageView and grab the picture out. This is neither fast nor clean, and it seems to reduce the quality for some weird reason. Since I figured I’m not the only one facing this problem, I added the feature to jpgcompressor via the scale function. Documentation is available in the example. If there are any problems please let me know, the code is build against the new 1.7.2 version of Titanium but should work with previous versions as well by adjusting the manifest as well as titanium.xconfig.

JPGCompressor for Titanium

Since Titanium is not exporting the UIImageJPEGRepresentation function present in the iPhone SDK, there finally was a reason for me to write a little Titanium Module to do that myself. It is quite easy just define the desired size and pass the picture as a TiBlob, it is compressed as close as possible to the desired size and returned. Example usage is present in the app.js used for testing in the Project.

Enjoy.

IPv6 Appengine and iPhone Simulator

Since yesterday appengine is also available via IPv6, but the iPhone Simulator does not handle IPv6 all that well. So if there is IPv6 available on the Mac running the simulator, and the app connects to appengine requests seem to fail at random right now, not returning any data. In my case I had tunnelbroker providing me with IPv6 and request from the Simulator were not getting through from time to time, so for now I decided to shut down the tunnel. Just a quick info for everybody who might face a similar, random seeming request fail.

Todo.txt in Cygwin: Remember there is a windows sort!

Setting up todo.txt in cygwin I stumbled across the script not working due to the following error:

$ todo.sh ls
Input file specified two times.

--
TODO: 0 of 66 tasks shown

After some search it came clear that the problem was that todo.sh tried to use the windows internal sort command for sorting instead of the cygwin one. This can be solved by setting TODOTXT_SORT_COMMAND in the config file to “/bin/sort” instead of just “sort”. Now everything works fine.