Programming tips

I do a lot of technical blogging using Github gists. Github gists (and small public repos) are a great way to share code snippits. Here are a few I’ve made recently that you may find useful.

Please comment on these Gists so I can make them better.


Startup Developer Team Agreement

Five times now I’ve worked for a startup as it went through a growth phase (major round of funding). When it worked well, each new team member made the team stronger. When it didn’t work, the company was a revolving door. For development teams, it’s a tricky time.

Early developers enjoy high individual productivity as they work with the technology they know (or have pioneered). Adding more developers does not mean an immediate increase in productivity. More team members requires more interaction, planning, and code interfaces.

Developers are a quirky bunch. There are geniuses that come to work when they want (or not at all). There are verbally challenged code generators that turn out code faster than the team can agree what to build. Lone wolves that go off on all nighters and don’t come back with ship-able code. Work-from-homers that need to be “skyped in.” And the loyal guys that do what the boss wants today without finishing what he wanted yesterday. Not to mention the “leader” that rarely takes his headphones off.

For the people I currently work with, don’t worry – I’m not thinking about you ;-).

In this storming, forming, and norming process the team needs to set guidelines on how to work together. I’ve written before about 10x developers – a similar concept applies to productive teams. I’ve never been trained as a manager, but there are a couple things that keep coming up. It is critical to establish a team agreement centered around communication. What kills startups are the things that left unsaid, so nail down a few specifics with a “team agreement” document.

Example agile team agreement

  • Goals

    • Work on the right things for the business

    • Increase leverage by improving our skills and using the right tools

    • Ship code that works

    • Have unit tests and be able to ship often with confidence

  • Work day

    • Stand-up meeting at 10AM M-F: 1 minute to report on what you did the previous day, what you are doing doing, and what you are blocked on

    • If you can’t attend, send in your status update via email

    • Be available on Skype when you’re working

  • Sprint planning and process

    • A weekly sprint to complete top priority items from the backlog

    • Tasks recorded in Trello (or sticky notes, or whatever works)

    • Task complexity discussed prior to or during planning

    • Stick to your assigned tasks during sprint

    • Any time something gets brought into the sprint, notify the team and create a task to track it

There’s many other things to go into with team-building, but a couple other tangible things keep coming up.

1. Coding standards, including: why spaces are better than tabs. Make a decision as a team, convert your code once, and stick to it. This project samples Github code to determine what the standards should be.

2. Git collaboration workflow. Nailing this early will help. By all means take the time to make sure everyone understands Git as well as deploying code.

What makes your team uber-productive? Leave a comment and let me know.

Converting PNG to SVG (Vector) for Retina Displays

I’ve been working on a web site that is often viewed from iPads. iPads have a retina display (higher pixel density), which makes low-resolution images look grainy. Here’s an example, zoomed in to exaggerate the effect.

Screen Shot 2014-03-02 at 1.32.15 PM.png

The problem is the images are raster (bitmap or pixel) based, not vector (line art) based. Now that I recognize the problem, I see it everywhere. Even the Google search looking glass.

Screen Shot 2014-03-02 at 1.33.33 PM.png

Anti-aliased pixel-based PNGs are the standard. For web developers, the problem is, once they  flatten an image to a pixelated PNG, the browser can’t enlarge it again. This is a problem with the widening array of mobile display resolutions.

Unfortunately, a common fix is to swap in a 2x resolution image. This is a dumb approach for icons, logos, and buttons – anything that is not a photograph. All you are doing is downloading a second set of larger files to handle another fixed resolution.

All major browsers support SVG (Scalable Vector Graphic) files now, but before leaping on board, there are a couple performance considerations.

One consideration is the file size. Especially when developing for mobile web pages, for complex icons, a larger-dimensioned PNG may be smaller in file size than a vector representation. For most icons, logos, and buttons, SVG files will be smaller than the PNG. PNGs are actually not that small, since it is a lossless format.

The second consideration is CPU time to render and composite the image (often on top of something else). I haven’t done any performance tests. For maximum performance, scaling and compositing bitmap based icons will be the best. However, my guess is that unless your vector is crazy complicated, or your phone a few years old, using vectors will be fine.

One great trick I wish I knew before converting a batch of PNG icons last month, was that algorithmic conversion (aka image tracing) from pixel to vector is pretty common. There are several services like that will automate your conversion. Vector creation is even built in to Adobe Illustrator’s with the “Live Trace” function.

Beware that for more intricate clip art, algorithmic conversion will not be good enough. But, luckily designers can be easily found on Fiverr to help.

Are you converting PNGs to SVGs? What tools have you found that will help, and what are the gotchas of working with SVG? Please leave a comment below.

How to embed an opt-in form in a Facebook post

