October 30, 2011

BigCommerce make “Add to Cart” & “Choose Options” text an image

BigCommerce doesn’t let us touch any of the PHP or HTML that spits out the Add to Cart or Choose Options links. In their support guide, they say to add a background image, but this still means that we need to keep the text, which often times just won’t do. I wrote a quick bit of javascript that goes and finds those Add to Cart and Choose Options instances, and replaces them with an actual image.

<script type="text/javascript">
    $(document).ready(function() {
    	$(".ProductActionAdd a").each(function() {
    		if( $(this).text() == 'Choose Options' ){
    			$(this).html('<img src="/templates/__custom/images/options.png" alt="Choose Options" />');
    		}
    		if( $(this).text() == 'Add To Cart' ){
    			$(this).html('<img src="/templates/_custom/images/add.png" alt="Add to Cart" />');
    		}
    	});
    });
</script>

Hope this helps! If you need further BigCommerce customization (especially with displaying categories the way you want) let me know.

June 20, 2011

Mobile Time Tracking using Twilio and Freshbooks

I use Freshbooks to manage all of my invoicing. I manage projects, log hours, and it allows me to keep a careful track of my business. I’m lucky enough to be connect to the internet when I’m working, but for some companies working out in the field, keeping track of hours has been mostly done on pencil and paper.

I built an application integrating Twilio and Freshbooks to solve this problem. Watch the video below to see my Twilio and Freshbooks time tracking system.

How it works

Since you can only submit a completed time log to FreshBooks, the initial clock in call is stored in a database on a separate server. When the user calls back to clock out, it compares the clock out time with the saved clock in time, and then totals up the hours worked. After we know how many hours were worked, the full time log gets submitted to FreshBooks.

Altogether, I mashed up a few different technologies, including:

  • Twilio Voice API
  • Twilio Transcription API
  • FreshBooks API
  • PHP
  • MySQL

If you’re interested in using this for your company, shoot me a message and I’d be happy to set it up for you, or let you license out the code.

May 20, 2011

Twilio Syntax Auto-Complete Mode for Coda

I love Twilio‘s markup language, TwiML. It’s intuitive and easy to understand. Still, whenever I’m developing I have to keep the Twilio documentation page open to know all the verbs and attributes of the language. To save time, I created my very own mode plugin for Coda so that as I’m typing, it automatically completes the Twilio commands and shows me all the available attributes.

So, without further adue, download Twilio.mode and install it in Coda.

Install instructions:

  1. Download Twilio.mode.zip
  2. Unzip it
  3. Copy the new Twilio.mode folder to: ~/Library/Application Support/Coda/Modes
  4. Reboot Coda, and under Text > Syntax Mode you’ll see Twilio

If you liked this plugin, you should probably follow me on Twitter. I’m always giving away little scripts like this.

Note: It’s also available on github.

April 21, 2011

Think Like MacGyver

When I was flying to Detroit from the Dominican Republic I did what I normally do. Open up my laptop, plug in my headphones, and zone off into some Louis C.K. or Jim Gaffigan standup.

Then I got a tap on my shoulder – my brother wanted to listen. I only had one audio output, so it looked like we had to go one earbud each. But wait, my MacGyver kicked in. Here’s what I had:

What would you do? Tell him he could listen to the soundtrack from The Incredibles while I laugh myself to tears? Give him an earbud and subject both of us to a terrible audio experience? Nah, we used what we had and made it work.

Here’s what I did:

  1. Made a Wi-Fi hotspot
  2. Converted the video into a .mp4 with VLC
  3. Loaded up MAMP
  4. Dumped the video into the the MAMP folder
  5. Connected the iPhone to my MacBook’s Wi-Fi
  6. Streamed on the iPhone
  7. Both lol’d at 30,000 ft

Turns out I didn’t even need the rubber band or paper clips!

Startups need to think this way. Take what you’ve got, and multipurpose it. Sure, having an audio splitter would have done the trick, just like having an extra iMac for the conference room would make meetings easier. But instead, buy a nice 27” monitor and adaptor so you can just plug your existing assets into it. Think carefully about spending expensive investor money when you don’t have to.