Archive for the ‘Programming’ Category

CSS inliners

Tuesday, August 13th, 2019

At the moment, I’m working with a company where I’m handling their email templates. One tool I found to be very useful are CSS inliners. I won’t be discussing Inky templates in this post.

I’ve been using and for the most part, it works perfect. The only down side is that I have to visit the url, paste into the text area, click a button, wait for the page to reload, copy, and the paste the inlined html. It was okay at first, but by the 100th paste, it gets stale quick. That’s when I started looking into CLI options.

The tech explosion has been great, providing a lot of inlining CLI tools I wouldn’t have had otherwise. Everyone wants to make a name for themselves on the interwebs, and I can relate.

That being said, I’ve went through pretty much all the NodeJS one, and the only one I found comparable to campaign monitor’s is “inline-email” located here:

Example command:

inline-email index.html –noInlineImages | pbcopy

The other solution I found acceptable is the python based premailer. It’s pretty much just like inline-email, except it gives you the option to not strip the style tags. I did find that useful in some occasions in which the element you wanted to affect didn’t exists until rendering (sometimes clients inject things on their own). Premailer can be found here:

Example command:

python -m premailer -f index.html | pbcopy

If anyone is having issues getting their emails to look correct across email clients either phone, web, software based, you should give the aforementioned tools a try, definitely made my life a lot easier.

Skills, degrees, or product?

Monday, April 29th, 2019

In the recent explosion of technology and all the varying degrees of “skills” that result from it. I feel a little overwhelmed. I am from a time where tech was essentially Apache, HTML, Javascript, CSS, and some sort of language that supports dynamic generation of HTML aka, DHTML. Then with every language there’s it’s evolving syntax, AND the various frameworks and their ever evolving practices.

Now? For javascript, you have your Grunt, Gulp, NodeJS, jQuery, VueHS, ExtJS, Angular, React, and the list goes on. For your CSS, you have your SASS / LESS, and browsers and varying versions of browsers to support. For your hosting, you have Kubernetes, AmazonMesos, DockerSwarm, Docker, VMs, Baremetal hostings, various hosting providers, and so and so on.

The following article really conveys the explosion of tech really well:


In addition to everything, you have the Machine Learning field introducing it’s own thing or two as well, where hiring anyone with less than a Ph.D doesn’t seem too credible or meaningful.

I feel paralyzed by the sheer degree of stuff I “have” to learn. I see myself looking at wide lecture hall’s triple-column double-row chalkboard of tech thinking that these are the skills I have to know to be an effective programmer now and days, but is it?

I don’t think so. It seems that in the torrent of tech terms being thrown at me, and the various fear of being labeled as dinosaur, or a person who’s opposed to change, a fear of obsolescence, the fear of being all those “has beens” I’ve seen. Being caught up in this tech wave, I forgot something VERY important to me, which was WHY I do the things I do in the first place.

Did I sign up to learn and master EVERY tech out there? No. Did I sign up to be a programmer as a profession? No. What did I sign up for? To do what I love, and if I happen to be paid for it, great! Do I need EVERY tech out there to do it? No! No I don’t. Are some of the new tech out there applicable? Yes, I think so, but not all.

I think it’s important to be opened to the idea of new ways of doing things, so if there is a new tech / method that allows YOU to do things better and more efficient, you can. At the same time, realize that even if your methods aren’t the “latest and greatest” they are STILL capable of doing things. My focus is shifting away from the latest and greatest, and back to my original way of doing things, which is to use the proper tool for the proper task, and adopt tech only as necessary, and just have fun. Adopt tools that help with my goal of creating that cool thing I wanted to create, but stay away from that next shiny thing that everyone is raging about. Make it work first, optimize it later.

Do I need to use a machine learning model to write a web portal automatically? Probably not. Do I need to add webpack to my static HTML one pager? Probably not.

A long time ago, I talked about various methods introducing their own overhead, and how I coded faster as a new programmer than a senior programmer thanks to adherence to all the “latest and greatest”. I’ve forgotten about that, and I think, it’s time for me to get back to that, at least for my hobby projects.

Perfection Paralysis

Tuesday, February 5th, 2019

I’ve spent more than a decade in professional software development. I’ve seen and fought this demon time and time again. The demon’s name is Perfection Paralysis.

It’s quite the beast. When you have so many eyes reviewing and critiquing your code, you want to be the best you can possibly be. You want your code to be representative of all that you’re capable of, because that’s what you’re judged by.

I think this is why I find writing my own hobby code so relaxing. No code reviews, no tech designs, no architecture reviews, and planning meetings and etc. I simply let the thoughts flow from my mind to my fingers; code happens, the world is changed.

