Monthly Archives: October 2016

On Writing Successful Fart Apps

touch-bar-hero-large

Last Thursday, Apple held an event where they announced a few things, including a refresh of the Macbook Pro line that killed all of the good ports and added a touch bar to replace the function key row. I was actually in a meeting during the announcement but I had heard of the touch bar through a story about a leak. Someone on Twitter put a bounty of $5 on the first fart app for the touch bar and a friend retweeted it to me.

If you know me, you know that I like writing stupid apps and basically making a mockery of the Silicon Valley trope of “making the world a better place.” Specifically, the fart app genre appeals to me as a way to subvert the app ecosystem and make it a little more dumb and weird. The tech industry in particular takes itself way too seriously. In a way, I’m emulating my Computer Science hero Monzy, who created projects like “Pantscam” and  a program that morphed people’s faces into butts (which I can’t find the archive of at the moment), all while being a successful nerdcore rapper. While the things he made were somewhat stupid, you can’t deny that the technology was actually pretty cool.

Writing fart apps is also a great way to learn about a particular platform. If “hello world” is the simplest app that you can write in a language, a fart app is the simplest non-trivial app you can write, since it touches the UI, the file system and whatever mechanism there is for playing an audio file. In the past I wrote some fart apps for Google Glass and the Apple Watch, which were small enough projects that I didn’t get bored and abandon them, plus I learned something in the process.

So anyway, on Thursday I got home from work and installed Xcode 8.1 on my computer. I ended up needing to get another update for macOS Sierra to get the simulated Touch Bar to show up as well. I looked at some sample code, figured out what I needed to do to write the app and finished in maybe an hour or two. It was a good exercise to get reacquainted with macOS development after I stalled on a project I started a few years ago. I pushed the repo to Github, made a demo video and took a screenshot and sent some tweets to the Twitter user who requested the app. I also sent it to some other Twitter users who made similar requests, not expecting anyone to write a fart app less than 12 hours after the hardware for it was announced.

On Friday, I posted the Github repo to an iOS developer community on Slack. That’s pretty much all the “promotion” I did. At some point that day, someone posted the project on Product Hunt (good call!) and it kinda just sat there. I went out of town during the weekend but I noticed someone had written a story about the project on Cult of Mac. I figured that would be the apex of my touch bar fart app’s story. At some point during the weekend though, I got a tweet that the Product Hunt entry hit 100 upvotes. Then a few more stories were written today and my project was even mentioned in NatashaTheRobot’s Swift newsletter. I’m guessing that today will be the real apex of this fart app and it’ll slowly be forgotten like my other fart apps before it.

So what have I learned from this and previous fart apps? One is that some people take themselves way too seriously to enjoy a good fart app. For example, this person:

First, I’m not a kid. My job title has senior in it which must mean something! Also, I have a day job and writing fart apps (a.k.a. learning stuff) is my hobby. Finally, thanks to this hard-hitting piece of journalism, we see that even fart app writers can eventually move on to greater ambitions.

There’s also this killjoy from Product Hunt:

While I can understand the sentiment that there could be better tech things happening, I also don’t think it’s realistic to see a new Snapchat or Twitter released every single day. Friday was a slow day, so a fart app won! And is it just the subject matter that makes the project immature and pathetic? Like, would a British PM Soundboard be any more appropriate?

Bottom line is that this project only took a couple hours out of my free time, which I would’ve probably spent playing a JSRPG anyway. I suppose you could argue that the nonexistence of my app would’ve caused fewer people to waste time discussing it, but I can’t really control how other people spend their time.

One cool thing that’s come out of this project is that someone has already forked it and made a soundboard project out of it. This is sort of the whole point of writing an open source fart app: establish a codebase that people can check out, learn from, and maybe even extend into their own thing. I knew from the start that my app wasn’t going to make it into an App Store. I do believe that the Github repo was the first (public at least) to reference the NSTouchBar class.

Finally, if you are reading this blog post thinking: “hey, I’d like to be known for making a fart app instead of one of many other useful contributions I’ve made to this planet!” then here are some tips! First off, you need to actually be the first to market on the fart app scene as interest will surely wane as the second, third, fourth, etc fart apps written for the technology are released. Unless you add something really cool, like actual fart smells in addition to sounds, then you probably wanna rush your fart app to market. Second, you’ll need to market your app with some kind of video. When building for cutting edge hardware like the touch bar (which no one has yet) or Google Glass (which literally no one bought),  you can assume that no one will have the hardware or be interested in installing your app, so just make a video! In my experience it helps if you mumble a lot. Finally, share your code by making it available on Github and attach a generous license to it. I used the MIT license but put the wrong year because I copy-pasted it from another app. But I guess my mistake was relatable because more than one person commented on that commit! Your app won’t be worth anything anyway, so you might as well share it.

I hope this post has helped explain my motivations for making a touch bar fart app. Partly it’s to prove that I could, and partly make a cool $0.03 on the video ads.

