Hey there,
It is a good idea, and yes google will consider it duplicate content if you have both sites setup so what you need to do is first ensure that your webserver/hosting company is setup to serve both the .co.uk and .com domains and then you can use the .htaccess rules below to take care of the redirect from the .com to the .co.uk address so the .co.uk solely receives the ranking credit for your content.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^code-digital\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.code-digital.co.uk/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^code-digital\.com$ [NC]
RewriteRule ^(.*)$ http://www.code-digital.co.uk/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.code-digital\.com$ [NC]
RewriteRule ^(.*)$ http://www.code-digital.co.uk/$1 [R=301,L]
The first rule redirects code-digital.co.uk to WWW.code-digital.co.uk
Second Rule redirects code-digital.com to WWW.code-digital.co.uk
Third rule redirects www.code-digital.COM to www.code-digital.CO.UK
Rgds,
Dave