I warn of the dangers of perfection paralysis because there is no single solution to solving a problem, there’s in fact, probably an infinite ways to solve it. No matter which way you go, there is always room for criticism and improvement. You can make it faster, you can make it neater, you can make it more extensible, you can make it more testable, and the list goes on.

I think one factor that a lot of developers don’t take into account, is how much more work they’re subjecting themselves and possibly their organization to.

Your code looks great, but did you do Doc Block commenting? Your code works, but is it type strict? Your tests passes, but does it handle mutation testing well? You have test coverage, but is it 100% test coverage, or partial coverage? Your test passes 100%, but does it pass for all device, or just a single device? Your application works now, but will it work once the load increases by a hundred folds? So on… and so on…

I find myself in this situation ALL the time, both in the professional environment and the non-professional environment. Great, this JS code works, but should I have done it in React? Great, it works in React, but should I have incorporated Flux/Redux? I finished it in native PHP, but should I have used the Laravel Framework? I did it in Laravel, but maybe I should have done this in GoLang? Great, I’ve coded it in GoLang, but maybe I should have coded it with Gorilla? The data persistent layer is in MySQL, but maybe I should have used DynamoDB? The list goes on and on and on, it will NEVER stop, because there’s simply no stop case, this is simply the nature of our work, there will never be a best, because the best is yet to come.

I think remembering the BIG picture helps me maintain my sanity. Reminding myself of the objective allows me to focus on running past the finish line instead of being crippled by anxiety at the starting line. In the end, code is code. It’s simply a series of instructions to a computer, a persistent mechanism, and presentation mechanism. No matter how we’ve changed things, those things stay the same. In the end, no matter how you code it, if it fulfills the objective, it’s working code.

I think a concept that a lot of developers forget in the software development life cycle, is that code becomes obsolete. In this RAPIDLY changing world, should be optimize for 10 years? 5 years? 3? 2? 1? 6 months? That’s a tough question, but let me answer it with another one. If you wrote optimal code using ES 5, is it still optimal under ES 6? If it was optimal ES 6 code, is it still optimal ES 7 code? If you coded it using React, could material UI have done a better job? If you used jQuery, and now you have all these built-in selectors to javascript, is it still the optimal approach?

I urge myself, and other developers to optimize for the situation as it stands, in their own life, in their environment, and future proof it to a reasonable extent. Architect it for the current and PLANNED next steps, but I wouldn’t optimize it any further than that.

Advance the code and project in an interactive, self-rewarding manner, rather than a giant hunk perfection that is either ALL or NOTHING, a long ways into the future from now. When you have 1 or 0, the expected value is 0.5, but if you allow yourself to build everything in an incremental manner, it’ll be much less stressful, and you’ll have more fun.

So for myself, or anyone else reading this… “It’s okay, it’ll be fine, even if there might be a better way, just do it the best way for the current circumstances, when the circumstances change, much like the Monty Hall paradox, we can pivot then”.

Enable Infinite Homepage Scrolling on Note 4 (rooted Android 6.0)

Monday, May 1st, 2017

So! My loyalty to the Note 4 at this point is borderline fanatical. Samsung has YET to make a better phone, in fact, neither has Apple. I’ve recently bought a Verizon Note 4 to replace my T-mobile Note 4, since Verizon allows me to use both T-mobile and Verizon, but the T-mobile version wouldn’t work on the Verizon network. If I’m going to replace that phone that’s been acting up, I might as well replace it with a better one.

After a ton of pain, I’ve managed to figure out exactly which ROM, I should install, what’s working in what version of the ROM and so on… Eventually, I just went with a nearly stock ROM that’s simply rooted.

Everything looked normal an kosher, until I’ve noticed that the homepage doesn’t do infinite scrolls. I’ve found a lot of instructions online, but it no longer really covers the file structure of Android 6.0.

I’ve decided to write a post, and if it happens to help someone out there, then awesome.

-Open up your file manager, in this case it’s Root Explorer
-Go to /system/csc/others.xml (hold down on others.xml and open in text editor)
-Scroll down to the end (on my phone, the line we are looking for was the third or fourth from the bottom)
-Find the line that looks like this:


-Change “true” to “false” (without quotes). It should now read:


Citing my sources, but saved it for last, since I didn’t want to force my readers to read through things they didn’t want to:

The solution is actually an interpreted combination of:

How to Enable Hidden CSC Features on Samsung Galaxy Devices with Root Access



Useful command to test speed of a container, vm, or system

Monday, March 6th, 2017

I’ll be breaking down the following command part by part:

time dd if=/dev/zero of=test.dat bs=1024 count=100000


What does time do? It runs a process and then captures how long it took to execute.

What about DD? Well, it’s a command that copies data from a standard input to a standard output.

