Blaine Freelance

Clients who don’t pay

June 5, 2018

I’ve been freelancing for over a year now, and in my experience, there are a lot of bad clients.

One bad client of mine in particular, was a client that ended up never paying me any money, even after I had invested 10 hours of my time into their project. The project was moving along just fine, and it was nearly complete, yet the client suddenly stopped responding to my messages. Why? They never told me. Maybe they found a free solution while I was working, maybe they changed their mind, or maybe they just didn’t feel like paying any money. Either way, I had invested a significant amount of time into building what they had asked me to build, and I ended up never seeing any money for it. This is why I now have a policy of requiring money up front.

I’ve recently had a potential client come to me and ask me to do some work for them. Having learned from the past, I asked this person, “are you willing to pay money up front?” and I even informed them that they could pay in $30 increments. $30 is my hourly rate. They did not want to pay even $30 for an hour of my time to get started. This basically told me that they are sweatshop-budget, and they don’t really have much intention of paying. I tried to explain to this person that $30 is a small amount of risk for them, compared to the amount of risk that I would have to take by hoping that they still feel like paying me after the project is complete and I’ve invested 20 or 50 or however many hours into their project. If I don’t ask for any money up front, then this person could simply walk away at the end, for who knows what reason, without paying me any money at all, and without caring that I invested however many hours into their project. I actually asked this person, why should I risk 20, 50, or 100 hours or however long it takes to complete your project, when you would only have to risk $50-$100 up front? To me it makes much more sense for the client to pay in hourly increments, than it does for me to sink 20 hours into their project and possibly walk away with nothing to show for it. The fact that this person was unwilling to pay such a small amount of money for initial consultation told me that they might not have any intention of paying me at all, or that they have a sweatshop-budget. There is no way I’m going to risk wasting 20 hours of my time, which apparently a lot clients have no problem with!

These experiences have shown me that there are bad clients out there, and they should be avoided, and this is why I have a policy of requiring money up front. I had initially started out by doing the work first, and then asking for payment upon delivery. But once clients started to whimsically say “nah” and then walk away without paying, that is when I started requiring money up front.

When you buy services from a freelance developer, it isn’t like buying a product from the store. It’s a business relationship. You’re working with an actual person who has to invest large amounts of time building what you want them to build. You have to know what the hell it is you want built. You can’t have a contractor come over to your house, start building, and then change your mind after they’ve already built what you asked them to build!

The solution to this problem, is to simply ask for money up front. If you get a client who is unwilling to pay even the slightest amount of money up front, they’re probably a bad client, who wants the moon and the stars and the whole world and wants it for sweatshop prices.

Don’t think too much about commit messages

May 4, 2018

I use git for personal projects, because git works well in many situations, even for small projects.

One problem I’ve had with git is, writing commit messages. Writing commit messages kind of sucks, especially if you’re the only person working on the project. Why write long, articulate messages about the changes you’ve made, when it’s unlikely you’ll be going back to read them, especially in the early development phase?

I’m currently developing the opinion that, in the early development phase on a one-man project, it isn’t absolutely necessary that you write beautifully crafted commit messages.

If the project you’re developing becomes mature, and used frequently, then it would make sense to write more meaningful commit messages.

Sendmail: receiving all mail, and routing it to a single address

April 28, 2018

Sendmail is a very simple mail program. To my surprise, I discovered it could also receive mail.

What prompted me to use sendmail to receive email was the AWS email verification process. I didn’t want to go through a lot of configuration steps just to receive a verification email.

Anyway, the feature that will allow you to receive all mail, regardless of the address, is the virtusertable file in /etc/mail/.

I used this guide when setting up this feature.

In order to enable the virtual user table, you need to add it to your /etc/mail/ file.

Note, every time you change your /etc/mail/ you’ll need to run sudo make -C /etc/mail.

This was also a helpful resource in setting up sendmail.

Remember this when trying to get the ‘page’ parameter from a pretty URL in WordPress

April 28, 2018

In WordPress, if you use pagination using pretty permalinks, and your URL looks like this: /products/page/2

In order to access that parameter, you’ll need to use this: get_query_var('paged').

Notice how in the URL the parameter is called ‘page’, but in code it’s accessed via ‘paged’.

Removing content set with :after using :last-child

April 16, 2018

When you use :after to set content, you might then want to remove the content from the last element using :last-child.

I was attempting to do this the other day, and ultimately what I had to do was use two pseudo-elements together.

