Turning 40

Today I am turning 40 years old. What does that mean? that I am old? that I am about to go into mid-life crisis? that I should give up all of my dreams? that I am entering into one of life’s most dangerous ages for men? The truth is that most of the things I mentioned above can only be true if you allow it.

I still remember when I was in my teenage years and I wanted to reach 20 years of age, I was frustrated that I couldn’t reach that age fast enough. When I was around 16 or 17 the idea of being a 20-year-old opened all sorts of opportunities and freedom, or so I thought. By the time I was about to reach 30 years of age I felt stressed, I knew I was reaching an important part of my life where every time you make a decision regardless of being good or bad, you know it would affect you down the road. It also meant that every decision I made would affect not only me but my wife and kids, I was no longer a unit of one.

It wasn’t until about 3 years ago that I started feeling worried and a bit sad that I was approaching 40. I remember thinking of people who age when I was in my early 20s as I looked at teachers, my parents, uncles, etc… to me it meant that if you were a 40-year-old person, you were a super old person. How naïve I was.

Recently I started to realize how our core and our mind doesn’t really change that much with age after you reach your 20s. You do start seeing wrinkles in your face and you notice how your body starts to change but inside, you are still you; The same person who thought a 40-year-old person was super old and this, this is exactly what made me and so many others feel sad about getting older.

I have respect for people of all ages, and sympathy for those who are trapped in an older body when their mind and spirit is still the same, young and full of joy. However, it isn’t easy to accept that your body is just a wrapper and that you are what’s inside of it. You must remember that your feelings, memories, experiences and thoughts are what makes you, the person.

I’d like to think that I still have a long way to go, that I am still in the beginning of my journey, that there are still many awesome things out there to be discovered and that makes me feel young and happy. I think of all the joy that my kids have brought me so far and that this is just the beginning. I imagine myself being a grand father and walking with my grandkids on the beach or a small street somewhere in Europe. I imagine holding hands with my wife and laugh at our ourselves and our old bodies. Sitting somewhere contemplating the horizon and thinking about all the things we’ve done together.

So I have come to the conclusion that age is nothing but a number, it means nothing really and it only helps humanity to divide people by “age” so we can create rules and laws around that.

Perhaps the fact that we acknowledge age and see it as something important is what causes all of us to become old and feel like it. Think about it, we could be convincing ourselves to feel and behave differently just because we are older. How naïve.

What have I done these years since my 20s? here some of the most important things I have done since then:

  • Said bye to my family in Mexico and moved to the United States, undocumented.
  • Got a job and helped my family back in Mexico.
  • Fell in love with my wife.
  • Got married after dating my wife for 3 months.
  • Got my first apartment, for me and my wife.
  • Got my first real job, working at a factory and earning minimum wage.
  • Became a citizen of the Unites States.
  • Went to College in Minnesota.
  • Had our first child, our beautiful Jennifer Lee.
  • Kept working fulltime and going to college in the evenings.
  • Found a job as tech support in a small company.
  • Learned to code and started doing some websites and consulting.
  • Started a Tax preparation company which my wife runs today.
  • Graduated.
  • Got promoted at my job, I was no longer making a minimum wage.
  • Had our second child, our handsome Ricardo Ervey.
  • Moved to another city in Minnesota.
  • Things improve professionally, and the Tax preparation business takes off.
  • Got tired of the cold winters and the snow.
  • Moved to Texas.
  • Bought our first house.
  • Found a job as a software developer.
  • Traveled to Europe for the first time.
  • Had our third child, our handsome and energized Mauricio Dioni.
  • Things improve professionally, my wife takes over the Tax business.
  • Travel a lot.
  • More travel.
  • Move to another job.
  • Start another business.
  • Sell our first home and move into our second home.
  • Kids are growing. Jennifer is in High School now.
  • My brothers and sisters are growing, and so are their kids.
  • By now my wife and I have traveled to almost 10 different countries, and have drank and ate more food that you can imagine.
  • Turned 40.

Today I am 40 years old and I am very happy. If you are into history and would like to know what “other” famous people are turning 40 this year, click here.

[Update]

Meet Tokio, new member of the family and a gift for my 40th birthday from my wife.

tokio

Until next time, I’ll write something similar when I get to 50 🙂

How to add a full page background image to your landing page

I recently decided to update the landing page of one of my projects. I wanted to have a full-page background image and change this background image every time a user landed in this page or refreshed it. Here is what I ended up doing:

The <html> tag