Here’s a cool Facebook growth hack I just discovered. This trick allows you to embed a Flash SWF file with buttons and even a form inside it inside a Facebook post. From the little bit of research that I did, it looks like marketers have been doing this since early 2013. The ability to embed Flash has been around since 2011.

Form inside Facebook post

This screenshot is from a site selling the ability to create the posts. I haven’t verified that the site works, so I won’t link to it. I did find some form-enabled Facebook posts in the wild. To create one of these, you post a link to a page that has an open graph meta tags in it that point to the SWF file.

I think playing a video and capturing an email address right inside a Facebook post is a brilliant way to get leads. You could also do interesting things like a mini-game, survey, presentation, or prompt to re-share inline in the post.

Post a comment if you think this is interesting. If I get a lot of interest, I’ll dig further and show you exactly how to create your own.


Growth Hacking Haiku Deck

I’ve been working with Haiku Deck (a Seattle Startup that makes free presentation software) for about 7 months. In that time, we’ve cooked up some pretty cool growth hacks to accelerate the growth of their user base.

Luckily, the product is already loved by its users. It is naturally viral since people use it to present their content to all types of audiences. For Haiku Deck, each person to view a presentation is a potential new customer. The best growth hacking occurs when the motives of the company and customer are completely aligned. In this case, the motive is to spread ideas far and wide via inspiring presentations. Plus, we recently removed a huge hurdle – having an $300-500 iPad by launching a web version.

Here are some of the experiments we’ve done to increase page views, signups, and sharing.

1. Move sharing buttons on the playback page, and add sharing from the gallery. An earlier design of the page meant the sharing buttons were not visible (“above the fold”) to many viewers. Sharing is top priority for both the company, and presenter, so we moved it to the top left. We’re now seeing 1,500% (15x) more social sharing than a year ago.




source: Haiku Deck Blog

We’re constantly evaluating the SEO quality of this page, and have re-worked it multiple times to make sure our customer’s public presentation notes and slide text are visible to google.

2. Start a waiting list for people that don’t have iPads. We replaced a direct link to the app store with a survey and email sign up form that asks people what platform they want us to support. Overwhelmingly, customers have requested Windows. By the time we were ready to launch the web version, we had a huge waiting list of people that previously would never have signed up.

Importantly, we also encouraged a tweet after signing up. This not only allows excited potential customers to recruit their friends, it also lets us see and interact with VIPs in advance of them getting the product.

example tweet:

Awesome #PR pres tool for iPad but 😉 I just requested @haikudeck for Windows. Make your request here:

— Jeff Domansky PR (@ThePRCoach) July 7, 2013


3. Elbow grease. Catherine Carr, Lisa Ma, and Erin Vondrak deserve massive Hai-5s  for their excellent community outreach, customer support, Pinterest boards, constant blogging, and growing a guru community. They corralled a huge group of influencers (presenters) into our web beta. This personal touch outweighs any feature addition for growing a customer base that talks about your product. The team constantly wows customers with their responsiveness.

 What didn’t work

We experimented with a closed (invitation only) beta for the web app. The idea was to control the quality of our rollout and create a feeling of scarcity around access to the product. We wanted to get the opinions of our most passionate users first. However, because most users don’t need to create a presentation every day, the invitation only aspect added too high of a hurdle to getting feedback (you need both a presentation idea and an invitation code at the same time).

Links this week

Interesting links I bookmarked this week.

How to evaluate startup ideas

It was obvious a month into TechStars that the business I had started would not be big enough. I will share the full story another time. While striving to find a better idea, my co-founder Lewis and I created a scorecard to help evaluate ideas.

It’s easy when you’re in love with an idea to read a list of criteria like this and score your idea high, just because you’re in love with it. The real question is, is it the best idea that matches the most criteria?


Chris Andersen says:

The traditional advice is ‘follow your passions’; I’m not saying that at all.  From a business-opportunity point of view, tracking other people’s passions is even more important.  There are often situations where something hasn’t necessarily taken off yet, but you see that gleam in someone’s eye and you can feel how much they care about something.  That probably represents an opportunity. That kind of passion is a proxy for potential.

Brad Feld calls this “founder-market fit.”

I’m not suggesting that product market fit isn’t an important concept. It is. But at the very beginning, especially with first time entrepreneurs, founder market fit is even more important.

Unfair competitive advantage

Steve Blank says a a customer insight can be a competitive advantage.

You might understand the needs of a certain segment of customers that nobody else is serving. Instead of attacking Microsoft on the entire OS business, you’ll tackle them on service. You re-segment the marketplace and take the niche that you’ve newly defined.

Another way to gain advantage is to “ride a wave” (or “get in front of parade”). Also, “Unsexy, high schlep” ideas (are a competitive advantage if you’ve got additional insight or perseverance).

