Fuel your small business with QR Mobilize

Jun 26
2013

QR codes are cool, QR codes are fun… I’m starting to see them everywhere under the sun.

A colleague of mine, James Wagoner, develops QRMobilize.com, a place where you can setup a small business profile, upload a picture, put down a few social media links, and it’ll generate a fully functional, mobile accessible website. In addition, it will also generate a QR code that you can print in magazines, and on business cards for smart phone users to save your link, wherever they are.

Pretty f*ckn cool.

I know he’s been hacking at the idea for awhile, and some features that competitors have that I’d like, he has still yet to release… but give it time he said ( I’d love for you to get google maps on it sooner than later! ).

Here is my QR Code:

Scan it into your smart phone with an app like QR Droid, and you can save a profile of me to share with your rich friends over talks about where they should invest their money!

Nice work Mr. Wagoner.

How To Style Yii Pagination with Bootstrap

May 14
2013

Yii Framework + Pagination

I’m a big fan of the Yii Framework. I’ve been hacking on it since it released a few years ago, and it’s become one of my default frameworks for most my projects these days.

One nice feature you get out of the box, is a built-in Pagination class. However, the out of-the-box style doesn’t generally fit the projects I work on, which lately have used Twitter Bootstrap – which has a very nice pagination style.

For sake of completeness, here is example code you might include in a controller action that requires pagination and integrates with Yii’s Active Record methods:


function actionIndex(){
    $criteria=new CDbCriteria();
    $count=Article::model()->count($criteria);
    $pages=new CPagination($count);

    // results per page
    $pages->pageSize=10;
    $pages->applyLimit($criteria);
    $models=Article::model()->findAll($criteria);

    $this->render('index', array(
    'models' => $models,
        'pages' => $pages
    ));
}

And here is corresponding code for the view:

    <?php
    $this->widget('CLinkPager', array(
        'pages' => $pages,
    ))
    ?>

Pretty sweet huh? All of that, out of the box. Too bad it looks like this:

Yii pagination default look

It works… but it probably doesn’t match your project’s look and feel, and it’s just not bootstrap. Boo!

CLinkPager and Twitter Bootstrap

Ever wonder how to mesh Yii’s Pagination + Twitter Bootstrap’s styles? Gee, Me too!

I first googled around to see a quick way mesh the two, and was surprised to find that most examples try to extend CLinkPager widget. This didn’t seem right to me. Yii, is generally a pretty flexible when it comes to stylization and themes; I knew there must be a better way…

I dug into the CLinkPager class myself, and turns out, there is a much simpler way to make Yii’s pagination class styled like bootstrap, and it can be done entirely in the widget options in the view file, without extending anything. See the following:


<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">

<div class="pagination">
    <?php
    $this->widget('CLinkPager', array(
        'pages' => $pages,
        'header' => '',
        'nextPageLabel' => 'Next',
        'prevPageLabel' => 'Prev',
        'selectedPageCssClass' => 'active',
        'hiddenPageCssClass' => 'disabled',
        'htmlOptions' => array(
            'class' => '',
        )
    ))
    ?>
</div>

And wallah! It looks like this:

Yii Pagination using Twitter Bootstrap

Configure Widgets Globally

Now that we know how to style our CLinkPager widget with bootstrap, one realizes that repeating those options for a site that has pagination all over the place in a copy paste fashion is sub optimal. What if I need to change a style slightly for several places?

No worries. Yii offers the ability to globally configure widgets, and further override global configuration as needed for specific widgets.

First, setup your global widget configuration in your config/main.php:


return array(
    'components' => array(
        'widgetFactory' => array(
            'widgets' => array(
                'CLinkPager' => array(
                    'header' => '<div class="pagination pagination-centered">',
                    'footer' => '</div>',
                    'nextPageLabel' => 'Next',
                    'prevPageLabel' => 'Prev',
                    'selectedPageCssClass' => 'active',
                    'hiddenPageCssClass' => 'disabled',
                    'htmlOptions' => array(
                        'class' => '',
                    )
                )
            )
        ),
    ),
);

With that in your config, your pagination inherits the correct styles for bootstrap, and you need only include the following where you need pagination:


    <?php
    $this->widget('CLinkPager', array(
        'pages' => $pages,
    ))
    ?>

In the event that you need to over ride something for a specific pager, you can do so by setting the option for that widget instance, like so:


    <?php
    $this->widget('CLinkPager', array(
        'pages' => $pages,
        'header' => "<div class='pagination pagination-right'>",
    ))
    ?>

Not too shabby.

You can read up a bit more on global widget configuration, as well as take it one more step into “skinning” on the Yii website.

Hosted Bootstrap

Also, little tip, for small projects, I tend to use a hosted bootstrap JS/CSS include – makes throwing up an experimental project, that much faster.

League of Legends

Apr 11
2013

A friend turned me onto a new game, League of Legends. It’s a real time strategy (RTS) where you choose from any of over 100+ different characters, team up in groups of 3-5, and duke it out on interactive maps for territory. Games generally last 20-45 mins, and you are rewarded with in-game points to help level up your abilities. If anybody wants to play with me sometime, signup using the link below ( I get in-game points for referrals ), and hit me up, lets play!

