SASS, CSS Pre-Processor

I was introduced to SASS, a CSS pre-processor language. I had heard about these CSS pre-processors before but didn’t pay much mind to them since I didn’t see the need. CSS is quite simple, why did people want to add levels of complexity to it? At least those were my thoughts until I went through the basics of SASS and saw its powers.

The first big PRO for using a pre-processor is using variables. All sites have at most 10 colors used throughout their style but re-using them consists of a huge copy and paste and making sure you grabbed the right HEX code. With SASS (and others), you could use variables that are defined once and then could be used throughout your style sheets. This was the first huge win, re-usability of definitions.

Second big PRO is including files ! Usually people have big comments on their CSS saying “this section takes care of tables”, now you can just include the file that takes care of the section and know where to look. It’s easier navigating through sub-sections in different files than sub-sections in a 1k+ line file. It reminded me of the first time I used include() in PHP, instead of copy and pasting HTML in my HTML files.

With these two, I was sold. But an honorable mention should go to using functions. With a function you can define specific code that you can re-use but have different variables implemented for it’s use. There are tons of other features but some go more on the CON side for me.

The biggest CON is what I knew from the start, complexity. One of the functionality it provides is looping. While looping is great when programming, looping and creating CSS in a loop could be dangerous because you will be significantly increasing your file size in the end. Then you have to remember to compile so all your CSS could be processed or you’ll be stuck with a previous version of it. Since these languages provide you with a lot of tools and options, it means more downfalls if used wrong.

As I go through some personal experiences, I hope to share some knowledge on do’s and don’t. CSS should be simple, clean and compact. With a language like SASS, things could get out of hand very easily.

 

Yasser,

Know Your Worth – Time is Money

As my friends continue to develop their career paths, I have noticed a trend of overworking. The overall common goal for everyone is to keep on moving up the ladder and make more money in order to afford a better living. However, a better life is more than just money and we often forget this.

“Time is money”

If you have a new job, a promotion and/or a raise but find yourself working more hours with no overtime…you probably didn’t gain anything. Too many people I know are working 3 or 4 more hours on a weekly basis but not getting paid overtime. If you received a raise and you calculate it to an hourly wage, did you really gain a raise? You’ve sacrificed some of your valuable time to invest in yourself and enjoy life for a “raise” which ends up adding up to the same amount you were getting paid before or even less. Time is money, spend it on yourself if you’re not getting paid for it.

Some might argue that the short term sacrifice will eventually pay out in their careers; this could be true. If you truly believe that you are in this circumstance then by all means, hustle as hard as you can. But you have to set yourself a timeline and not end up in that vicious cycle for an eternity. Not all raises are created equally. If you find yourself working overtime here and there, that’s totally acceptable. If it becomes a pattern then you have a bigger problem.

Know your worth and don’t settle for less.

Yasser

I’m in Love with Ramen

In college, ramen was a joke. It’s the broke college students solution to hunger. It’s too salty and quite disgusting. Thankfully I never had to depend on it and only ate it when I was sick and nothing else was an option. But recently I was convinced that Ramen is a lot better than just that so I listened and gave it another chance.

I tried my first real ramen at Hanjan. They prepare a 12 hour broth and only serve it after 9pm. That description alone had me sold, besides being listed in a few top ramen places in NYC. This is where I fell in love with Ramen and will continue going back as long as it’s always tasting amazing.

After eating it several times and never being disappointed, I figured I’d expand my knowledge on it. Netflix has a tv show called “The Mind of a Chef” and the first season is about the chef of Momofuku who also happens to be obsessed with Ramen. From that single episode I learned quite a lot. And now I’m on a mission to try other places, even though I’m terrified to be disappointed after Hanjan setting the bar so high. So, like my series on Burgers, a series on Ramen will probably be coming this fall.

Yasser

Inequality For All

Most people can agree that the economy is broken. By this point there is little room for debate about the class gap in our economy. The reasons could be argued for days and the solutions seem to be all over the place. On one end people, say that raising minimum wage would destroy small businesses and cause a big economical problem for companies because most can’t afford a raise. On the other end, the wage gap is so big that they deserve a raise simply to keep up with inflation.

I know very little about economy and could only make speculations of what works and what doesn’t. But I ran into someone who knows a lot about the economy, that is Robert Reich. To make things even simpler for an average person, there’s a documentary based on one of his books/lectures called Inequality for All which you can easily find on Netflix.

In short, he discusses what we already know about the class gap but he also digs into what caused it and the cycles of this countries economy. One of the things that stood out the most was Labor Unions. After the fall of labor unions the gap increased significantly since no one was advocating for the lower workers rights. His whole point about a better economy is that the Middle Class is the most important class and education should be one of our biggest expenses. They’re the consumers. If a lot of people are consuming then a lot of people need to be producing which leads to jobs, thus, they create jobs. So it seems like the key to a better economy would be a stronger middle class.

Go watch the documentary,

Yasser

Intelligent Failure

