Books, Gaming, Kids, Programming, Scratch

Two Great Books To Get Kids Into Coding

Earlier this year, when I started teaching programming to my kids (4 and 6 yrs old at the time of this writing), I was not sure where to start because you need to translate lots of knowledge that is usually targeted for adults into kids friendly language. I found these two books that really helped with this task, and I highly recommend them if you want to get your kids into coding as well.

Coding Games In Scratch

What is Scratch?

Scratch is a project of the Lifelong Kindergarten Group at the MIT Media Lab, free of charge, which helps create interactive stories, games, and animations. You can learn more here.

Who this book is for: Although it’s targeted for children 8 – 12 with no coding experience, this book is perfect if you want to start children as young as 4 years old by sitting with them and going through the exercises together. The first few pages provide insightful knowledge about games, like what makes a good game, types of games, game characters, etc, and the step-by-step instructions are easy to follow. No coding experience required.

OrderCoding Games in Scratch

Hello Ruby: Adventures In Coding

The author, Linda Liukas, is a programmer, storyteller, and illustrator from Helsinki, Finland, and this book is the product of one of the most successful Kickstarter campaigns for children’s books. What is so great about it is, as you may imagine, it combines great story with great visuals to take you on a programming journey. Also, it contains fun “offline” activities. Click on the image to learn more.

Who this book is for: Recommended for children 4 – 8 years old. I feel that this book is perfect for parents who will be reading and doing the activities with their children, specially when no experience in programming is something to factor in. But even if you have a Computer Science or Engineering background, you may benefit from the language and images used in the book. Definitely a good place to start before jumping into Scratch.

Order: Hello Ruby: Adventures in Coding

Disclosure of Material Connection: Some of the links in the post above are “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers. I am disclosing this in accordance with the Federal Trade Commission’s 16 CFR, Part 255: “Guides Concerning the Use of Endorsements and Testimonials in Advertising.”


My Hour of Code Playlist for First Graders

This year I volunteered for Hour of Code. I visited my older son’s classroom, and it was so rewarding to see all 25 first graders in the room deeply engaged in a coding activity. We talked about Computer Science, my job as a Software Engineer and the company I work for, watched some videos, and worked on “The Foos”, a really fun game/coding activity designed by Code Spark Academy for the Hour of Code. Continue reading

PHP, Programming

Creating a Directory, Adding Files and Deleting Everything

I was running a test and it came really handy to create a temporary directory, store some files in it, and later remove all the files and the directory itself.

$path = 'path/to/your/new/directory';

// Create directory if it doesn't already exist
if(!file_exists($path)) {
    mkdir($path, 0777, true);

// Add a text file
file_put_contents($path . 'text.txt', 'Hello World');

// Add a base64 image file
  'zQjO2xR9J+elr7PRPjpnpxAHBjch/1Kg3Yudv0GvQn7ZltKLmJKvp1cuc2eWUHnwGkPjt3' .
  '2zFBVCv2QG6BbocXtvcFAMfs3DbjApSaII6CAVQ1ZZBtkH1e3qZTz/jnL7Ds2ocswKplAF' .
  'DVNECegLiHU8PvmSqmgJWkDaIC5w54Zc9+HOCTiHSOZ6V+pSOzsg1xHXANdmw3i/jQ8CER' .
  'GHYC0o8i04FSH4kavLA2q3g4gA/zKgpeRHvGwPEaZBnKb9KgCLx/nEoppCMQj3CqeA98Z9' .
  'UfxwQDqF7sAtwF0MKTa2Z1+zzQIICRCdkFdPodoy2KUhBA3jD/A/xHYGEE6qVTAIezkxFk' .
  'AaVwyJRggk2boADxDGRhDkDwVPk7zqwH8k8bPsPfAhjleAtiLXwJOXoKj3h2xn/ehyXZuD' .
  'A1APzxG81O0vkU4DdUZ2lQNVMBebgUAKnFaZm8DAL/GxAJoAW62fWikjKAk5HxYgGM3/G5' .
  'RUm9pLgAUA9ibw5AeVjSR41AqJ+ibUFGAJ+d9kPH/Gi/t5+eV4F3mU/7boBsAAAAAElFTk' .

$data = base64decode($data);
$image = imagecreatefromstring($data);
imagepng($image, $path . '/image.png', 0);

// Up until this point, if you step debug you should
// be able to see the directory and files in it.
// Let us now clean up and remove everything.

// I'm going to use PHP's DirectoryIterator class
// If you're not familiar with it you should check it out
// It has some cool methods.
$tmp_files = new DirectoryIterator($path);
foreach($tmp_files as $file) {
    // I only created files, but there are a couple of 
    // directories that get in the way (i.e. '.' and '..')
    if($file->isFile()) {
        // So, if it's a file let's get rid of it
        unlink($path . $file->getBasename());
    // now remove the directory



Creating a Database With Symfony and Doctrine

Today, I created my first sample database using Symfony. In just a few steps I was able to have my db up and running. It was awesome!

First, I updated my db parameters in “parameters.yaml”. I was worried that this wouldn’t work because I’m using a Vagrant box (Laravel Homestead) and you don’t really see examples for this approach in the documentation. So, I just added theconfig items (db host, port, name, user, etc.) the same way I have them configured in Sequel Pro. It worked.

Here’s a sample parameters.yml:

    database_port: 33060
    database_name: product_db
    database_user: homestead
    database_password: secret
    mailer_transport: smtp
    mailer_user: null
    mailer_password: null
    secret: dcc9090991abc12aaaadbb787111cee

Next, I created an Entity class. Continue reading


Hello world!

What better way for a coder than starting his blog with a “Hello World”. It’s just perfect! What you will find here is just stuff that I find interesting, not necessarily about programming. It could be photography, gadgets, or soccer, but in the end it could lean more towards programming and the like. In summary, this blog is just going to be about anything that catches my interest.