Inject jQuery on any website

Feb 20
2013

I spent some time Googling around for javascript injection techniques, and stumbled on a neat little bookmarklet that allows you to inject jQuery into any website, and then use the FireBug console to play around with the page. In addition to how much fun this is, having the smooth jQuery syntax at your fingertips mixed in with FireBug is a great debugging technique for developers.

Many kudos goes to Karl Swedberg for posting his bookmarklet and technique at http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet/.

Go check it out!

Twig Syntax Highlighting with TextMate

Feb 18
2013

What is Twig?

Twig – The flexible, fast, and secure template language for PHP. Brought to you by Fabien Potencier, creator of the Symfony Framework.

What is TextMate?

TextMate is a general-purpose GUI text editor for Mac OS X created by Allan Odgaard. Notable features include declarative customizations, tabs for open documents, recordable macros, folding sections and snippets, shell integration, and an extensible bundle system.” — Wikipedia

What is cool that I’m sharing with you today?

A nice little Twig syntax highlighting bundle for TextMate, made by Andrew Fricke. You can checkout the code from Andrew’s Github Repo:

https://github.com/Anomareh/PHP-Twig.tmbundle

Steps to install the bundle on Mac OSX:

mkdir -p ~/Library/Application Support/TextMate/Bundles
cd ~/Library/Application Support/TextMate/Bundles
git clone https://github.com/Anomareh/PHP-Twig.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'

Restart TextMate, and enjoy syntax highlighting of your .twig files!

Firefox Inspect Element

May 08
2012

I’d like to write up a bit more on this at a later time, but moving quickly.. a quick way to inspect an element on the DOM is to use Firefox’s Inspect Element tool. It’s very handy for quickly figuring out the CSS selectors and attributes belonging to an element on the page, as well as checking for value changes when working with a dynamic page.

Try it out!

Right click an element and choose Inspect Element

Useful information at a click!

Features, Quality, Speed – Choosing Technology

Apr 24
2012

A few years ago, I put out a series of articles on tech forums describing some of my thoughts on building social networks, and choosing the best technology. I made some comparisons between Rails, Django, and PHP Frameworks, off the shelf CMS like Drupal or WordPress. Not all statements, I would say were accurate at the time ( I may be jaded from bad experiences ), or even today – but the general idea was in the right place.

A few years have gone by ( too fast ), and many of my philosophies have, hopefully matured, changed a little. I tend to slander technologies less, for starters, unless your Drupal, and do more looking at the problem domain and explore what technology can elegantly solve for to get me there, instead of brute forcing my favorite technology and hoping it will keep me there.

Tonight, I received an email from a fellow startup enthusiast, Michael, seeking some further thought on the matter, as he is embarking on a project. After editing my response to him, over and over, I decided, it was worth sharing.

Michael, in his quest to choose the best technology for the job, was stuck between choosing an off the shelf solution, BuddyPress or going completely custom from scratch with CodeIgniter (CI) to build a social network. BuddyPress didn’t quite have all the features he wanted, but did have some, and CI, of course, would be a mostly from scratch endeavor.

Michael stumbled upon one of my notes on the CI forums, and sent me an email asking “How does he choose which will be best?”

My response:

Hi Michael,

Thanks for reaching out to me. I have to say, I’ve received a lot of feedback on my thoughts about this, and I will first admit, I wrote that note on the CI forums several years ago, if I were to write it again, I think I could do you one better. However, I think a lot of the motivation behind it still holds true in my experience, so let me give you some of my thoughts from today, and you will have to task yourself in choosing which specific technology meets your requirement.

Lets spark some thoughts:

  • Are you hiring a team or programming yourself?
  • What types of resources do you have available to achieve a finished product ( either that be your own graphics and programming skill, friends helping, a hired team, skill level, experience ).
  • What type of timeline are you looking at?
  • If you have a hired team, do you have the budget and buffer for when things don’t come out the way you expected? Going custom can have it’s unexpected draw backs and expenditure, while an off the shelf solution might get you to market faster at the cost of not being “quite” what you want in the big picture.

All Code is Throw Away

“All code is throw away” – Peter Meulbroek. A dear friend of mine, mentor, and also former boss, taught me this concept over the course of about 3 years. It’s one of my biggest take aways from working closely with him.

Be ready to try again. To not get it quite right. To give a little, so you can take a little more.

Often, the best thing you can do, is build a beta or prototype. See if it catches. Don’t spend all your resources in one basket and hope it’s the next best thing. If you can get a prototype, you can gauge what to do to sustain, maybe pursue further investment, or decide to throw it out! Going with an off the shelf solution is often a “fast” way to go and provides this sort of testing ground with low expense. Then when the concept is proven, rewrite it on a more customizable platform with all those features you dream of, ramp up infrastructure, resources, budget, etc.

I’ve rewritten entire projects with tens of thousands of lines of code, in different technologies, languages, platforms, you name it, in some cases, 3-4 times in a year. Some of the reasons generally being:

  • the requirements evolved
  • the budget increased or decreased
  • we pulled and added features that we found more or less important
  • users hated it and nobody used it
  • users loved it so much we hit a technical wall or limitation
  • overhead was not worth investment for particular features