I had the pleasure of attending a small lecture about learning from failures and making the most of it. The event was short so the topic of conversation was a bit shallow. A few stories were shared about huge company failures. Some advises were given about learning how to fail in your life. And a Q&A about the topic was done. I’ll try to share some of the things that stuck with me from this event.

A story was told about the company Ford while on it’s prime. Someone came as a consultant because things were starting to decline at Ford. The persons first observation was that the executive parking lot was full of cars that weren’t made by Ford. He invited all the top managers/executives to a board room to express what has been going wrong but no one wanted to admit there was a problem at first. This highlighted the typical corporate mentality that “failure is bad” and if your project is failing then you’re responsible. This type of mentality doesn’t help to open up discussion and look for collective solutions. Small issues turn to big ones because there is little to no input.

Someone in the crowd asked about what is it about companies flat lining after a huge success. The speaker, from experience, said that companies usually find a niche or product that is successful. Then, they spend most of their resources improving that product and making sure that product stays number 1. They become so close-minded that they refuse to see other upcoming markets or other innovations. This is a great example of a company like Kodak. Kodak failed to invest in the digital market because it didn’t believe in it and by the time it tried to jump on the boat, it was too late.

The quote of the night was “fail fast, fail cheap”, from Silicon Valley. You want to fail to learn from experiences but you want to make sure it’s not too costly. As an example, the speaker used investing in a diversified portfolio. A few of the investments will fail but a few could potentially succeed. The initial investment should be cheap so you could learn from mistakes. After you start gaining experience then you can take bigger risks.

Yasser,

The more you know, the slower you are

I recently read a blog post about how experience slows your job productivity down. At first, I thought the post made no sense but after reading through it I understood and agreed with it. The more experience you get in your field, the slower you will probably perform. It isn’t something necessarily bad, it’s actually good, most of the times.

Throughout my first few jobs, I would try to solve problems as soon as possible. I used to think that solving things quickly would demonstrate that I am knowledgeable and capable of doing my job. As time has gone by, I’ve become a bit slower at solving similar problems. I hadn’t realized it but something that would take me 1 day was now taking me 2-3 days.

Now that I’m more experienced I try to analyze all possible outcomes and prevent future problems. Even the smallest of tasks could end up having long term consequences. This is the advantage. Before, I was able to solve one problem but that small problem could potentially lead to other problems. Now, I try to take my time and think of what consequences and side effects it might lead to. Moving a small rock sometimes leads to an avalanche. However, this also leads to a problem.

The negative side of experience is that you tend to over think things. Something that should be simple turns into a complicated problem that you over analyze. There should be a point in your thought process where you should take a step back and think, am I over thinking this ?

If you are analyzing a problem for too long without making any type of progress, you should stop and consider if you’re over thinking it

Yasser,

Remembering to Live

This past week one of the most influential writers of Latin America passed away, Gabriel Garcia Marquez. Coincidentally, I’m in the middle of reading his most famous book (100 years of solitude) . It was a sad and touching news to me on a personal level because he was the reason I became interested in reading stories after I read his book “No one writes to the Colonel”. This reminded me of how far behind I am on my reading list and also reminded me to think about life and our accomplishments.

Thus, I realized I hadn’t shared one of my favorite pieces about reflecting on life. It was written by Jorge Luis Borges as a poem talking about what would he do in life if he had a second chance. He passed 2 years after this poem. I’m posting the original Spanish version and the English one right after. Enjoy :)

Instantes (spanish version)

Si pudiera vivir nuevamente mi vida,
en la próxima trataría de cometer más errores.
No intentaría ser tan perfecto, me relajaría más.
Sería más tonto de lo que he sido,
de hecho tomaría muy pocas cosas con seriedad.
Sería menos higiénico.
Correría más riesgos,
haría más viajes,
contemplaría más atardeceres,
subiría más montañas, nadaría más ríos.
Iría a más lugares adonde nunca he ido,
comería más helados y menos habas,
tendría más problemas reales y menos imaginarios.

Yo fui una de esas personas que vivió sensata
y prolíficamente cada minuto de su vida;
claro que tuve momentos de alegría.
Pero si pudiera volver atrás trataría
de tener solamente buenos momentos.

Por si no lo saben, de eso está hecha la vida,
sólo de momentos; no te pierdas el ahora.

Yo era uno de esos que nunca
iban a ninguna parte sin un termómetro,
una bolsa de agua caliente,
un paraguas y un paracaídas;
si pudiera volver a vivir, viajaría más liviano.

Si pudiera volver a vivir
comenzaría a andar descalzo a principios
de la primavera
y seguiría descalzo hasta concluir el otoño.
Daría más vueltas en calesita,
contemplaría más amaneceres,
y jugaría con más niños,
si tuviera otra vez vida por delante.

Pero ya ven, tengo 85 años…
y sé que me estoy muriendo.

Instants (english version)

