Thursday, August 19, 2010

Convert human readable time format to Unix Epoch format and Convert Unix Epoch time format to human readable format in ruby

In one of projects i was doing ,I was required to convert human readable datetime format to UNIX epoch format and than back to human readable format from Unix epoch
format
SO here is the code for that

Human readable time format to Unix Epoch format
up_date = DateTime.strptime("December 01, 2009", "%b %d, %Y")
up_date = up_date.to_i

and thats it
Unix Epoch time format to human readable format
Time.at(up_date).strftime "%B %d %Y"

and now you have human readable datetime format

Sunday, August 15, 2010

JOKES

Teacher to Pathan: Jis ko sunai na de use English main kya kahenge?

PATHAN: Jo marzi keh do Us ko konsa sunai dega

______________________________________________________________________
Gharaylo Totykay

1- agar ap ko kutta kaat ly to ap usay kaat len. Hisab barabar

2- Doodh phat jaye to safaid dhage sy si len, kisi ko pata nahe chalega

3- agar ap ka qad chota hy to 3,4 martaba phansi len agr bach gaye to bohat faida hoga

4- agar apke baal girte hen to tind kerwa len phir kbhi nahi girengy.

______________________________________________________________________
Zindagi k 7 Ehem kaam

1- Studies

2- Games

3- Entertainment

4- Love

...............

5-

6-

7-

4th kam k bad banda ksi kam ka nahi rehta
______________________________________________________________________

Sardar: meri biwi itna mzaq krti ha k kya bataon

Dost: kaisy

Sardar: Kal men ghar gya uski ankhoon pr hath rkh k bola "mein kon?" to wo mzaq mai boli "Doodh wala"

______________________________________________________________________

Marasiyon ka Baap mrnay wala tha.Us ka gird sab khamosh bethay thay. Mahool sogwaar tha.
aik marasi bola: Welay bethay aan, jidon tk a bab merda nai dolki waja lo

______________________________________________________________________

Gama to Pappu: Yar pappu miss kehndi aey k majjh da doodh peen nal dmagh taiz hunda ae
Pappy:gappa mardi ae jay ae gal hondi te apna khatta enginner na lga hunda

Some JOKES

Teacher to Pathan: Jis ko sunai na de use English main kya kahenge?
PATHANL Jo marzi keh do Us ko konsa sunai dega

Gharaylo Totykay
1- agar ap ko kutta kaat ly to ap usay kaat len. Hisab barabar
2- Doodh phat jaye to safaid dhage sy si len, kisi ko pata nahe chalega
3- agar ap ka qad chota hy to 3,4 martaba phansi len agr bach gaye to bohat faida hoga
4- agar apke baal girte hen to tind kerwa len phir kbhi nahi girengy.

Zindagi k 7 Ehem kaam
1- Studies
2- Games
3- Entertainment
4- Love
...............
5-
6-
7-
4th kam k bad banda ksi kam ka nahi rehta

Sardar: meri biwi itna mzaq krti ha k kya bataon
Dost: kaisy
Sardar: Kal men ghar gya uski ankhoon pr hath rkh k bola "mein kon?" to wo mzaq mai boli "Doodh wala"

What is Success?

Every successful person has a painful story.Every painful story has a successful ending.Accept the pain and get ready for success.

Good Hearted People

People are not beautiful, as they LOOK, as they WALK  & as they TALK
but
People are BEAUTIFUL, as they LOVE, as they CARE, as they REMEMBER & as they are SINCERE

Thursday, August 12, 2010

How to post code (html xml) on blogs (wordpress,blogger)

Well one way to post html or xml into blogs is to replace or encode the start and closing tags with html code so that they actually displayed in the browser rather than being taken by browser as actual html of the page
this webiste can help you to encode your html

http://centricle.com/tools/html-entities/

it wont color it but you can color it using coloring tool in blogger's blog editor

Thanks

Wednesday, August 11, 2010

Wrapping Text Using CSS

If you want to wrap some text, even if it is a very long word just like bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
you can wrap it up in any given width using a CSS attribute called "word-wrap" its value in this case should be "break-word"

Here is a code example

<div style="width:20px;">
<h5>
<a style="color:#ED145A;word-wrap:break-word;" href="http://mywavingthoughts.blogspot.com/">
MyWavingThoughts
</a>
</h5>
</div>

and the result