Famous Last Words

Think about these items, and then ask yourself what is important to you in this first iteration ( attention to the word “first” ):

  1. Features
  2. Quality
  3. Speed

Take a combination of 2, and choose which framework/platform gets you that. Then, be prepared to change your mind, evolve, and throw away a little code ( or all of it sometimes ) in favor of what gets you to the big picture in the end.

Your fellow startup enthusiast,

Chris Page

TalkToTheManager – Every Cell Phone is a Comment Card

Mar 08
2012
Every cell phone is a comment card

Talk to the Manager - Every cell phone is a comment card

I know quite a few talented folks, another friend of mine just launched: TalkToTheManager.com.

I really think this has a lot of potential to kick off. You know those customer feedback cards in restaurants and hotels that you’re asked to fill out once in awhile? And every once in awhile you do? This takes that concept to the new century, using cell phones.

Imagine sitting in a restaurant, and the bathroom is just gross – you text anonymously to a number that you notice on a card laid out on the table, the feedback is sent to the owner, manager on staff, etc, instantly and anonymously. They can very quickly, either respond, or remedy the problem, or likely ( and hopefully in this scenario ), both. Now – it doesn’t have to be bad feedback, it can actually be good feedback too — ie: “Sally is a wonderful waitress, she really went above and beyond, thank you, we’ll be back”, etc.

It’s a great tool for businesses to dig down into what’s happening in their business. Particularly if the upper management is more removed, ie, chain owners.

I talked to a few businesses about this while I was out and about earlier this week, and sure enough, there was interest. I think a huge win for TalkToTheManager is if a hotel chain grabs this – then you are gold sir.

The service is $15/month for businesses, and free for end-users. Check it out. I wouldn’t be surprised if you see this somewhere sometime in the near future.

Nice job.

n3rds.com – Jobs for Programmers

Mar 08
2012
Jobs for Programmers

Jobs for Programmers

Two colleagues out of St Louis, Josh Anyan, and Chris DeGroat, recently created n3rds.com – a website for matching up tech industry jobs with candidates. They gave me a heads up, and I was pretty impressed – as I generally am by these two. I thought I’d give them a call out on my site in hopes to send them what little traffic I can muster. Here is a review:

n3rds.com aims to be low friction, my entire experience on the site was just a few minutes, here are some highlights:

  1. The login system is all via the linkedIn API ( how suitable ). This makes it super easy to sign up, and connect with the most relevant professional social network out there – NOT your facebook.
  2. You’re immediately asked a few questions about locale, skillsets, salary ranges that interest you.
  3. Next, your taken to a listing of matching jobs – where you can pick and choose what interests you and go from there.
  4. As new jobs that match your skills come into the system, you are notified. This is a nice way to keep a pulse on opportunities, without throwing your resume on the market.

n3rds.com launched a few days ago and is currently in beta. If you’re a recruiter or employer, head on over and toss up a few job postings. It’s free! If you’re a techie, might as well sign up – it’s pretty frictionless, and you never know where you’ll find the next big thing.

For the record: Chris DeGroat and Josh Anyan are rockstar developers, they knocked this product out in just a couple short weeks. Keep tabs on these guys.

Nice work gentlemen.

How to help fight the SOPA and PIPA Bills – Take Action!

Jan 18
2012
SOPA PIPA Image

North Korea was blacking out the internet before it was cool. Don't let it happen in the free world. Help take Action: https://www.google.com/landing/takeaction/

When the people fear their government, there is tyranny; when the government fears the people, there is liberty.” – Thomas Jefferson

Ok folks! This is the largest online protest in history, and for good cause. Two bills, that threaten internet freedom, are infront of Congress with alot of support, SOPA and PIPA. A quote from Google’s take action page:

Millions of Americans oppose SOPA and PIPA because these bills would censor the Internet and slow economic growth in the U.S.

Two bills before Congress, known as the Protect IP Act (PIPA) in the Senate and the Stop Online Piracy Act (SOPA) in the House, would censor the Web and impose harmful regulations on American business. Millions of Internet users and entrepreneurs already oppose SOPA and PIPA.

The Senate will begin voting on January 24th. Please let them know how you feel. Sign this petition urging Congress to vote NO on PIPA and SOPA before it is too late.

North Korea was blacking out the internet before it was cool.

Food for thought: Would you rather your children grow up in North Korea, or the free world? Better get on board folks.

Imagine a world ( not just an internet ) without places like Google, Yahoo, Wikipedia, craigslist, Facebook, Twitter, LinkedIn, eBay, AOL, Mozilla, Reddit, Tumblr, Etsy, ZyngaThese bills must be stopped dead in their tracks!

It’s EASY to TAKE ACTION!

I glued this post together rather quickly, please post in the comments other ways to help.

Yours truly,

In the market for a new country if this sh*t passes.

Visit Other Sites!

Find me on other sites...

Archives

All entries, chronologically...

Pages List

General info about this site...