ul li:last-child:after {
    content: none;

That was the selector I ultimately ended up with.

I’ve just discovered Google Apps Script, and it is awesome

December 13, 2017

I’ve recently stumbled upon Google Apps Script, the Tools > Script Editor option available to certain Google web apps like Sheets. The name “Google Apps Script” is kinda weird and clunky in my opinion, so in this article I’ll refer to it as simply “the script editor”.

One particular way in which I’ve been using the script editor, is to create JavaScript functions that will fetch the current price of cryptocurrencies like Bitcoin, Litecoin, and Ethereum, and then update a spreadsheet with these values. This is tremendously cool. With the script editor you can essentially add much more capability to your spreadsheets. In my case, I’m using it to fetch data from a 3rd party API and keep my spreadsheets up to date with the current price of Bitcoin. Pretty neat.

Once I have the current price of Bitcoin set as a cell in my spreadsheet, I can then proceed to use it in novel ways. For example, multiply it by the amount of Bitcoin that I personally hold, and so on. I can then go on to deduce the exact amount of profit I’ve made, and so on. This basically opens up a lot of possibilities, and I can essentially use this spreadsheet to get more information out of my current crytpo holdings than a service such as Coinbase is able to provide. A service such as Coinbase only provides so much information, it won’t show you your exact profit, your principle, and so on… it’s essentially lacking in terms of information that it will provide to you. However, with Google sheets, and a few lines of JavaScript, I’m able to generate the data that is missing from Coinbase, and get a better idea of how my crypto holdings are doing.

In case you’re curious, here’s the code I’m using:


How to load libraries that depend on the jQuery dollar sign when using WordPress

December 12, 2017

WordPress has its own version of jQuery that you should use. It is generally advised to use the built-in WordPress version of jQuery instead of a different version.

The WordPress version of jQuery removes all definitions of $ from the global scope, meaning, you have to type ‘jQuery’ instead of ‘$’ to use the jQuery library. This is basically so that libraries don’t conflict with each other by all trying to define the $ sign as a variable.

Because of this, you might run into issues where Bootstrap is unable to add functions to jQuery. I ran into this particular problem just today.

I was getting the error message:

TypeError: $(...).scrollspy is not a function

You may get other errors as well, saying `$` is undefined.

What this means is, Bootstrap was expecting the dollar sign to be defined, but it wasn’t, because WordPress undefines it.

The solution? Temporarily define $ and then undefine it.

Essentially, you set $ to jQuery, load the library you need, then unset $ by calling jQuery.noConflict(true), and there you have it.

My thoughts on AWS since switching from my previous hosting provider

November 22, 2017

I’ve recently started using AWS for my website hosting. This website is hosted on AWS in fact. What is AWS? It stands for Amazon Web Services, which is essentially a collection of services provided by Amazon for building and hosting web applications.

My website needs have been pretty small so far, but I’ve switched to AWS anyway to check it out. My bill is actually quite lower since I’ve switched. Funnily enough, my monthly bill comes out to around $1.00. I was previously using another hosting provider, renting a VPS for $10 per month. Quite a reduction in hosting costs.

AWS has a huge variety of services, and seems to work well for websites of just about any size. Even massive web applications that use a lot of bandwidth. The scalability of AWS is another aspect I find appealing about it. In the event that I ever do need tons of servers, I should be able to scale upward pretty quickly.

I’m definitely liking AWS so far. It can feel a little overwhelming with all of the services and options available, but once you get a feel for it it’s quite nice and affordable.

Part of the reason I like AWS is by how you’re billed. You’re only billed for what you use, and so far I’ve ended up saving money, so I’m pretty happy with it.

Should you use WordPress?

November 22, 2017

If you’re looking to start a website, WordPress may be a decent option. WordPress can usually fulfill just about any basic website need you might have, and it’s quite popular and well supported.

You might be turned off by the fact that WordPress is written in PHP. I’ll admit, I was at first. I typically build websites in Ruby or Python, but I’m learning to like WordPress. It’s simple, it’s easy to set up, and it gives me a decent starting point for making a basic website.

If your website is primarily content-driven, then WordPress is not a bad option. If you want a lot of customization, you may want to develop something from the ground up with Ruby or Python.

I use WordPress for blogging mostly. If I wanted something that was more flexible, and I had an idea for a web app, I’d probably go with Ruby on Rails. But for most things, WordPress works great.

Even if you do want to customize some things, WordPress makes it pretty easy to build plugins.

I’d say in most cases, if your website is going to be mainly content (articles, pictures, pages, etc) then WordPress is the way to go.

Free and easy SSL with Certbot

November 4, 2017

There’s this cool website I discovered for getting totally free SSL certificates. It’s called It’s a free service where you can get set up with SSL certificates on your site.

Of particular interest to me was the Certbot¬†command-line tool which you can use to set up SSL relatively painlessly. You select your platform for which you’re running your site, and it provides you with instructions on how to install the software. The tool can update your Apache virtual host entries automatically and set it up so that all traffic is redirected to the HTTPS endpoint of your website. Pretty awesome.

Older posts →