Small Businesses for Programmers

Programming is a super power.

One thing I have discovered is that programmers can use this super power to create things that will make money! In other words you can build a small business. But what types of small business for programmers are there?

Over the last few years I’ve done a lot of research and launched a couple of different experiments that have had varying levels of success. I’m not retired yet, so I obviously still have much to learn.

I want to share some of these ideas from the perspective of a programmer. These are not the only ways to make money, but they are good low-risk and relatively low-cost ways to get started. I’m giving my thoughts on the amount of effort involved and the amount of reward that one could see from them.

Of course, these are just my opinions. More effort applied to these ideas might result in more traffic/money. Or they might lead to no where. But I encourage you to think about and research these things. There’s lots of opportunity out there!

Also, I’m leaving out a really important part of the business process which is deciding which audience you are serving (also know as which niche you are in). This is a CRITICALLY important decision to make early on, but for this article we are going to assume you already have one. If you would like to learn more about this, email me and I’ll start putting together a post with more details.

So let’s dive into a couple of business types!

Data products

For me this is the dream. In a nutshell it’s this:

Find some data (ideally free), add your spin to it, sell access to it.

The best example of this is Eric Floehr of Firecastwatch who took weather forecasting data, compared to the actual weather, and sold the resulting product to allow people to “score” their meteorological data. Genius! Here is a great interview with Eric where he talks more about how he got started.

Another spin on this is to take data that is out there and repackage it into a more usable format. Tyler Tringas did this with his StoreMapper application.

Speaking of Tyler, if you are interested in starting a SaaS business you owe it to yourself to read the book he is publishing online and for free. Others have used it to build their businesses and it is a great read: Building Micro-SaaS Businesses

Pros:

  • Getting data into a database and slapping an API in front of it? I call that a Tuesday morning! Could this be any easier to do?
  • There is tons of data out there, and there always seems to be new ways to combine it.
  • The overhead of running this type of operation is pretty minimal, so the cost (AWS, Google Cloud, etc.) should be really cheap to get started with
  • There’s lots of resources out there to setup and run a DB+API+recurring subscription service

Cons:

  • There’s a million data sources out there, and not all of it is of good quality. So there might be a fair amount of work to beat the data into shape. Depending on your passion for the subject, this could be quite painful…
  • Some data rots. If the data you are selling isn’t maintained (e.g. updated addresses for stores, etc) then people are going to stop making purchases.
  • Not all of your potential customers will want to do some kind of pay-per-query API scheme.
  • If you sell a downloadable version of your data it is possible that you will have a lot of one time purchases (as opposed to a recurring subscription)

I love this business model! There’s something so appealing about a self-service business that just sits there and does its thing. There’s a ton of data floating around out there, and from what I’ve seen a million ways to put it all together into something useful.

To really make this one take off, try talking to other people who run businesses and find out what data they need. This will open your eyes to the possibilities that are out there. New people will being new perspectives and new chances for niche markets.

Drop shipping stores

Drop shipping is basically acting as a catalog. People come to your site, buy something, pay you, and someone else fulfills the order for a fee. Basically you become the middle man and markup the item to make your money.

Pros:

  • These days, most drop shipping sites have an API (or SDK of some type) so integrating them is really easy.
  • There’s a million products to choose from! Any niche you can imagine will have a plethora of products for it.
  • Getting traffic to your site is fairly easy: targeted ads will let you get high quality (read motivated)

Cons:

  • There’s a million people doing this. It can be hard to stand out from the crowd.
  • There’s a million products to choose from. If there’s a hot selling item, a bunch of people will already be selling it. So niching down is necessary, but you need to make sure it isn’t so niche that no one buys it!
  • I think there’s a danger of fads: a hot seller yesterday (fidget spinner) might not be so popular tomorrow. Building up good SEO takes time and it is possible that by the time you are ranking good the wave has passed.

I made one of these (to sell a nerdy poster idea) and it was pretty easy to get up and running. I sold exactly 0 posters though. I think a lot of that had to do with how I was marketing them (more on later).

Even though my experiment flopped horribly, I still really like this idea and will probably revisit it in the near future to try again.

A service provider

Since we are technical people, the thought of running our own cloud based service seems like a nice logical step. Here’s a few examples of this:

  • WordPress hosting
  • A VPN service
  • Basically any kind of server that you can run in the cloud

Let’s break down the pros and cons of this type of business.
Pros:

  • If you are familiar with the technology stack, getting this up an running is really easy!
  • If you can automate large portions of the service (such as self-service provisioning, billing) then it is pretty sweet and low maintenance. Which is really the dream!
  • You can pretty much control how big you want this to be. Small niche service providers don’t have to worry about supporting the whole world. (On the down side, this can also limit your market which can limit how much you can make…)