What about the params if, of, bs, and count?

“if”: It’s decently obvious, but “if” specifies the input, in this case we’re taking input from a special file that provides as many null characters as there are read from it; an infinity file of sorts.

“of”: It’s the output file.

“bs”: Byte size

“count”: the number of blocks

So all together, the command writes 100,000 blocks of 1,024 bytes of binary zeroes into the file of “test.dat”. In other words, generates a 100 MB file. This command allows you to generate a 100 MB file and test the  IO performance of a system. As we move towards a world we’re optimizing the crap out of everything, this is a very useful command to know.

Amazon S3 Outage

Tuesday, February 28th, 2017

Today’s post is regarding

These type of occurrences are becoming more and more common. Tons of company has placed a ton of faith into the Amazon ecosystem, and time and time again, it looks like Amazon has let them down. When these things broke, it broke at a MASSIVE scale (AWS outage knocks Amazon, Netflix, Tinder and IMDb in MEGA data collapse, )

There were other outages in 2012, 2013, and probably more unlisted. I think it’s an interesting challenge that Amazon is tackling, and I feel like more and more of the web is putting all of their eggs into one giant basket.

I wonder, if we were to build a truly scalable, and unlikely to be impacted system, maybe it might make sense to diversify the system’s infrastructure to utilize multiple services. Maybe some redundancy at the DNS layer, then some more at the LB, some more at how things are replicated, localized and so on… Just something to reflect on due today’s outage, “How can I prevent my organization from being impacted by this?”

How I cleaned more than 8,000 thousand emails from my mail box

Thursday, January 5th, 2017

Long long time ago, briefly after the birth of gmail, I created an email account, and mail was good. Fast forward to now, holy spams. Years and more than a decade of neglect, I’ve managed to amass more than 11,000 emails, and this is post spam filter. I guess over the years, I must’ve signed up for every single notification and newsletter out there. Each them I delete an email, and unsubscribe from a list, another newsletter shows up, and I’d think that I must’ve unsubscribed already, but I’m not too sure anymore. All I knew was that my inbox was looking like this:

I’d stare at that number every day, thinking “Someday, I’ll clean it, but today is not to the day…”

The idea of going through my mail one by one, and then checking to see if the sender was a bulk sender or not, and then unsubscribing from it, just seems like such a time consuming task. Then I start noticing that in the midst of the spam, here and there, there were some important emails I’m starting to miss. That was the spark that lit my fire to put an end to this spam once and for all.

Using my computer programming powers, I created a program to go through my mail, and build a list of senders I receive emails from, and the amount of emails I have from them:

thousands upon thousands of emails later

I’ve built a list of emails and their frequencies, and life was good, but I knew I can do better.

I took it a step further, and built another list based on the domain of the sender.

Utilizing these two newly crafted weapons in my arsenal, I blew away thousands upon thousands of emails, some of which were spam, some of which were transaction emails that no longer have any importance. Once the non-important emails have been unsubscribed from and removed, it was so much easier to deal and organize my old emails. Once that noise was removed, it was so much easier to deal with my new emails. Now, my emails look like this

And life… was good.

PHP Pop Quiz

Friday, May 29th, 2015

I took the PHP Pop Quiz on w3school’s today:

Guess what I got?


This relatively old technological dinosaur still has it!

The Fall of PEAR and the rise of COMPOSER

Saturday, October 4th, 2014

I’ve been out of the loop for a while, and more and more I keep hearing about “composer”. I appears that composer is the new PEAR, so I guess it’s time to get with the program.

PHP Framework Plugin Evaluation

Friday, October 3rd, 2014

Which one is the BEST framework? Well! There are many ways to benchmarking a framework, speed, adoption, usability and so on. Today, I want to examine the plugin community for these frameworks.

I’ve pulled a list from and and I plan to review frameworks that are on both URLs, the reason being, is that I don’t believe it makes sense to code authentication systems anymore. It’s been done a trillion times before, why are we reinventing the wheel? If the framework isn’t listed on these two URLs, I’ll prematurely conclude that the community isn’t active enough to put them on the map.

The frameworks that show up on both URLs is as follows:

  • CakePHP
  • CodeIgniter
  • Laravel
  • Symfony
  • Yii
  • Zend

Here are the URLs I’m using to compare the plugin / extension libraries of each framework:

Not meant to draw any real conclusions, but it does give an idea of how active the community is, and sheer amount pre-coded stuff out there. I’ve basically went through each site, and scrapped the urls, the followed the urls and parsed the resulting HTML for the date which the extension was updated. I haven’t prod any further than that, although at this point, I am hopeful that if I was on either the Symfony or the Laravel platform, I can look forward to a lot of pre-written code.