Since we are replacing the entire background of your page, let’s add the background image to your html tag. We are going to do this by using some JavaScript that will update the <html> style when the page loads. The reason I am doing this instead of using CSS is because I want to be able to change the background image every time the page loads or it is refreshed.

The first step is to add an id to the <html> tag as shown below:

<html lang="en" id="landing">

Adding an id to the <html> tag allows us to identify it when doing the image background change in JavaScript.

The JavaScript

In order to display a different image every time the page loads or gets refreshed I wrote a function that randomly picks one image from an array. Basically I look at the length of the array (# of images) and then just pick a number from the array using both the Math.floor and Math.random methods from JavaScript.

The last step is to change the background image style of <html> to be the current selected image from JavaScript as shown below:

// <![CDATA[
  function Randomize() {
     var images = new Array("/images/journal1.jpg",
         "/images/journal4.jpg",
         "/images/journal6.jpg",
         "/images/journal7.jpg",
         "/images/journal8.jpg",
         "/images/journal9.jpg",
         "/images/journal10.jpg",
         "/images/journal12.jpg",
         "/images/journal13.jpg",
         "/images/journal14.jpg");
     var imageNum = Math.floor(Math.random() * images.length);
     document.getElementById("signup").style.backgroundImage = "url('" + images[imageNum] + "')";
  }
  window.onload = Randomize;
// ]]>

If you haven’t already I suggest you place your images and any other static content in a CDN. If you have Azure, take a look at my previous post where I explain how to serve static files from Azure.

Please share your comments or feedback in the comments section below. Happy coding!

 

How to serve static files for your website using Azure

Killer features and a beautiful design are important things when developing a website. However, none of that matters if your site doesn’t perform well or is not able to scale when necessary. Serving static files such as CSS and images from your web server is not ideal.

These are some of the disadvantages of serving static files directly from your web server:

  • Unnecessary deployment of files that do not change often, potentially slowing the deployment process.
  • Increase the load of your web server, making it less responsive.
  • Increase of hosting costs
  • Etc…

Here are some of the advantages of not serving static content from your web server:

  • Distribute web server load.
  • Save bandwidth.
  • Boost performance and reduce your existing hosting costs.
  • Ability to update static files by replacing them in CDN without having to deploy entire website.
  • Etc…

In this blog post I will show you how to take advantage of Microsoft’s Azure CDN and Blob storage to make your website serve all of its static content from the Azure CDN. If you don’t have an Azure account and you are a web developer you are missing out. Azure supports a wide range of frameworks and technologies including but not limited to Python, MySQL, Oracle, Java, Linux, PHP, Ruby and of course all of Microsoft products such as .NET, MS SQL, etc… Also, they offer a program for startups called BizSpark where you get Azure services for free, you can sign up here if you like.

Create a Blob storage account and a container

First of all you need to create a blob storage account and then a container which you’ll use to store all of the static content. To do this open your Azure portal and then click on the + NEW button located at the bottom left corner of the portal and select Data Services > Storage > Quick Create > as shown below, then just type a URL to identify this new blob storage account. In this example I used the name “mystaticfiles”.

Create Blob Storage Account Image

It takes approximately 1 minute for the blob storage account to be created. Think about it, it takes a minute (or less) to deploy a blob storage account/instance capable of logging, monitoring and redundancy.

After that you’ll see your newly created storage account, click on the name of it, then on the Containers link and then on Create Container as shown below:

Create Storage Container Image

After the Create Container window opens, type the name of the new container and its access type. For this example we are going to select Public Blob which allow us to have a container where all files are available to the public. The other two options are Private which makes the container available to you only and Public Container which allows anyone to have access to the files, metadata and pretty much everything else in this container.

create container in Azure

Manage the blob storage account and container

Now that you have your new storage account and container, you can start transferring static files from your website to the container(s) you’ve created. To do this, you can either write a service that does this for you or use one of the programs available that help you manage your containers and files in an Azure storage account.

I found an open source application to help me manage my storage accounts and containers and so far it has worked out very well for me. If you are interested, you can download it here and even get the source code for it too:

Azure Storage Explorer

You can use this application to browse your files as well. Once you have all your static files in your Azure blob storage containers you can then update your static file’s path to point to the Azure containers. For example, here is a link to one of my images stored in Azure blob storage:

https://foreverbitapp.blob.core.windows.net/images/journal9_medium.jpg

Are you using Azure blob storage? please share any tips or feedback in the comments below.