UNIX & GNU/Linux - Emacs - Phases of the Moon

Yes it really exits!
You can see, with Emacs, the phase of the Moon for the next 12 weeks.

Make an ALT + X and write this:

lunar-phases

Result:

PHP 5 - array() - Using is_array()

How to know if a variable is an array() or not?
Easy with the is_array() function.

Let's see an example of the is_array() function:

Zend - Framework 1.11 - Create a new project

1) Dowload the Zend framework To easily create a new project with Zend framework we have to go until the bin/ directory of the framework package. 2) Once downloaded from the official website, go until this directory:

UNIX & GNU/Linux - Emacs - Display number lines

If you want to see number of lines in Emacs, you have to activate it.

Let's start this tiny tutorial:

Open Emacs, click ALT + X and write linum-mode then type RETURN.

Well done, it works!

To deactivate it, just retype this command.

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

Pages

Subscribe to BadproG.com RSS