Cons:

  • Just because something is easy for you, is it really something you want to do in your off time? Running a webserver sounds easy, but when it goes down on Black Friday and your customers start calling you wanting to know why they are losing sales… things could get stressful quick.
  • Someone’s business might depend on your service… That’s kind of a stressful thought. Some people who go down this route wind up being on call all the time. That is quite a commitment, especially compared to doing that same work for an employer: at least they have a team to make sure things stay up and running.
  • People tend to underestimate what it takes to take on an established provider. For example, if you are making a competitor to Dropbox, what do you offer that should make people choose you over them?

I’m technically running a WordPress hosting service at the moment. (I wasn’t intending to, but long story short, it just happened…) Once I got the initial configuration stuff figured out its been running pretty smoothly.

This isn’t a money maker for me, but I’m also just doing the bare minimum to let it run on its own. With a couple hours of work, I think I could automate more of it and make it more secure, etc. and at least get it to the point where it generates a fair amount of money per month for me.

Affiliate links

Affiliate links are basically a way for you to get credit for someone buying something. Its like saying “Hi, Nick told me to buy this book” and then the book seller giving me a few pennies for the purchase.

There’s several different sites out there where you can get an affiliate link, but lets talk about the easiest one to get started with, Amazon.

I don’t want to go into detail about how to setup your account with Amazon, do a search for that to find out how easy it is. The important thing I will note is that with Amazon, if someone clicks on your affiliate link and winds up buying something other than what you listed, you will still get credit for the purchase. That is pretty awesome.

Once you have your affiliate account setup, then all you need it a way to get your links in front of people who will click on them. If you have an audience already (like a blog, or a large-ish following on social media) then those are the people that will be your targets.

Find out what they are most interested in, create links to those products. Then with those links you can do things like this:

  • Create reviews of products where you pepper in those relevant links. (The idea is people read the review for your expert take on it, and then can go and buy something letting you get credit for sending them shopping.)
  • When ever you send out a link to an Amazon product, use your affiliate link. Example: If you are sending a friend a link to a tent you are thinking about buying, send the affiliate link. Yes, this is kinda sleazy and low volume. But if the link is going to get shared, its kinda neat to see what kind of credit you might get for sending it out.
  • Respond on social media to people asking “What’s the best X for Y?” This is super easy to automate. More on that is a second.
  • Make a bot that spews out these links on Twitter. I have 2 bots that are each tailored to different audiences. Every so often, those bots will inject an Amazon link to a book or a tool. As those bots grow their audiences, those links get more eyeballs and a higher probability that someone will click on them. This is a hands off thing that is just cool to see working. For an example of this, look at this twitter account (which reportedly is making quite a bit of money per month) https://twitter.com/48tweetsofpower

Automating this

Twitter is fun and easy to automate. For the affiliate links, you could setup a rule on If This Then That to listen to twitter for a certain phrase like “Best cell phone case”. You can then setup if IFTTT to respond to the tweet with a tweet from your account that says “Oh my favorite case is this one, it’s awesome!

This will result in auto-tweeting your link(s)! This is kinda neat, you could be making money without you having to do anything. I think this will appeal to a lot of developers like myself because it can be coded up and then measured and tuned for optimal performance….

Disclaimers

Since there’s no such thing a free lunch, I feel I should mention some of things:

  • Twitter supposedly doesn’t allow the same tweet twice. The example in the automation section above could result in your account getting blocked, etc.
  • People generally don’t like talking to robots, so if your search (and your product your’re recommending) is too general then people are probably going to be more likely to report your account for spam.
  • On the flip side, if your search/product is too niche, and no one hardly ever talks about it… your not likely to get a lot of traffic to your link.
  • While there is real money to be made, I think most people will not make a lot with this approach. For example, I have a small audience for both of my bots and they only make about $5 to $10 a year with this. Without investing some serious effort into growing the target audience, I would not expect to get rich this way.

The dirty “M” word that makes it all work

I’ve mentioned a bunch of ideas for making money, but I haven’t mentioned the one thing they all need to make it work… marketing.

Most developers think that marketing is a dirty, sleazy word. Well, the truth is, if no one knows about your offerings, then you are never going to make money. And the only way to let people know about you is to… tell them.

Yes, you could wait for SEO to kick in and bring floods of traffic to your site… But I’m going to be honest with you: for that vast majority of us, that isn’t going to happen. You’ll get some traffic, but you won’t make any money.

Think about this: big companies like CocaCola spend huge sums of money on advertising make sure you (and everyone on the planet) is aware of them. They also make an enormous amount of money every year. Coincidence? I don’t think so.

So, my message to you is learn some basic marketing skills. You don’t need to be an expert in any of these skills, but learning be basics of each will help you move the needle so much it isn’t funny. These skills:

  • Basic copy writing techniques (AIDA, Pain points, etc)
  • Basic writing skills (formatting, passive vs active voice, etc.)
  • Basics of how online ads/landing pages work

