fousa tag

Current tag: tag

2010

11 APR

Humanize time field plugin

This is a small plugin to use time input in your textfields and convert them automatically to integer values in your database. HOWTO Clone the plugin into your vendor/plugins directory like this: git clone http://github.com/fousa/humanize-time-field.git Next you should define the columns that need time conversion in your model ob...

8 APR

My Rails templates

Ruby on Rails has a nice feature where you can generate a new rails project with a template. My templates are based on the newest version of Rails at the moment: Rails 3.0.0beta At the moment my templates handle: jQuery integration git git push to Github HAML integration HTTP basic authentication single password authentication ...

26 FEB

Contact form validations with AR helpers

This is how you validate a contact form with the validation helpers used in ActiveRecord. This piece of code enables you to validate: presence of the name and content format of the website (example: http://www.fousa.be) format of the email address (example: test@fousa.be) value of the snow field (snow must be "cold") I also imple...

16 FEB

Heroku and Github for the same project

WHAT'S THE PROBLEM? I have a local branch called master. And I'm currently pushing this branch to my remote Github branch. Now I also want this branch to be used as my Heroku master branch. So I can deploy my code to the Heroku servers. What is my problem? I have a config.yml file with sensitive information inside. And I want it to be push...

8 FEB

Convert MySQL DB to PostgreSQL DB

When I was converting my blog to the heroku, I decided to convert my local database from MySQL to PostgreSQL. This for developing purposes because it's a bad practice to have 2 different systems in development and production. This is my current setup: 1 local MySQL database with my production dump in it. A new PostgreSQL database that is up a...

24 JAN

Ruby script to check your website's response time // 1 comment

This is a small ruby script that you can use to check your server response time. It could come in handy when you want to use it to check your response time and analyze it. You can run the script you have to pass 2 arguments. The first on is the interval time (in seconds), and the second one is the website to check. > ./response 10 ...

2009

19 DEC

Inline formatting with Prawn

When using Prawn to generate PDF in Ruby, you'll sometimes have to add style to your PDF. Well sometimes means a lot from my point of view. Below are some short code snippetz on how to do this. It's just like using HTML tags with some style attributes attached to them. CODE First of all you need to require the prawn-format lib...

10 NOV

RuPy, a Ruby/Python Conference (day 2)

And we're back attending RuPy on the second day. For those of you who missed DAY 1, just check out the linked post. I had to split up, because I didn't want to overkill the post. I also attended the very interesting "Mastering GIT" talk, but I will make a short post on it for your convenience! Let's start! RABBITMQ This is a handy li...

20 JAN

Uploading a rails plugin to Github // 1 comment

I recently looked for a nice SVN repository to store my rails plugins for public use. But I searched the web and found that the most common way was to put the rails code on a github repository. So I created my github account, and then an open source repostiory (named 'plugin-test'). Before you continue with this tutorial, you should check thi...

2008

19 NOV

Using the simplify_time_calculations plug-in // 3 comments

I'm currently busy with creating a administrative website to keep a flight log of all the flights made by a member of my soaring club. Just in case you wonder what I'm talking about, I'm a passionate glider pilot at http://www.dewouw.be. And we always have a start time (format HH:MM) and a landing time in the database. But because it was to hard...

go to the top ↑ ← back to the blog