P.S. Apple, if you are reading this, please do not ban me from WWDC over this. I promise to write some software using one of your new frameworks for non-fart applications!

Building a DIY Off-Grid Solar Bank on my Roof

I’ve been fascinated with solar energy ever since I was a kid and my brother had a toy with a motor attached to a mini solar panel that you could run under a strong light. In recent years, solar panels have come down in price and now seemed like a good a time as any for me to experiment with it a bit. I took a week long staycation from work a few weeks ago, and in preparation, I did a bunch of research and bought a ton of components to set up an off grid solar thing.

I chose to go off-grid because I didn’t want to deal with actually putting the power back into the grid and all the bureaucracy involved (I’m not sure if my power company even buys power back), and the scale I’m working at is super small anyway. Here are the components I used, and why I decided to go with them. They might not be the best choice, because I have no idea what I’m doing, but even so, I learned a lot in the process.

The Battery

As I was building an off-grid solar charging system,  I needed something to store the energy gathered by the panel. My initial goal with the project was to charge the battery on my electric bike. The bike is something like 12Ah at 48v, so overall the capacity is about 580 watt hours. I only let the bike battery drain to about 80% at most, so I wanted to charge about 100 watt hours at a time.

The type of battery I got was a lead acid sealed AGM battery, which is apparently pretty safe and commonly used in this sort of application. After doing some research about these batteries, it sounds like they also last longer if you only let them discharge to about 60-80% of their capacity, so I got a battery that holds 660 watt hours (12v * 55 Ah). I could probably have gone with a bigger battery but this one only cost about $100.

I had no idea what sort of connector this battery used when I bought it, but it turns out that it’s a pretty common connector that uses a bolt. The inverter I ended up buying worked out of the box with it and I ended up buying a box of additional eyelet adaptors to make my own wires.

The Solar Panel

I wanted a panel that would be able to charge up my battery to a decent level each day. I ended up getting probably more capacity than needed, but I can always expand my project later. I bought a 100W polycrystalline (because it was cheaper than mono) panel by Renology because it had good ratings and a good price to watt ratio. The connectors on the panel are MC4 so I ended up buying some additional cable so I could connect the panel to a charge controller.

The Charge Controller

I ended up getting a cheap charge controller that came at a discount in exchange for me writing a review. I was going to buy one that looked similar anyway, though I’m not sure if it’s the same manufacturer or just a knock off of the one I was going to buy. Either way it is the perfect size for my project at 10A and shows info like the current voltage level of the battery and the amperage going into the battery as well as the load coming out of the usb ports and the load out connectors.

I assumed you were supposed to connect the load out directly to an inverter but I read a few posts about how that would be a bad idea. I’m guessing too much load would fry your charge controller.

The Inverter


I was looking for a pure sine wave inverter, which is supposed to be more efficient and nice to your electronic devices, but I couldn’t find one under $100 so I ended up getting an 800W inverter that seemed pretty solid. As I mentioned earlier, the connectors just worked for the battery, which was nice. I only use one outlet at a time, so I haven’t tested if this thing can actually throw out 800W, but it’s probably a good rule of thumb to get an inverter with more capacity than you’ll need on average anyway. My bike battery charger uses about 140W and a Macbook charger will use 80W. I’m not sure how many watts that is after efficiency lost with the inverter but it’s probably not too terrible.

Putting it all together

After getting all of the parts I realized that I was missing the connection from the charge controller to the battery. I ended up buying some ringlet adapters that would fit the battery and cut off part of the long wire I bought to make a new wire. This worked better than I thought it would. After that, I was able to connect the panel and battery to the charge controller. I was able to read that the panel was giving something like 3 amps to the battery, which was amazing to me at the time.

I also connected the inverter to the battery and was able to run my bike charger. I attached my Smart Things outlet in between the outlet and the charger so I could monitor how much voltage the battery used. It’s interesting because once the battery reaches a certain charge, the charger tapers down its power usage slowly. Finally, I placed the panel on the roof, which was kind of difficult considering how tall the roof is and how short my ladder apparently is, plus how heavy the panel was and how much I’m able to lift above my head while also balancing on top of a ladder…

Here’s some photos of the system running just inside the door to the roof. I’ll probably set up a plank or something to drill the charge controller and inverter onto, since right now it’s a little janky.

This is the charge controller, battery and inverter charging my bike battery and an iPhone.
This is the charge controller, battery and inverter charging my bike battery and an iPhone.
The highest amperage I've seen is about 6, where I suppose the most the panel can give is 8.3 if it was on the surface of the sun.
The highest amperage I’ve seen is about 6, where I suppose the most the panel can give is 8.3 if it was on the surface of the sun.
Solar Panel
This is the solar panel before I got it on top of the roof

Hopefully you found this interesting and are already planning an off grid solar system of your own. I’m happy to say that my ebike is now powered 100% by my project, as well as a bunch of electronics in my house. Also, my house has become a lot more valuable in the case of a zombie apocalypse.