are easily google-able, and there’s a ton of free content out there to show you the ropes. If you want a really good introduction in one easy to read document, I highly recommend my friend Justin Jackson‘s book Marketing For Developers. It is a great way to get start, Justin supplies a ton of ideas and practical examples that you can copy and get going with quickly.

Justin also offers a course where he shows these techniques in more detail. I have bought both and have really gotten a lot out them. I highly recommend them.

Small business for programmers: so many choices

For the plucky programmer, there’s a bunch of choices out there for starting a business.

Do some research, see what resonates with you. And most importantly, try a small experiment! Most of the things I’ve talked about here are low-cost, low-effort things that anyone can start pretty quickly.

As a last bonus link, check out the Startups For The Rest Of Us podcast. It is hosted by two developers/entrepreneurs who offer their experienced take on various topics in this area. Scan through the titles and pick one that sounds interesting and give it a listen!

Remote Matcher journal #1

This is something new I’m trying: a journal recapping the work I’m doing on Remote Matcher which is my current side project. My goal with this is to do some public accountability so I’ll keep moving forward on this project.

(Real talk: I’m passionate about the idea behind the project, but I seem to have some kind of mental block about getting work done on it. These blog posts are meant to apply pressure to me to report my progress publicly and move the project forward)

Over the next couple of updates I’ll include a section on the “who/what/why” of this project. This update is all about just noting where the project is.

BLUF

(Bottom Line Up Front)
After a hiatus of many months, I have restarted work on Remote Matcher. The current focus is on reducing technical debt and growing this into a real side business.

Technical debt issues

The project is built on the foundation of a previous project. As a result, there is a lot of “dead” code that is been dragged around. Last weekend I started addressing this by adding in tests for known critical paths, refactoring obvious pain points (Python pro-tip: don’t execute code at the module level, it makes huge pains when the module is imported), and deleting things that were clearly not being used.

The end result: the code coverage jumped to almost 70% and more importantly it covers some critical areas. Deploying this code in a test project over the week has confirmed everything seems to be working correctly.

Lessons learned

  1. Running the project in a parallel system (Where I’m the only subscriber) is a great idea. In the morning I can compare the emails the two systems generated and quickly tell if something isn’t quite right.
  2. It is amazing how quickly adding tests revealed some problems in the code base. Some problems were “quick” to fix, such as the import issue, others will need to be done in the future (before more features are added in those areas).

Growing the business

I had an unusual thought this week after seeing 2 or 3 people unsubscribe: If this site is doing its job people will be unsubscribing. (The goal is to help developers get their ideal remote job so there’s no need to stay subscribed after that happens!)

I might need to add some kind of metric to track how long someone was subscribed to judge if their time in the system was good or not. There’s already an exit interview (which has a very low conversion rate), so adding a new metric will be useful at some point.

Adding users

I turned off the Twitter account this week. It needs some work to improve its quality and I just don’t have the bandwidth at the moment to mess with it. I am going to address this in two weeks.

Until I get the tech debt paid down and 1 new major feature (more on that in a future update) shipped I’m not going to spend a lot of time on user acquisition.

Making money

The point of a business is to make money. I have parts and pieces of this but they all need to be put together and polished. Shipping this is a priority for September.