Building a new category

Lisa Gansky tells entrepreneurs “to create new categories, not new businesses.  Building a business is simply adding a new piece to the environment, where new categories fundamentally shake things up.  That’s where the real opportunities to real change.”

Larry Page recently wrote that despite all their success, they are only 5% done.  “I’d like to pursue a big vision where we will never be waiting on customers to tell us what to do next.”

Paul Graham said “Live in the future, then build what’s missing.” I wrote about having an evil plan “If you are looking to create a funded business, it is good to have an evil plan. For example, with Blogger or Delicious – it wasn’t just about posting or bookmarking, it was also about owning fresh links to the Web’s best sites. Facebook isn’t about social networking, it is about ownership of your online identity.”

Of course, an advantage of working on something big because it not only makes a difference in the world but also to gives more potential upside for stakeholders.

Work in a domain you really know, not one you think you know

Marc Ecko tells us there’s no way to cheat the learning curve.  This can be interpreted a lot of different ways, but it will probably take a lot longer to build a successful business than you believe, so pick something where you have a running head start.

Make something people really AND already want

Jeff Bussgang said:

Sometimes founders come up with their own great ideas and then try to project those ideas onto customers.  I prefer the opposite approach.  I like to interview customers and find out what their problems are, in particular, I really focus on what I call “customer pain.”  Where are big groups of customers, feeling pain?  How high a priority would it be for them to find a solution?  Only when I find something really high-priority do I try figuring out a solution to that pain point.

Ideally, you will be solving your customer’s #1 pain point – or creating something they can’t live without.


Working together with Git

git icon, created for the Open Icon Library

Here are the basics of how a team of two or more people can collaborate on a project using Git. I wrote this to help a co-worker learn Git. Please comment here on the original Git Gist for git collaboration if you’ve got any suggestions.

Create the change

$ git checkout -b my-feature

… modify code ….

$ git add <filename> 
$ git commit -m “my feature is this”

… or, if you’re lazy …

$ git commit -a -m "my feature is this"

… pulls in changes from master since we branched, then re-apply ours on top. Totally fine to merge here instead of rebase …

$ git pull
$ git rebase master  

… resolve conflicts (if any) and add them …

$ git add <filename>
$ git rebase --continue

… # push my branch back to the server

$ git push origin my-feature 

Other guy merges in the changes

$ git pull 

… list branches

$ git branch -a

… bring a branch local

$ git branch --track my-feature origin/my-feature
$ git checkout master
$ git merge my-feature

… resolve conflicts and look around …

$ git push

… delete branch (and remote branch) when done

$ git branch -d my-feature 
$ git push origin :my-feature 

Other useful commands

To remove remote branches from your list after they have been deleted by other people

$ git remote prune origin
Enhanced by Zemanta

How to warm a cold email list

I had a quick chat session last week with my friend Darren. He was looking to promote his band’s latest album. He had an old email list, and he wanted to send them an announcement. Warming up a a cold email list (one you haven’t mailed in a while) is tricky. You need to blast them, but you also want to make sure they remember who you are and it doesn’t feel like spam. Below are 3 tips I had for my friend.

Darren: Just launched my CD on bandcamp. I have an ancient email list (just a list of emails) that i’m going to send an announcement to. any suggestions?

me: A couple ideas…

1. Tell a story. “while making song #3, the basement flooded…”,

2. Solicit a response. “Hit reply and let me know what your favorite song is. I may not have time to respond, but I’m dying to know. No need for complete sentences, just reply with the title or track #”

Darren: good one. maybe make a “free cd” contest too of some sort?

me: Yeah, for a random (or best) reply to #2. My 3rd tip is to avoid generic comments like “sorry it’s been so long” or “hope your winter is going well.” Don’t make it obvious you haven’t been staying in touch. You’re a rock star – go entertain them 🙂

Darren: really good advice!

me: Another tip is to make it personal, imagine you are writing to just one person that you know well

Darren: I opened a new gmail account for this. do you foresee any issues? i.e., the first email out is to a large bcc?

me: I think Gmail has a pretty small limit (somewhere in the 50-500) unique to emails per day. I use mailchimp, but it is a pain to learn all the steps of sending a templated email the first time.

Darren: ok. thanks!

me: album sounds great btw 🙂

Darren: aww, shucks. thanks, sir.

Ruby and Javascript contractor rate survey

I sent an informal survey to friends and Hacker News readers yesterday. The survey was to determine the current hourly rates for Ruby and JavaScript contractors. Below is the pivot table summarizing the results. You can take the survey here and see the raw results here.

My conclusion: there is a lot of variance among experienced developers. Rates north of $100/hour are attainable (but you can’t expect it as the status quo).