If I could live again my life,
In the next – I’ll try,
– to make more mistakes,
I won’t try to be so perfect,
I’ll be more relaxed,
I’ll be more full – than I am now,
In fact, I’ll take fewer things seriously,
I’ll be less hygenic,
I’ll take more risks,
I’ll take more trips,
I’ll watch more sunsets,
I’ll climb more mountains,
I’ll swim more rivers,
I’ll go to more places – I’ve never been,
I’ll eat more ice creams and less (lime) beans,
I’ll have more real problems – and less imaginary
ones.

I was one of those people who live
prudent and prolific lives –
each minute of his life,
Offcourse that I had moments of joy – but,
if I could go back I’ll try to have only good moments,

If you don’t know – thats what life is made of,
Don’t lose the now!

I was one of those who never goes anywhere
without a thermometer,
without a hot-water bottle,
and without an umberella and without a parachute,

If I could live again – I will travel light,
If I could live again – I’ll try to work bare feet
at the beginning of spring till
the end of autumn,
I’ll ride more carts,
I’ll watch more sunrises and play with more children,
If I have the life to live

But now I am 85,
– and I know that I am dying …

Why Personalized News Could Be Bad

I was watching “Real Time with Bill Maher” last night and one of the guests made a comment about personalized news being a tool that allows for further ignorance from people who claim to read the news. Until I heard that comment I thought personalized news was great since it skipped over all the things I didn’t care much for but then I realized that it was a mistake.

Not too long ago, a study was released saying that One-third of US adults get their news from Facebook. This made me realize that a lot of people I know get their news from Twitter. I read about situations and things happening worldwide and two weeks later when they become a popular topic, I will see them all over Facebook and Twitter expressing their concerns. This means that all the other topics that don’t become popular go completely unnoticed.

Personalized news has the very same effect. I read Google News about 12 times a week (several times a day) and I’m more likely to click on an article that talks about one of the sports team I follow or about things happening in NY. And because of time, I will only select a few out of the hundreds of articles. Google starts learning my behavior and displaying news that I would usually click on. Sooner or later the news gets customized to the point where I won’t be seeing news articles about other things that I might not have shown enough attention to.

Thus, I now become ignorant to other things happening around the world and in topics that I haven’t shown much interest in the past. Personalized news is great for a quick read on topics that you only care about. In the long run you exclude yourself from all other topics. So from now on, personalized news site will be seen under no attachments to my accounts so I can see the wider picture.

Yasser,

X509Certificate2 vs IIS 6

Recently, I wrote some code in .NET that makes use of X509Certificate to read in a PFX file (the part that has the private key) in order to encrypt messages before they are sent out. I created my certificate using “Makecert.exe” and everything seemed to have been working fine. I was testing on my computer which was running IIS 7 and had no issues. Tried it on another server setup that was using IIS 6 and it also worked fine. Then I tried it on a different IIS 6 and things stopped working.

At first I kept getting an error that said “file not found” but I knew it wasn’t true because I could see the file was using the exact same path as where the file was located. After comparing settings between servers and reading up on IIS, I learned about an option called “LoadUserProfile” which allows you to load your full user profile which you are running the AppPool on IIS. Of course this option does not exist in IIS 6 and there is no options at all to turn it on. But, one server with IIS 6 had worked because it was using “Network Services” as its user.

After doing more research about the whole process of using a Certificate in .NET. I learned that it tries to store the key in a temp folder for the user. However, there is a setting called “MachineKeySet” which allows you to do it for the “All Users” in Windows. So turning this flag on, I now received an error that said “Access Denied”. Which lead to more research and ended up with this path “C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys".

Had to give full permission to the right user in order to work. Lesson learned, using X509Certificate class in .NET does a lot more than you would think and involves user permissions and IIS settings to be correct. The error messages are as cryptic as they could be and pretty useless.

Yasser,

Which Programming Language to Learn First

There has been a recent trend in people wanting to learn how to program. People see a video or think they have the next great idea and think that programming is an easy thing that they can pick up in a matter of a month. And while to a certain extent it is easy to pick up, it’s not easy to master. Regardless of their reason, the first thing they ask me is “Which programming language do I pick to learn ?”

I’ll be the first to admit that my first language I learned was Visual Basic and while it did it’s job in keeping me interested, it was a horrible choice. I developed bad habits and didn’t learn much about how to program but how to make a program. I never had a good answer to this question but today during a lunch conversation it clicked, Java is the best.

In my opinion, Java is the best language to start learning how to program. It is free. It is easy to read. It could be used from any operating system. Errors are not super cryptic. It has all the basic concepts of programming. There is tons of documentation and help you can find online. In my eyes, it’s a complete package for a beginner. You can learn basics about variables and types, loops, functions, classes and objects, inheritance, I/O, sockets, etc. After you cover basics and feel fairly comfortable with Java, then I’d suggest picking up something more advanced like C++. There you will truly learn the ins and outs of a whole system and memory. As a 3rd option, I’d suggest a scripting language like Python or Perl.

The second contender after Java would have been Python. It is great and easy to read syntax. The huge downfall about Python is that it’s a relatively new language and while a lot of documentation already exists, things aren’t very clear. Syntax sometimes changes from version to version (looking at you print) and following a guide might confuse you if it was intended for a specific version.

Yasser