Pagination With Twitter Bootstrap and CakePHP

I recently spent almost 30 minutes trying to figure out why my pagination using Twitter bootstrap and CakePHP would get broken into two line whenever the pagination list was a child of a div having a span[n]  class.

 

After I changed this code to the listing below, it came back to normal. I hope this helps someone out there.

 <div>
  <ul>
   <?php
    echo ($this->Paginator->current() > 3) ? $this->Paginator->first('first ', array('tag' => 'li')) : '';
    echo ($this->Paginator->hasPrev()) ? $this->Paginator->prev(__('prev ', true), array('tag' => 'li', 'id' => 'prev' . rand(2, 9000)), null, array('escape' => false)) : '';
    echo $this->Paginator->numbers(array('modulus' => 7, 'separator' => ' ', 'tag' => 'li'));
    echo ($this->Paginator->hasNext()) ? $this->Paginator->next(__(' next', true), array('tag' => 'li'), null, array('escape' => false)) : '';
    echo ((int) $this->Paginator->counter(array('format' => '%pages%')) > 10) ? $this->Paginator->last('last', array('tag' => 'li')) : '';
    echo $this->Js->writeBuffer();
   ?>
  </ul>
 </div>
Advertisements

Don’t Go crazy Trying to Resize Twitter’s Bootstrap CSS Modal Windows

I was in the middle of a project where I needed to implement modal windows.
After playing around with colorbox, I suddenly realised that the CSS framework (Twitter Bootstrap) which I was using at that time, had options to display modal windows.

So after a quick lookup on the documentation, and then trying out a few demonstrations, I decided it was time to replace colorbox with the Bootstrap modal windows.

After hours of tweaking here and there, I ended up almost completely exhausted from trying to figure out why the modal window size just wouldn’t change and remain in the center. The SPAN tags sizes were suddenly behaving as though they weren’t based on the framework.

After trying all the things I thought were logical solution and failing over and over, I decided to finally consult the G-oracle.
Finally, I found this solution / hack to fix this little problem which requires that I specify the width in CSS to give a non-fluid layout. Another option was to use Javascript to compute the width and position of the modal window.
You can find the complete load down on GitHub with sample code included./issues/675

 

Hooking Users In 3 Steps: An Intro to Habit Testing | Nir and Far

So I was surfing through some friends posts and saw a link to this blog that talks a lot about building your online business, and I believe these things are not taught to most fresh entrepreneurs.

We easily think our new idea is going to revolutionise the whole world, only to have our world come crashing down when we get only a few users on our new “world-changer” site.

Below is an excerpt from a post on Nir and Far.

The truly great consumer technology companies of the past 25 years have all had one thing in common: they created habits. This is what separates world-changing businesses from the rest. Apple, Facebook, Amazon, Google, Microsoft, and Twitter are used daily by a high proportion of their users and their products are so compelling that many of us struggle to imagine life before they existed.But creating habits is easier said than done. Though I’ve written extensively about behaviour engineering and the importance of habits to the future of the web, few resources give entrepreneurs the tools they need to design and measure user habits. It’s not that these techniques don’t exist — in fact, they’re quite familiar to people in all the companies named above. However, to the new entrepreneur, they largely remain a mystery.I’ve learned these methods from some of the best in the business and put together an amalgamation of them that I call “Habit Testing.” It can be used by consumer web companies to build products that users not only love, but are hooked to.

 

HABIT TESTING

Habit Testing fits hand-in-glove with the build, measure, learn methodology espoused by the lean startup movement and offers a new way to make data actionable. Habit Testing helps clarify three things: 1 who your devotees are; 2 what part of your product is habit forming, if any; and 3 why those aspects of your product are habit forming.A prerequisite to Habit Testing is having some kind of product up and running. Of course, before launching even a minimal viable product, it’s a good idea to take a stab at your business model hypotheses and how your product will create user desire.Once you have a site or app live, you can begin collecting data. Habit Testing does not necessitate collecting data about everything — just the right things — so setting up the appropriate analytics is critical. In order for Habit Testing to be successful, you need to date stamp the path users take while using your site.

via Nir and Far.

TweeetDeck Crashes Anytime a Popup Notification Shows

I used to have this problem with tweetdeck anytime a popup notification appeared on my windows XP machine.

Tweet deck would suddenly crash and windows would report an error has occurred.

After searching Google for a solution I couldn’t find any joy until I realised I had an old outdated version of Adobe Air installed.

I also had a LameAcm codec that caused some problems with the sound.

All I had to do was uninstall the Adobe air, download and reinstall the latest version of adobe air, and that fixed the crashing problem.