Next steps

  1. New production deployment (now that staging has been validated)
  2. Address HTML scrubbing bug (not user-facing, but it is a blocker for #3)
    a. This is going to require a light refactoring of some of the parsing code in order to isolate the trouble spots
    b. MOAR tests will be added.
  3. Phase 1 of tagging improvements (tag extraction from untagged data)
  4. Create OKR’s for this project.

For #4: I’ve been reading Measure What Matters and implementing OKR’s at the day job. It seems like a really great way to get a project moving, and I’m anxious to see if it can improve my efficiency.

Recent reads

Lately I’ve been spending a lot more time reading. There’s a ton of ideas out there, along with a bunch of garbage. (Translation: Don’t read the news kids)

Here’s some things I’ve read and found interesting. These are things that have been catching my interest lately, including the IndieWeb movement, thinking, tools, and just being awesome.

IRC

IRC (Internet Relay Chat) is a really old technology. Think of slack, but without emoji and gifs.

But in that simplicity lies some great power. I recently ranted about my new fav tool Glowing Bear, and I keep finding that the tools and ethos around IRC jive really well with what I want out of networked computing.

Here’s some things I’ve read along those lines:

  • Why I Live in IRC – This is kind of the direction I’m moving now… I’ve got several slacks integrated into my IRC program. Home Automation projects chatting over IRC is next!
  • What Really IRCs Me: Mastodon – An example of getting disparate services into one place with IRC

Also, as a side note (and related to the section below), Mastodon is really interesting. I’m expecting that it will continue to gain popularity as sites like Twitter continue to struggle with their… issues.

IndieWeb related

For years I’ve wondered about giving our thoughts to other’s platform. If I think of something and type it up, I put it here on my blog. If I put it on medium.com or Facebook, then they could take it down at any time.

I like the idea of owning my words, and the IndieWeb movement really appeals to me. I am working towards implementing more of the tools they are putting out.

  • Together – This is a new tool that looks like a great way to tie together several sites into one unified view. I’m becoming more aware of the time I spend on-line, and this looks like a great way to get it consolidated into one spot.
  • An IndieWeb reader: My new home on the internet – An older post that talks about the predecessors of the first link
  • Into the Personal-Website-Verse – A great read about how the internet should be (vs how it is)
  • IndieWeb – The clearinghouse for more information on this movement

Just awesome ideas

Here’s just some links of things I’ve run across that just have me star struck.

  • NEW APPROACH COULD SINK FLOATING POINT COMPUTATION – A new way to handle numbers in a computer? Very interesting challenger to the established IEEE standards we all are relying on today.
  • Reilly’s Hardcore Year – Great story unfolding of a guy who is just going for it and building a business in public
  • Scott H. Young – Scott is just an all around interesting guy. Check out that link to see all the things he is up to (ultralearning, memory, just being the best you that you can be)
  • Notion – This newish tool is a great competitor to Evernote… It combines a lot of great ideas into one spot in a pretty well put together package. Plus it let me use Markdown to edit things!

Wrapping up

One more quick link: I’ve been working on reading more lately and after seeing a cool site by Harper I was inspired to make my own page to show off what I’ve been tracking on Good Reads. Here’s my Reading List.

What cool things should I be reading? Leave a comment or hit me up on twitter!

Have a plan when traveling

This is as much a note to myself as anything. Hopefully someone else will see this and get some value from it.

In theory, I love plans. In practice, I don’t do them nearly enough.

Recently this was illustrated to me while on a business trip. Normally I’m very “go-with-the-flow”, but recently I’ve discovered that when I compared my past trips to people who took the same trip my experience was quite different from theirs.

A quick analysis revealed that my relaxed approach to my trip resulted in a lot of “lost” time and opportunities. I wasn’t being intentional with my efforts so as a result I had a very so-so time. Or worse, didn’t see anything exciting and new.

So now when I have a trip I’ve learned to make a rough itinerary of when/where I need to be, and then look to see if there’s anything interesting I could do in the time between events.

Example Scenario: You are going to fly to a new town for 3 days of training. The training takes place 4 blocks from your hotel, and from 9am to 4:30pm. This leaves a lot of time in the afternoon/evening that could be wasted if it is not planned. Also on the last day your flight leaves really late in the day. So what should you do?

Here’s how I’ve started approaching this:

  • What restaurants are near the 2 locations? What 3 looks the most interesting for dinner? (Go ahead and pencil those into your schedule)
  • Are there any interesting attractions within a few blocks of either location? Try to find 3 things that would be cool to see.
  • Are there any landmarks (baseball stadium, museum, bookstore) that would be awesome to visit? Write those down

At this point you have a bunch of options!

Making a decision

So, now with your list of things to do if you ever reach a point where you don’t know what to do (or eat), just look at the list! You can decide to do something other than what is on the list, but at least now you will have a starting point.

For me this solves the greatest problem: coming up with something on short notice. It is much easier to choose from a menu of options than it is to conjure up something new on the spot.

Having too many choices can be paralyzing. Even a little bit of list can act a guide post to get you to something quickly.

And remember: Just because it isn’t on the list doesn’t mean you can’t do it. The list is just there to keep you from sitting around doing nothing.

Because doing nothing is the worst. Action. Always take action.

Recent tools I’ve discovered

Every now and then I come across a new software tool that makes me stop and say “How in the world have I made it this far without this?!??” Today I’d like to talk a little bit about some recent discoveries, maybe they can help you too!

I no longer ack, I ag

I’m a long time lover of grep. When I was first introduced to it I thought it was pure magic. For YEARS grep was my go-to tool for any kind of text searching.

A few years ago someone showed me ack which is advertised as a better/faster grep. It took some getting used to, but I pretty quickly decided that it was pretty impressive. Especially as I started working on larger codebases. Its speed combined with the colorized output won me over and it became my standard text search tool.

But… there was also another tool that was claiming to be even faster than ack. This tool is called ag (also known as “The silver searcher“). In my first tests with it (years ago) I found it to either be the same speed or slower than ack, so I never really paid much more attention to it.

Enter a huge codebase

Eventually I wound up working on an enormous codebase that was peppered with a bunch of different languages and data formats in it.

With this new project I quickly discovered that ack would bog down and take a long amount of time to return results on my searches. Since it had been a while, I decided to try out ag and see if things had changed.

Oh my, things have changed. ag is BLAZINGLY fast for me on this massive application.

It took me a few days of concentrated effort to force myself to type ag when I did searches, but with every lightning fast results I found myself loving it more and more. It is now my default tool for searching text. It is awesome.

The lesson here: Try out new tools every so often. You’ll be surprised that sometimes there’s better solutions out there, and don’t be afraid of the learning curve! If it improves you daily workflow, it is worth investing some time to get it setup and into your skillset.

Instead of cat, use bat!

Speaking of new tricks, I’m intrigued by the language Rust. I’m not quite ready to learn it (I have no good use cases for it at the moment), but I did discover a utility that is written in Rust that is very awesome: The paging utility bat.

A paging utility is a program that can show one screenful of text at a time. Most people use something like cat or less for this. If you are an unfrozen caveman such as myself you might use more. At any rate, bat is a new take on these utilities and is incredibly beautiful to use.

Screen fulls of text can be pretty plain, and if you are looking at something like json, xml, or yaml files it can get kinda confusing quickly. batcan recognize certain file formats and apply syntax highlighting rapidly so you see something resembling what you would see in your IDE.

I like syntax highlighting so much that I decided to alias more to be bat so that I’ll use it when ever I need to look at file, batwill try to interpret it for me to make it more legible.

For all my raving about it, I have had some relatively minor problems with bat, specifically with very large files or certain extensions I’ve found that bat can run really slow. Thankfully these are few and far between and the developer of the tool has been very helpful with troubleshooting these issues.

Chat everywhere with weechat

IRC is one of those technologies that I’ve alaways felt like I should be more into. I love text based chat programs. Over the years I’ve used ICQ, AIM, Yahoo, gChat, and now Slack. But for some reason IRC just never really stuck with me.

Well thanks to weechat, I’ve now got an interface that I can use that makes IRC more usable. Color coding, a good layout, and the ability to write plugins make weechat a joy to use.

One of my favorite uses of weechat is to put certain Slack groups in there. This way I can keep an eye on them without having to to load them into my desktop Slack app (or open yet-another-Slack-tab in the browser).

I’m not doing a good job of explaining why this is so awesome… I think it comes down to reformatting. Slack has a lot going for it visually, but sometimes I just need something similar. As in less flashing emoji or animated gifs. Weechat does a good job of condesning these messages down to a more simpler format (just colored text).

One powerful advantage of weechat and Slack: You can have multiple threads open at once, and have them split across different window panes in the UI. Slack doesn’t let you do that, and honestly most of the time you wouldn’t want to do that.

But… when you have one of those times where there’s 2 important conversations going on (or god forbid you are being @ mentioned in multiple spots at the same time) it is really useful to be able see everything going on at once.

Next level weechat: Glowing Bear

For a while I’ve thought that to support my desire to get more into IRC I would need to setup a bouncer like ZNC and everything else to support that.

Long story short, I wasn’t winning that battle. I had one setup for a little bit, but failed to backup my configs and when I had re-setup everything it proved to be too much of a pain in the ass.

Recently I discovered a project called Glowing Bear. At first I thought this was another client/bouncer, but then I discovered it is actually a clever way to interface with an existing weechat session. It basically turns your text-based weechat into a living webpage! (Think of it as accessing a slack group via a web browser vs the Slack app.)

Because of the effort I had gone to in setting up weechat the way I wanted, this seemed to be something worth trying. And I was so happy I did try it, because it is dirt simple to use, and look ABSOLUTELY BEAUTIFUL.

It can display tweets and images inline (and collapse them back!), and it is fast and responsive and just plain looks good. It also works great over a mobile phone connections (its just a simple webpage), so now I can access my IRC and Slack conversations on the go, just like I can at my desk. That’s really awesome.

And the best part? I can cut out the ZNC middle man and just have it talk to weechat! Simplicity!

Final thoughts

Every year you should take a look at the tools you are using and ask yourself “Is there a better way of doing these things?” and spend a little time investigating.

I’m not saying through out your tools, but you should look at them make sure they are as sharp as possible.

And if they are dull, go find new ones.

2018 Review

Another year done, so let’s review! At a high level 2018 was a pretty great year for me. To despite a pretty big set back early in the year, by taking consistent action I finished pretty strong and managed to live up to a lot of my potential.

For 2018 I decided to make the theme “Action”. I chose this because in the past I felt like I spent too much time in analysis mode, and that prevented me from actually doing.

So this year ever project that I started was viewed from the lens of “how do I make this move forward”. The results were pretty good!

The bad stuff first

I don’t like to focus on the negative aspects of the past year. It is such a cliched and unproductive thing to do, yet everyone on social media will be the first to tell you how bad the year was.

Whatever. Bad shit happens to everyone from time to time. How did you respond to it? That’s what matters.

For me, the year started off rocky due to being laid off from my day job at the beginning of February. Not an ideal way to get things going, but it did open some doors I didn’t expect…

New projects, new ideas

As I started a job search it occurred to me that I should make a list of what my dream job would look like. Doing this lead me to (re)discover the idea of remote working.

I absolutely despise sitting in traffic. For me, it induces stress like no other activity can. Why should I do this if it causes me so much non-joy?

So I began to look for remote-first jobs. To help me do this I wrote a small web app that I quickly realized could be expanded to help others in a similar situation. Thus Remote Matcher was born!

Side note: I eventually found the perfect remote job for me! Sadly I did not find it though Remote Matcher. That would have been too perfect! ūüôā

I continued to take action throughout the year and launched a few more projects. None of them turned out the way I wanted them to, but as was pointed out to me by a good friend: I produced a lot of things this year and learned a ton in the process.

Travel

As a family we decided that we needed to do a little more traveling now that the kids are older and can appreciate things more. As a result, there was a ton (for me at least) of travel over the summer. 3 major trips, and several smaller one helped us broaden our horizons a little bit.

This coming year will probably see more local/regional travel.

The goals for 2018

I started off the year by making several goals/objectives for me to achieve. As the year progressed I visited these often and in one case refined the goal a little bit to make it more actionable and measureable.

Here’s a quick run down of what this looked like:

Business revenue

One goal was to increase business revenue to the point that it was a stable secondary source of income. For a variety of reasons, this didn’t happen.

I learned a lot, but overall I am disappointed by my lack of progress here. Every day is a new chance, and I am determined to reverse this in 2019.

Health

My health is becoming something I am paying more attention to as I get older. There’s a million benefits to this that I’m not going to go into other than to say this: Its easier to keep good health than to get it back.

To this end I significantly improved my exercising routine over last year. By the end of the year it was clear how I could take it to the next level, so that made setting a 2019 goal pretty straightforward.

(Of course right after I did that I caught the flu and was not able to do anything physical for the last few days of 2018. So 2019 hasn’t started as strongly as I would like, but hey that’s life. Adapt and move on!)

I also made a goal to meditate on a regular basis. This is one of those habits that gets dropped in time crunches, and after a year of reflecting on this I see it needs to be a priority.

Again, there’s a lot of reasons to do it, and for me they are pretty solid. Already this year I have been making the change to get mindfulness into my daily routine.

Quality time

One of the main reasons I chose to work remotely was to increase my time spent with my family. My kids are at the age where a little bit of guidance and presence will go a long way in shaping the people that they become as adults.

I’m happy to say that while I didn’t hit the metric I set for this goal, I did come really close. And this is one of those things where any work is good work, so overall I am really happy with this.

Results

Overall I did pretty well with my goals. I didn’t hit the numbers, but I was pretty consistent throughout the year in working on them.

Also, having the theme of “Action” really helped me. A few times a month I would look at my goals and see the word “Action” at the top.

As corny as it sounds, seeing that and thinking about it got me to take action more times than no.

And let’s face it, action is what we need if we are going to accomplish anything meaningful in life.

Looking ahead

In 2019 my goals are still focused on the same areas, just with more specifics on the actions I need to take to achieve them.

I did add one more area, reading.

I have come to the realization that what I read makes a huge difference in my mood and motivation. So this year I am adopting the habit of reading for 20 minutes per day of non-junk information. My outcome for this is to become more curious and knowledgeable about the world around me.

So this year’s theme for me is: unstoppable.

In the past I have let things get in my way or even cause me to backtrack. This year, as I face challenges, I will tell myself that I am unstoppable.

Much like the theme of “action”, I look forward to being “Unstoppable” as I progress further on my journey to a better me.

Wrapping up: Take action

2018 was a great year. Don’t let others negative opinions infect your view of your world.

2019 is going to be a great year for me. I’ve already decided this, and I’m not going to let external voices change my mind.

Hacking on Hacktoberfest

Hacking on Hacktoberfest

Have you ever wanted to contribute to Open Source software but weren’t sure where to start?

Do you like winning T-Shirts?

Then I have something for you!

What is it?

Hacktoberfest is a month long celebration of open source software and specifically about contributing to the packages we all use.

It is a great chance to jump into open source and contribute back to it! It is a great way to improve projects or to learn a new skill. The best part is you don’t have to be an expert or a developer to make a contribution.

How can I help out?

It is super easy!

One misconception is that you have to be a developer in order to contribute. This isn’t the case! There’s plenty of need for documentation, testing, and just plain discussions.

This year I decided to try and learn a new language by working through an issue (or two) for Hacktoberfest. I have been really curious about
and JWT. I noticed that the Clojure library for JWT had some features that were missing.

As it happened, I also was able to do some Pull Requests for some work related libraries which was a really nice bonus!

How do I find things to work on?

If there’s any programs or libraries you use on a regular basis, I would encourage you to go check those out first. The issues tab and see if there’s anything there that looks interesting!

Some project will mark issues with special tags like “hacktoberfest” or “beginner” and those are great issues to look at first. They typically are things that would really help the project so if you can jump in there it would make the world a little bit better.

One of the lesser known things about GitHub is the powerful search engine. It can be used to find a lot of different things such as specific code chunks, or conversations about a topic, or even specific types of files!

We can use this to find all kinds of interesting and easy-to-work-on problems.

For example you can search for issues labeled “hacktoberfest” to see things that maintainers have specifically marked as being a good for contributing.

Searching pro-tips

Here’s a good base search to help get you started:

https://github.com/search?q=label%3Ahacktoberfest&state=open&type=Issues

This search will look for any open issues that are labeled “hacktoberfest”. As I type this there are over 29,000 open issues!

To help narrow it down, try selecting a language from the list on the left side of the screen. This will narrow the list significantly to only the language you are interested in.

I used that to look for Clojure and Python issues which helped me get to interesting problems faster.

Bonus tip: If you are nervous about contributing code, many project also welcome documentation updates! Try searching for commonly misspelled words and you will find tons of repositories that you could make a pull request to.

Wrapping up

Open Source software is awesome. If you know it or not, you are probably using it right now.

Why not try and contribute to it? Its easy, and can be a lot of fun!

And winning a free t-shirt is always awesome. ūüôā

A lite refactoring with PyCharm

Inspired by @levels I decided to try adding a Telegram integration to my current project RemoteMatcher. After seeing it work in production I decided to expand on the idea a little bit and do some refactoring with PyCharm.

Let me show you how this all evolved and how easy it was to make this into a reusable bit of code.

TL;DR; Here’s a video of me using PyCharm’s refactoring tool

Just getting it working

The initial challenge was to get my app to send messages to a private Telegram chat. Telegram has a reputation for being easy to integrate with because of its HTTP based interface.

For me this was pretty ideal: All I want is to post a message once my daily task runs. Since we can talk to Telegram via HTTP, there wasn’t really a need to use a full fledged library (and increase the dependencies for the project).

The hardest part of all this was getting the bot to post to the private room. Once I got that figured out, I was able to post things just using cURL. This is a good sign: It means we can use the regular urllib code from the Python stdlib.

Here’s a rough outline of the steps I took to make this happen: * Create a telegram account for myself * Create a private chat * Create a bot account * Add the bot as an administrator for the private channel * Use cURL to confirm the bot can post things to the channel * Translate the cURL code in to Python

Working first, then refactor

The part of my app I’m interested in runs only once a day, so after testing I needed to wait overnight to see if the results were what I was looking for.

Of course things weren’t 100% the way I liked them the first time, so I did some small tweaks (mostly formatting of the text) for the next run. After 2 days I was pretty happy with results!

My objective for this task was complete. I could now check the status of last night’s jobs without having to log into the GCloud logging interface.

Having this nice consoladated information delivered to my phone got me thinking, where else could I do this type of reporting? I quickly thought of 2 more places: new subscribers and unsubscribes!

But to do this… Did I really want to copy and past the same 6 lines over and over? Hell no!

PyCharm to the rescue

When I worked in Java one of the things I really liked about the Java ecosystem was the strong support for refactoring tools. IntelliJ has great support for this essential Software Engineering task, and thankfully PyCharm inherited many of these capabilities.

I was able to use the “Extract Method” feature to pull out that code into a function, and with a quick modification to the parameters I made a very reusable function.

I also used the “Refactor->Move” feature to rearrange the code a little bit and put my new send_to_telegram function to the util.py module. This cleanup move resulted in a cleaner looking module that is more focused on one task. (SOLID anyone?)

Showing, not just telling

The end result of all this?

Showing the result of refactoring with pycharm: a nice status report in telegram

The next morning I woke up to a telegram alert showing me that some people got emails with job leads last night!

It also gave me an alert that someone had unsubscribed after getting that email.

standing-in-the-rain-crying.gif

Although this was a pretty small refactoring in the grand scheme of things, it was great to see the PyCharm tools in action. Honestly, the hardest part of this whole thing was figuring out how to get the bot to post to the private channel. Everything else was really easy!

Here’s a video I made of me doing this fun little task:

Here’s a video of me using PyCharm to tackle this fun little task:

Wrapping up

I hope you liked this little peak into making a quick-and-dirty telegram integration to improve reporting!

If you are looking for a remote programming job, check out my free aggregator: Remote Matcher

Using functools.partial to refactor repetitive code

The other day a friend made a comment about iterative development and it got me thinking. In some situations this is a good approach to get things going, but there is a dark side to it: Crufty nasty code. Functions that we are fear to touch. Code that screams out to for a refactoring.

It got me thinking about the code I hacked together for Remote Matcher. It’s shiny and new, but does it have a dark side?

How bad could it be?

For this project I developed “iteratively”, and I decided I needed to stop and see what shape the code was in. In my views.py¬†file, it definitely needed some attention, and not just because there were todo comments saying “THIS IS TERRIBLE. PLEASE CLEAN IT UP”. (I literally put that in the code. Twice.)

Here’s a quick enumeration of the sins of this code:

  • Repeated strings (like, we check for a string, then go and use that string again on the next line)
  • A bunch of elif¬†statements that grows every time a new data source is added
  • There are several long constants that get import‘ed (and they will grow every time a source is added)
  • The same 2 functions are called over and over, but with slightly differing parameters
  • Although this file is called views.py¬†it sure looks like there’s business logic that’s starting to leak into the functions… even though we have a dedicated module that is supposed to handle that logic!

And that’s in just 25 lines of code.

facepalm.gif

Clearly things need to change. I have 2 new sources I want to add to the system and the thought of that causing that function to grow at least 4 lines really made me mad.

The strings could be consolidated, but that wouldn’t help with the leaking of logic, or the growth of the if¬†statement. Usually I’m ok with a little bit of repetition in code, but at this point we clearly spiraling out of control. I kept thinking if I could get this code into a dict¬†and then do a lookup I could probably help get this code under control.

As I thought more about this I had a flash of insight: I could use Python’s functools¬†module to help with the function invocation!

I decided to take a swing with the approach and it worked! Rather than try to explain what I did, I made a video showing my approach. Here’s me walking and talking my way through this refactoring:

Parting thoughts

Although the total line count didn’t go down tremendously in the video, the code in the views.py¬†file is on the path to getting more streamlined and having less of business logic laced into it.

The root cause of this was me hacking on it to “just get it working”. Since I knew I was going to have 2 similar but different data sources I didn’t put a lot of thought into “correct” software architecture principals early on. Thankfully I revisited this code before it got too nasty.

So, the moral of the story: revisit your code and look for opportunities to simplify and consolidate things. That and Python’s functools¬†module is pretty awesome! A lot of things like partials sound like magic, but when you need them they work perfectly.

Testing AppEngine cron jobs locally

Lately I’ve been doing a lot with Google AppEngine. It has a lot of great features, but to get those you need to give up a few things. Sadly I discovered that included the ability to locally run “protected” API endpoints. At least until I discovered this one strange trick to make everything work…

The setup

So AppEngine applications need an app.yaml file that defines a lot of things needed to run the code. It is also defines the routing for the app’s endpoints, and who is allowed to access them. (Basically either administrators, or the whole world)

My app is making use of the cron.yaml file to periodically ping certain endpoints in the app. The catch is that I don’t want just anyone hitting those endpoints, a bad actor could hammer that sensitive endpoint and kill my API access.

Did someone say "Bad Actor"?
Did someone say “Bad Actor”?

Thankfully, Google recognized this and allows you to setup endpoints in the app.yaml file with a login: parameter. Setting this to “admin” tells AppEngine that only logged in users who have admin rights to the domain are allowed to hit that end point.

Yay! I don’t have to write any custom login/user management code. But….

The problem

If you are running the code locally, say doing development, you are probably going to need to hit those end points to make sure the damn thing is working. Right?

Well, the dev_appserver.py script doesn’t know about who is and isn’t logged into Google… because it is only running on localhost! Therefore having the login set to “admin” means you will never be able to access that endpoint.

Boo Hoo, HTTP 302 for you.

So, what do we do? Commenting out the login: field will let you access it locally, but what if you accidently deploy that into production? (Spoiler alert: You are :screwed:)

Run to the console

Although dev_appserver.py is the cause of our problems, it also turns out to be the solution too!

When dev_appserver.py boots, it not only starts your app, but it also starts a lightweight admin app too. This app by default runs on localhost:8000 and provides all kinds of useful tools like a DataStore viewer and… a cron utility!

Going to localhost:8000/cron brings up a page that lists all of the (AppEngine application) registered cron jobs, what schedule they are setup to run on, and…. wait for it… a…. button to kick off that job!

Yes, by clicking on that button the admin console will trigger your cron job for you so that you can run and see the results locally! Yay for debugging locally not in production!

Other tricks

The admin console is pretty awesome and has lots of other useful tricks up it sleeves. Here’s some of what I use it for:
* Doing quick checks on entities stored in the DataStore
* Faking incoming XMPP and SMTP messages (I’ve never tried this, but it looks pretty cool for one off testing)
* A memcache viewer/editor
* An interactive console

That last one is pretty sweet. Since I can’t seem to startup an IPython terminal AND connect it up to my app, this is the next best thing. From the webpage it will let you type in some Python code and it will execute it for you.

Perfect for those times when you just want to delete all of your entries because you had a horrible misspelling in one of the field names.

Not that I’ve ever done that.


If you are curious to see the app I built using AppEngine, check out RemoteMatcher! It is a remote job aggregator that scans a bunch of job sites and only emails you the ones that match your interests. No more scanning tons of boards, instead just check your inbox for the best matches.