Before I forget, and some may find this useful too.
If you are deploying a few projects to the same server you will run into this, you need to use unique deploy keys to access each project unless you want to add the server’s public key to your account. For security reasons I did not want to do that.
First generate some deployment keys with
ssh-keygen. Here’s some more info on adding your deploy keys to your git repo
So I need to set up my ssh config file in
~/.ssh/config like so…
Let’s say your two project git urls look like this:
You can now clone with the correct keys using..
$> git clone project-a:anon/project-a.git
$> git clone project-b:anon/project-b.git
Alrighty, just a quick one.
I’ve been looking all over for something that quickly gives me the code for a UIColor when given a HEX colour.
I couldn’t find one so I whipped one up double quick.
I recently switched my Java versions from 1.5 to 1.6 and I’ve been hitting some issues with the java path.
I tried setting the environment variable
JAVA_HOME=/usr and that worked for some stuff but I still saw this error when running java.
Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java
I solved the problem by doing the following.
First I found out where java actually was with:
>ls -l' `which java`
/usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
I noticed a command called java_home in that same directory. Running that command yields the correct java home directory.
To correctly set the my JAVA_HOME environment variable in future, I added the following to my
Once you have done this you can restart your terminal window or run
>. ~/.profile to reload you profile into the current terminal session.
I had to create some tabbed navigation for a project at work recently. Not anything new really, lots of people implement it in lots of different ways. A colleague recommended a method demonstrated on SimpleBits for creating simplified css tabs however it uses background images to get the tab effect and I don’t like that.
I’d much prefer to use a pure CSS method that doesn’t involve editing an image if I want to make changes. So here I have it, a simple CSS only method of doing tabbed navigation. I’ve tested it in IE6, IE7, FF2, Opera 9 and Safari 3.1, all fine.
Just a quickie.
I ran into this problem before, then forgot about it after finding the solution. Then one of my colleagues ran into the same problem today which prompted me to post this.
If you’re rails app doesn’t use ActiveRecord you may find yourself scratching your head wondering why your build fails with ActiveRecord related problems. I obseverd this even though I had turned off ActiveRecord in my environment.rb. CruiseControl.rb still tried to run rake tasks like test:db:purge etc.
The quick and easy solution is to remove database.yml from your config directory. CruiseControl.rb should ignore any database related rake tasks then.
The winning feature for me though was the debugging facility. I found it to be extremely efficient, I’m sure I saved hours as it reliably showed me where the problems were in my code, allowing me to jump in at the offending line. When I’m developing for the web I can’t live without Firebug, when it comes to Dashboard widget development, Dashcode’s debugging abilities were a pleasure to use.
Deploying a widget couldn’t have been simpler. File > Deploy Widget, File > Deploy Widget to Dashboard. I did see one issue where I tried deploying the widget to my Dashboard at work and the widget simply wouldn’t initialise. All I saw was the default widget image. However I deployed the same code at home and the widget worked fine. I’ve installed that same widget in work now and I have no trouble with it now. I can’t figure out what the problem was. Perhaps all I needed was a restart.
Anyway, thats my Dashcode lowdown. I do recommend getting stuck in if you like that sort of thing.
I hated skipping back and forth to CruiseControl.rb at work to keep an eye on various builds so I’ve put this widget together to make life a little easier. The Builds Status Monitor Dashboard widget takes the build rss feed and displays the current build status. Does what it says on the tin.
Click here to download the Build Status Monitor. Just unzip and install, minimum requirements MacOS 10.4.x. This is my first Dashboard widget so some of the code is a bit untidy. I’ve tried to keep the look and feel clean. Please let me know if you have any problems or suggestions.
I kept getting responses saying that the the server only accepted POST requests. But I was using Jaxer.web.post.
So I scratched my head for a while. And then some.
Eventually I figured that the body of the post request was not being set. Then I discovered that Jaxer.Web.post defaults it's content type header to "application/x-www-form-urlencoded" which, as far as I know, passes the data in a querystring format and not in the post body. The simple fix was to change the content type to "text/xml" like so :
The call worked perfectly after that.
A note for those who are using ActiveResource.
I ran into a bit of a problem the other day, not with using the HttpMock class itself. Mocks work pretty well in ActiveResouce. The problem came about when I tried to not use HttpMock. I almost tore my hair out but eventually a simple solution came. Thanks to Jason for the shoulder surfing effect. Continue reading