Posts about software development

Date and time in ruby

24 January 2015

Time.now will give you the current date (and time), like so:

Time.now 2012-11-22 22:35:01 +0000

You can also request all the date parts individually:

Time.now.hour 22 Time.now.min 35 Time.now.sec 01 Time.now.day 22 Time.now.month 11 Time.now.year 2012

Cool (and easy), right? If you want to change a date, you can add seconds to it:

t = Time.now 2012-11-22 22:35:01 +0000 t2 = t + 10 # 10 Seconds 2012-11-22 22:35:11 +0000 t3 = t + 10*60 # 10 minutes 2012-11-22 22:45:01 +0000 t4 = t ...

A collection of useful Ruby/Rails gems

24 January 2015

Since lately i've been working a lot with Ruby (Android and Java as well, but that's a different story), i figured i posted a couple of interesting gems that will make your life easier, especially but not only for rails.

Slim

Slim is a templating engine (like ERB or HAML) which pursues simplicity. It helps you write an insane amount less HTML and Rails code. You will not believe your eyes. An example:

In HTML

<body> <h1>Markup examples</h1> <div id="content"> <p>This exam...

Introducing Simple Rails Blog

24 January 2015

Yes, a new blog. I know what you are thinking: "Who the hell cares?". But read me out.

A while back i looked at wordpress and thought "i don't really need all this stuff, do i?". Turns out i didn't. And if you are at least a little bit like me you will agree that sometimes less is more. After searching for some alternatives i ended up with two solutions: A company hosted blog (tumblr, blogger, and others) or hand made. I chose the latter. 

So let me introduce you to my new open-source ...

Displaying posts 7 - 9 of 63 in total