About Me

Thoughts of a Software Maker

by Trevor Kimenye
A journal of my thoughts on the journey of building software.

Follow me @kimenye on Twitter.

Recent comments

  • November 18, 2013 6:26 pm

    Creating a custom action with Rails Admin

    Application administration is an expected part of modern web applications. In Rails, there are two main contenders for the throne of Administration engines: ActiveAdmin and RailsAdmin. I’ve been using the former for sometime and even created a couple of gems I felt would be useful. Time to give RailsAdmin a chance.

    My initial impressions were that it looked better than RailsAdmin. I’m not a fan of twitter bootstrap, but its easy to customise the look and feel. A lot more than ActiveAdmin. Anyway, this is not a review of both, so let’s jump straight into creating a custom action.

    I needed a custom action to allow importing of records. I didn’t expect it to be reusable at first, so I put the code directly in the rails admin initialiser.

    Check out this gist for the entire code.

  • November 11, 2013 2:19 pm

    Introducting ActiveAdminImportAnything

    Active Admin is a great gem you can use for easily creating useful administrative interfaces. It also has lots of plugins that cover many scenarios e.g. to importing data from a csv file use active_admin_importable. This lets you import a csv file with a header that matches the fields of your model and it creates the file accordingly.

    What if you wanted to import say an excel file where not each row maps to a record? Or you wanted to import an svg file? Wouldn’t it be great if you could just have a collection_action with the file and have your own logic to create records? That’s what active_admin_import_anything does. Check it out on github and give me some feedback.

  • November 11, 2013 2:12 pm

    ReadMe driven Development

    Few developers ever RTFM (Read the Freaking Full Manual). That’s why a simple ReadMe file covering the simple instructions on how to use a library are so useful.

    Imagine you’re on the other end, writing the software. Starting with a ReadMe is a perfect use case user-story for developer users. Think about how you’d like to use the application (usage, syntax, dependencies). Keep it short and focussed, then write the code that will make you’re usage scenario work.

    And that’s ReadMe driven development.

  • November 7, 2013 1:00 pm

    Satisfy your Customer Early

    image

    I had a great conversation with my students at the Nairobi Dev School about how much to charge for Software Projects. It was very encouraging seeing young developers curious to know about revenue models and making a career out of Software Development. This brought me to my favorite topic of fixed cost pricing vs a more agile approach - and a talk I gave at the inaugural Agile Africa conference (check out the talk on YouTube).

    According to the great Roger Sterling - “The day you sign a client is the day is the day you start losing them”. I’ve found this to be true for most of my career, but even a bigger problem when you’ve given an upfront cost for a project and taken a sizable down payment. When you add the pareto principle which states that:

    80% of the functionality will take you 20% of the time. While the remaining 20% will take you 80% of the time.

    Problem is, the greatest value to the client is in the remaining 20%. And developers usually get to this part, after already spending the huge downpayment given by the client. At this point, they are not sufficiently motivated to complete the project. In order to survive, the developer takes on another project (read: sizable downpayment) to plug their cash flow and the cycle continues…

    So how can an agile delivery help reduce the instance of such problems?

    1. Focus on Value - work on what gives most value to your customer immediately.
    2. Continuos Integration - work on small bits that you add to your product incrementally. The client sees incremental value.
    3. Avoid fixed Costing - Fixed costing requires assumptions and that adage of assumptions applies here: “Assume makes an ass out of you and me.” If you have to fix costs, factor in risk and break it down to as many milestones as possible. 
    4. Respond to Change - The main reason why you lose customers as soon as they sign, is that like a marriage people change. Respond to changes in their business environment, requirements and you will remain relevant. 

    Hopefully you will get to the Nirvana where you can quote to your clients an hourly / daily rate where they recognize the value you bring to their organizations, as soon as they sign on the dotted line.

  • October 16, 2013 7:05 pm

    My 2-day-a-week break from running my company

    I’ve recently decided to take a break from running my company Sprout. Well, sort of…

    Only this time I won’t be off to an isolated island, with a crate of my favorite beer and nothing but seagulls for company.

    For the next 8 weeks, I’ll take 2 working days off and contribute to the tech community in Nairobi. Looking at the past year, some of the challenges I’ve faced as a CEO of a young tech agency have been in managing talent and not getting fast enough to the market. These are two things I’m hoping to fix on this hiatus.

    Building and attracting talent

    A startup lives and dies by the team, and I’ve had an excellent team this year. Many a times we’ve not known exactly what to do or build, but we’ve been happy to grope in the dark together. I’m not the most fun person to work for or with. I’m extremely inpatient and really thrive amongst driven people who require minimal supervision. This, I admit may not be the most conducive environment for people still learning the craft. So I’ve decided to throw myself amongst the wolves and teach young people how to program.

    The Nairobi Dev School started by @njerichelimo aims to teach young kenyans how to program. I’ve already taken two sessions with the students, teaching them Ruby on Rails and its been very promising. Their curiosity has been challenging and I can already feel that my patience levels are growing.

    Me, with ‘principal’ Martha at a Treehouse sponsored meetup

    I’m hoping they get their website up and get some of the students blogging about their experience. Ultimately, I’m (selfishly) hoping to be able to inspire some of them to take up this journey I’ve been on the last decade. I wouldn’t mind an employee or two. 

  • October 8, 2013 11:39 pm

    Thoughts of Judge Dread on UpStart Kisumu Auditions

    image

    Judges @kibee, @ShideBenz and @kimenye

    Upstart, a televised start up accelerator, was about to hit Tom Mboya Labour college in Kisumu. And they were ready for it. The show that is Big Brother, The Aprentice and Shark Tank rolled into one has budding entrepreneurs competing for a $50,000 investment.


    After months of talking and planning it was finally going ahead with a very palpable excitement in the air. I reluctantly got some make-up applied before getting ready for our first contestant of the day. We’d come to town seeking the best from a region well known for flamboyance, and flamboyance is exactly what we got.


    The entrepreneurial spirit of Kenyan youth was on show as contestant after contestant regaled us with stories of their ‘hustling’. Most surprising to me was the fact that poultry farming emerged as the side-hustle of choice, given that most people would associate the scenic lakeside town of Kisumu with fish rather than chicken.


    We were regaled with inspiring stories of salesmen putting themselves through school by buying and selling items to their classmates. Is there a Richard Branson in the making here?

    Only time will tell.

    What is certain is, if the first auditions are anything to go by, anyone thinking that a business driven show could be boring is wrong. From impromptu pickup-lines, dancing, singing, rapping to even aerobics, the contestants did everything to ensure we - the judges - were thoroughly engaged.

    image

    One of the contestants before facing “Judge Dread”

    My emergence as the tough judge (‘Judge Dread’) came to me as a surprise. There’s a fine line between ensuring that we have a high caliber of contestants who can withstand the pressure of business and entertainment, and ensuring everyone is given a fair chance to put their best foot forward. Ultimately I felt my stance was vindicated by the fact that I could have some lighthearted moments with most of the contestants during the breaks. Nobody took it personally, I hope *cringe*.

    image

    A successful applicant @elishawaudo

    Perhaps, in some way, the only disappointment was the lack of a successful female contestant. We had quite a few promising female aspirants in both technical and creative roles.


    We also saw lots of very localized ideas that I doubt would be applicable elsewhere. Some contestants also lacked ambition in their thinking. That said, I’m looking forward to the next auditions, and especially getting a large turnout from the ‘Creatives’ and more women. Mombasa, Nairobi – bring it.

    -Mombasa auditions on the 12th October. Nairobi on 19th & 20th October

  • September 9, 2013 5:45 pm

    Sencha Touch ‘cls’ parameter

    So I’ve spent a couple of hours trying to figure out what’s wrong with my code. I’d created a Sencha Touch panel and assigned it a specific class through the ‘cls’ property. Turns out if you set put this property within the class ‘config’ property, when you app is built, the ‘cls’ property is not applied.

  • September 5, 2013 2:25 pm

    How to Install PostgreSQL 9.2 on CentOS 6.3/RedHat EL6/Fedora

    Great detailed instruction on how to install PostgreSQL on CentOS 

  • September 5, 2013 11:23 am

    Update Git On CentOS 6.3

  • June 11, 2013 5:27 pm

    Styling Zurb Foundation Tabs

    I’m a big fan of CSS and Javascript frameworks. There’s no point in reinventing the wheel for every project. However, the disadvantage with this approach is a lot of websites tend to look the same.

    Take for example styling these TABs from their stock look…

    image

    into this…

    image

    It looks like a simple enough challenge, so lets get into it. First, let’s get rid of the grey background’s and borders… I’m using SASS. Check it out if you haven’t. It lets me nest the specific CSS under a class called ‘product’.

    .product {
    
      .section-container.tabs section.active .title, .section-container.tabs .section.active .title   {
        background-color: #65c8c6;
        color: #ffffff;
      }
    
      .section-container.tabs section .title, .section-container.tabs .section .title {
        background-color: #46166b;
        color: #ffffff;
      }
    }

    So that also takes care of the selected and unselected states, giving the tabs that ‘aqua green’ color when selected and ‘purple’ when unselected. Now to get the rounded corders and remove the borders…

    .product {
    .section-container.tabs section .title, .section-container.tabs .section .title { border: none; border-radius: 5px 5px 0px 0px; } .section-container.tabs section .content, .section-container.tabs .section .content { border-left: 1px solid #65c8c6; border-bottom: 1px solid #65c8c6; border-right: 1px solid #65c8c6; border-top: 5px solid #65c8c6; border-radius: 0px 5px 5px 5px; } .section-container section .title a, .section-container .section .title a, .section-container.auto section .title a, .section-container.auto .section .title a { color: #ffffff; }
    }

    We’ve now added a border radius of 5 pixels on the top left and right corners and a thick border at the bottom of the selected tab.

    Now to add the space between the tabs. Here the Foundation Team in their bid to simplify the markup for tabs (sections) in Foundation 4 provide some gotchas. The positioning of the Tab titles is relative and is calculated in Javascript at runtime. So doing a simple margin-right doesn’t work. We need to add a margin-left since the tabs are positioned using the left attribute. Why the Zurb guys did it this way is a bit beyond me. Anyway, you need to use some awesome CSS pseudo selectors.

    ...
    .section-container.tabs section:nth-child(2) .title { margin-left: 20px; } .section-container.tabs section:nth-child(3) .title { margin-left: 35px; }

    The above CSS selectors select a ‘section’ element that is the 2nd and 3rd child of its parent respectively. That’s why the first title isn’t affected. if you need to brush up on CSS selectors, here’s a great article

    I’m thinking of making this a series. So if I find myself customizing foundation css in an interesting way, I will post it.