Archive

Posts Tagged ‘tips’

Quick tips for better web sites

March 30th, 2009 Petros No comments

This one is very short, but I think these tips are essential and basic and unfortunately I see many many sites doing exactly the opposite and it is a pity:

  • Don’t use flash.
  • Don’t have some content as HTML and some as PDF or documents in other formats. You can transfer the content in HTML.
  • Don’t have music playing. Please don’t.
  • Don’t have animated banners or other moving parts. They distract the reader.
  • Use a bigger font and watch spacing.
  • Don’t have scrolling text. Please don’t.

There are many many more pitfalls, but I’ll leave you with these. If everyone used these tips, we would have a much better web presence.

Categories: tips Tags: ,

How to generate the MD5 checksum of a file

December 26th, 2008 Petros No comments

md5sum file.iso > file.iso.md5

How to create an ISO image

December 26th, 2008 Petros No comments

In order to turn a CD/DVD into an .iso one can:

sudo umount /dev/cdrom

dd if=/dev/cdrom of=file.iso bs=1024

In order to turn a folder into an .iso one can:

mkisofs -r -o file.iso /location_of_folder/

Related posts:

Restore an MSSQL backup to a different database name

December 24th, 2008 Petros 2 comments

I had a database backup and was trying to restore it but to a different database name than that from where it was backed up.
Read more…

Categories: tips Tags: , ,

Rails drop down lists

November 17th, 2008 Petros No comments

Sometimes you want to have a drop down list in your Rails application that contains both the items from a collection of model instances and some other items that are not coming from the collection.

Read more…

Categories: tips Tags: , ,

Selecting only today’s records

June 19th, 2007 Petros No comments

My database background has been mostly related to Oracle. These days, I am working as a freelancer with a company that heavily uses SQL Server. As a result, I miss knowing stuff out of my mind without having to search.

Today, I wanted to select from a table only those records that where created today. This table has a DateTime column that gets a default value from GetDate(). Here is how I did it:

select
*
from
myTable
where
DateDiff(DAY, MyDateColumn, GetDate()) = 0

Is there a better way?

Categories: tips Tags: ,