Twitter Updates

Monday, 31 August 2009

Recursively Search for file with text

Using the find command below in Unix/Linux/OS X terminal you can search from a given path recursively looking in all files for text that matches 'find this text'.

$ find ./searchPath/ | xargs -I {} grep -iHn 'find this text' {}

or

$ grep -R -iHn 'find this text' *

grep Options:
-i makes it incase sensitive
-H outputs the filename before the matching line.
-n outputs the matching line number before the matching line.
-R Recursive from current location

[UPDATE 1]
Ignore Subversion folders
$ find ./ -not -name *'.svn'* | xargs -I {} grep -iHn 'find this text' {}

Saturday, 22 August 2009

Directory to Podcast

Just finished (largelgy based on an example) a small simple php script to take files from a folder and turn into a podcast feed. Directory to Podcast PHP script.

This may be useful if you want to setup a cron script/server application on a home server to download your latest podcast shows. Using this script you can then reserve the downloaded files as a local podcast feed.

This is useful at home as your server can download at none bandwidth critical times, when your isp applies limits or around 9pm when the internet is going really slow. When your main machine is switched on the podcasts will download very quickly over your local network.

Tuesday, 11 August 2009

require_gem is now gem

I have been working through the Ruby on Rails 2 Create a blog in 15 minutes and it only took me a few hours, but was much quicker and gave me a better understanding of rails than finishing the book on rails I was reading.

After this I had wanted to add tags like most blogs and photo site now have. So I am currently working through a act_as_taggable tutorial.

The main point I want to make is that at some point the require_gem command has been replaced with gem.

incorrect: require_gem 'acts_as_taggable'
Correct: gem 'acts_as_taggable'

Monday, 3 August 2009

Easy Create DMG Files with background images

I just discovered this [1] helper application for creating DMG file for distributing your Mac Applications.

[1] iDMG http://www.nscoding.co.uk/

Easily define Icons and Background images.

Changing Icons for Shoes Rasins Programs

How to change Icons for compiled shoes applications. There is no configuration options in shoes for this but with some free tools you can change the included icons.

For Mac OS X dmg file if you open the .app as folder by right-click Show Package Contents, through an alternative file browser or go into it in the terminal and replace Shoes.icns and /Resources/Shoes.icns with your Mac Icon .icns of choice. My guide on creating these and replacing them in a xCode java application.

For windows you can use a free tool called IcoFX (but license says you are never allowed to charge for an application which include icons created with this tool) to create Windows icons .icn. Using the IcoFX resource editor you can then change the included icon for a .exe.

Friday, 31 July 2009

Word Visio Stop capitilisation

Finally got around to switching off first letter capitalisation (capitalization) For word 2007 and visio 2003.

The options are in the AutoCorrect Menus if you know how to find them. Microsofts instructions for Visio are here:
http://support.microsoft.com/kb/290586

Basically, Visio -> Tools -> AutoCorrect Options, DeSelect "Capitalize first letter of sentences"

StopVisio2003ManglingYourText

For Word 2007 I had to make the mistake then select the smart tag to get to the Auto correct options. but then the options were very similar to Visio.

StopWord2007ManglingYourText

Thursday, 30 July 2009

Create Icons *.icns for OS X

To create icons for your OS X Applications, first create a master 512pixel x 512pxel master image. create smaller versions if required ie if you want the smaller logos to be different.

The size options you can create for are:
512x512
256x256
128x128
32x32
16x16

Once you have your images, my logo is simple so I only created one 512 master copy, from photoshop save as a tiff with transparency and Image compression:no compression, Layer Compression:discard all layers and save a copy.

Then open (you need the developer tools xcode):
/Developer/Applications/Utilities/Icon Composer.app

Then drag you 512x512 tiff on to the largest square I then let it auto scale this image for the smaller options. Then just go File Save As. and you *.icns file is created.

A very helpful tutorial was.
http://tutorialdog.com/how-to-create-icons-for-mac-os-x/

A generic guide to integrating the icns into your mac app is:
http://stackoverflow.com/questions/646671/how-do-i-set-the-icon-for-my-applications-mac-os-x-app-bundle

Because I am working on a project setup by xCode I can just replace the file in:
ProjectRoot/resources_macosx/projectName.icns