Ruby on Rails 3 - Console options - Create a project

To create a project in Ruby on Rails 3 with a console you have to go until the parent folder of your future project. The command line is:

rails new myProject

For example, if you are in this path:

$ C:/ror3/

And you want to create a project named site1. Write this:

Ruby on Rails 3 - Console options - Display version

To know the version of your Ruby just write on your console:

$ ruby -v

UNIX & GNU/Linux - tcsh - Setting prompt with country flags

If you have always dreamed to change the classic prompt of your favorite Shell, it is time to see how to do it. Open your tcsh's config that you can find in your home, it is called .tcshrc and inside, modify the line:

set prompt='(%n@%m %h)'

by

UNIX & GNU/Linux - gdb - With Emacs

To start gdb, we have to add the -g flag at the compilation time.
So it is easy to add it in a Makefile. We are also using the Emacs IDE for running gdb.
Note that the code below does not work because we want to see the segmentation fault with gdb.

C - Linked lists - Simple example

Below, certainly the most easy example of the linked lists.

Let's see this example as a FILO, meaning First In Last Out:

Drupal 7 - Where to find - HTML body

Where to find the HTML body of Drupal version 7? Here the tree file until it:

/modules/system/html.tpl.php

Drupal 7 - Where to find - HTML header

Where to find the HTML header of Drupal version 7?

Here the breadcrumb until the file:

/modules/system/html.tpl.php

 

UNIX & GNU/Linux - Tips and tricks - Change the screen resolution

The command to change the screen resolution is xrandr, To see all size available for your screen:

$ xrandr

To choose the another one resolution just use the -s option with the resolution, for example:

$ xrandr -s 800x600

UNIX & GNU/Linux - System calls - Using open()

The open() system call function is used to open a file.

UNIX & GNU/Linux - tar - The xvf command

The xvf command of the tar tool allows to extract files from a file with the .tgz extension, in the current folder. Let's see an example of the xvf command:

Pages

Subscribe to BadproG.com RSS