Charisma – free, responsive, multiple skin admin template

Update 21 July 2014: Charisma is now on Bootstrap 3.

Charisma is a full featured, free, premium quality, responsive, HTML5 admin template (or backend template) based on Bootstrap 3 from Twitter, it comes with 9 different themes to suit your style and application type.

I have created Charisma to ease the repeat work I have to do on my projects. Now I re-use Charisma as a base or a package for my admin panel or backend work and I am sharing it with you :) . Its free for personal and commercial use and you can use it in multiple sites.

I have put a lot of effort on this, I just expect a share on Twitter or Facebook from you as a “Thank you!”.

Charisma free, premium quality, responsive, multiple skin admin template.

View Live Demo View on GitHub  Download

If you’re a PHP dev then you may like my new projects Pixie Database Query Builder and Strana Pagination Library.
If you’re looking for Charisma 1.x then here is the demo and here is the download link.

An alternative Download Link (if the Download button doesn’t work).

It is featured with many plugins and UI elements to ease your work. It works on all major browsers and optimizes itself for tablets and mobile phones. Above all its 100% FREE and open source. It is licensed under Apache License v2.0, respective licenses apply to all resources used. Issues and forks on GitHub are always welcome.

Features

  • 9 different themes
  • Fully responsive, optimized UI for tablets and mobile phones, see how it looks on different devices.
  • Based on Bootstrap 3.
  • Grandmother friendly, works on IE9+.
  • Commented code.
  • Custom product tour, see example.
  • Grid system, see example.
  • Charts, including, pie, stack, flot, realtime etc.
  • Data tables.
  • Widget boxes, collapsible, sortable, closable, see example.
  • Photo gallery, see example
  • Ajaxified menus.
  • Full calendar, monthly weekly, daily, with todo list.
  • Custom error page.
  • Auto active link detection and much more.

UI Elements

  • Custom Tooltip
  • Popover
  • Star Rating
  • Toggle Switch
  • Tag Boxes
  • Multiple File Upload
  • Dialog Box
  • Auto Growing Textarea
  • Ajax Loaders
  • Progress Bars
  • Alerts
  • Pop Notifications
  • Animations

Enjoy :)

Why Many Good Developers Don’t Get a Good Job?

I have seen a lots of really good developers looking for work and they don’t find good work for months or years. On the other hand I’ve seen some really good companies looking for developers and they don’t find good developer for months or years. What’s the problem? After looking at the situation of some of the developers and companies I have tried to find out the reason behind it. Let me share my thoughts with you.

What Made Me Think?

First of all let me tell you what made me think about it. I work for Vegan Cuts, a company based in Canada and I work from Bangladesh. I am really very happy working with them, they are very good guys, they pay well and they have everything to attract a really good developer. They are also very happy with me and they want to keep me.

Recently my company invited me for a meeting in New York, we also attended a conference where I met a lots of good PHP developers. Most of them were amazed to hear about me that I’ve made it here from the other side of earth, Bangladesh(which is a least developed country). Some of them wanted to hear my story, how I joined Vegan Cuts. As I am an isolated, homesick guy, for the first time I realized that my situation is not ordinary. I met some really great developers, who are struggling to find work. They have better programming skills than me and they’ve very good open source activity, they’re from a mature economy with many social and other benefits. It made me think, something is there.

Nature of Developers

“Yay! TheKoolLibrary released version 54.4598 today, which adds bunch of cool features. One feature is, now you can open things in a single click instead of double click, wow! Lets tweet about it, write an article on it.”
A typical day of a developer usually starts like this. We developers love cutting edge technologies. Like a kid, we want to play with a new toy everyday then the next day we throw it away for another toy(is that why the term “cool kid” is so popular among us?). And the problem is we want the companies be like us. Out of 100 toys we play with, only a few survive after a year.

Wow! Grunt is cool.
After few months, OMG! Gulp.

IDE’s are bloated, Sublime Text is insanely cool and Vim is hot for showing off.
After few months, JetBrains PhpStorm is powerful and highly customizable.

Fortrabbit hosting is awesome, `git push` to deploy.
After few months, go back to Digital Ocean, I can write a 5 line script for `git push` deploy.

Trello! Its free.
After few months, wait, Asana is insane! Too complicated, go back, pay Basecamp.

There are hundreds of examples.

Well, I am not against learning new technologies, but we need balance on everything, sometimes we just need to shut up and go to work with what we currently have.

It really reminds me a chapter of Rework: Focus on what won’t change. In one place it says:
“That’s fool’s path. You start focusing on fashion instead of substance. You start paying attention to things that are constantly changing instead of things that last.” – Rework

Nature of Companies

End of the day its all business. Asset maximization, this is the goal of a company.
What a company looks in you is, value, how much value you generate for the them. How serious you are to help them achieve their goal, how much you think this is your own business, even if its not. How quickly you can provide proper solution to a problem.

Well, if a company is using CodeIgniter for 4 years and the application is stable and generating a good value for company, no company will ever want to build it anew. But a usual good developer will burn out of hell working with CodeIgniter. But if this developer had owned this company his view would have been different.

So a good company, when hiring, mainly looks at your seriousness not coolness. They also take skills into consideration but its only when you’re serious. If you’re serious for your work, you’ll be generating good value for your company.

Here are few write ups from some company co-founders:
Leo Widrich of Buffer says in his article:
“Of course we need to know that you’ve got the skills and experience for the position in question, but that’s a secondary element for us.”

Jason Fried of Basecamp/37signals says, in his article that they look at the approach/effort of an applicant when hiring.

Solution

I won’t suggest companies to change rather I would suggest developers to change.

  • We’re so busy becoming a good developer that we forget to be a good worker.
  • We’re so busy learning every shiny, new thing that we forget to think about what we currently have, which gonna last for years. That’s our current work and current technology, lets focus.
  • We’re so busy thinking about the next big thing that we forget to generate value for our current company.

Of course, you’ve to be a good developer, but that’s not all, you’ve be a good worker too.
When you’re in a sports team, your main target is to make your team win, even if you performed your best and your team lost you’ll go bed unhappy. Lets apply sports rules to our work:

  • Play your best and enjoy the game.
  • Play to make your team win.
  • Keep practising.
  • Obey your captain/coach, definitely you can suggest.
  • Don’t try to change the rule of the game with something new, play your best with what you have.
  • Invent or introduce new strategies.

I want to end with few quotes:

I had feedback from my current employer and previous employers, which are quite similar, if I sum up these feedbacks it stands something like this:
“You’re not a just good developer but a smart developer, if one task is assigned to you we don’t have to worry about this anymore.”

“Remember, fashion fades away. When you focus on permanent features, you’re in bed with things that never go out of style.” -Rework
(Sorry, for too much Basecamp stuff)

“Perhaps the world isn’t giving you what you want because based on all your distractions … its simply unclear what you are asking for.” -Brendon Burchard

New York Trip and The Laravel Conference

I and John at Laracon

I work remotely for Vegan Cuts, which is based in Canada and I work from Bangladesh. As the team is distributed, Vegan Cuts arranges meetings every year in different countries. This time I was invited to visit New York :).

It was a long journey for me, Sylhet > Dhaka > Istanbul > New York, 20+ hours just in flight. I took 1.5 day break in Istanbul and explored the city, amazing, I must say.

At JFK airport our co-founders came to receive me, it was really nice to see them in person. We explored many cool places in New York City together and had a lot of fun. I bought a MacBook 15-inch Retina from Apple Store, which made me an OSX user after being Ubuntu user for years. Finally I and our co-founder John, who is more of a friend attended Laracon, a developer/PHP conference with focus on Laravel framework. At the conference we met some cool developers. Overall, it was an amazing experience, full of fun.

If you’re interested you can view the photos:
New York Photos
Istanbul Photos

Don’t Fear Exceptions

If you’re not one of the few, you surely get scared once you see one of these:

Fatal error: Uncaught exception ‘Exception’ with message ‘Not found’ in /home/usman/www/test.php on line 27

Fatal error: Uncaught exception ‘UnexpectedValueException’ in /home/usman/www/test.php on line 27

When you see Red or Orange screen with Exception you fear like you’ve committed a sin and just go back to code to repent. Congrats, you’re the majority.

What if I told you that Exceptions are no sin, rather blessings of object oriented programming?
What if I told you that an Exception doesn’t just mean that your code is wrong?

Let me show you how.

For example code, I am using Laravel PHP framework. But the knowledge is not Laravel specific. This article assumes that you know basics of Exception and how to catch it.

An Example

I believe in practical example, so rather than preaching, I am showing you a real life example.

It is really common, when a you search for an entry in database, you check if this entry exists. If not then you show an error.

$person = Person::find($id);

if (! $person) {
    // Show message: Person not found
}

// Person found
return View::make('person.show', compact('person'));

You handle this problem with an if everywhere, why? Why don’t you just throw an exception when something doesn’t exist? Do just this:

$person = Person::findOrFail($id); // Will throw an exception if not found
return View::make('person.show', compact('person'));

In just one place catch this error. For Laravel, put this in your app/start/global.php:

App::error(function(\Illuminate\Database\Eloquent\ModelNotFoundException $e)
{
    return 'Entry not found'; // You can show 404, or do whatever you want
});

If you’re not using Laravel then catch the exception using try-catch when you boot your application.

Advantages of Using Exceptions

An Exception is just what is not expected. Be fearless to throw an Exception whenever you think something is not expected and the function/method/application should stop executing further.

One of the big advantages of using Exception over traditional redirect, die/exit is that you separate your business logic from your transport layer(ex, HTTP).

For example, you use a direct HTTP redirect when a form validation fails. Now what if the end user is not using a browser at all, he is using your mobile app which uses the same business logic with an API? What if you’re unit testing? What if you’re firing a background job with CLI? No HTTP at all, now how?

You’re right, Exception. Create a class ValidationException which extends \Exception. And whenever a validation fails:

    throw new ValidationException('Hey kid, you forgot your name?');

Now catch this Exception:
In case of usual HTTP use, do a redirect.
In case of API, set a status code with JSON message perhaps.
In case of CLI, just dump the error message.

In the Example section above, you’ve seen another advantage. How we made our code simple and DRY(Don’t Repeat Yourself).
There are many other advantages, I’m not going over everything, please check this article if you’re not convinced.

In the end

I ask you one thing, please do yourself a favor, make use of object oriented best practices(like utilizing Exception) where it fits, you won’t regret. Our PHP community has been late in this regard, but the revolution is coming.

Please feel free to share your thoughts.

If you’re a Laravel developer then you may also like my model self-validating package with Exception – DRYVal.

Strana – Smart Pagination Library for PHP

A framework agnostic, smart pagination library for PHP. Just a few lines of code and fully functional pagination is ready.

Paginate your records with Strana. Strana will slice(limit and offset) these records, generate pagination links for you and reads page number from them, all automatically.

Features:

  • Built-in adapters for DoctrineEloquent (Laravel)Pixie, PHP Array and you can do it manually.
  • Readable syntax
  • Add Infinite Scroll with one line
  • It automatically detects which DBAL you are using.
  • Styles automatically with Twitter Bootstrap, Zurb Foundation and most of other CSS frameworks.

Check out the installation instructions and documentation on GitHub.

Install or View on GitHub

Screenshot:

Screenshot

Example

Basically Strana makes it very easy, like the code below:

$paginator = $strana->perPage(10)->make($records);

That’s basically it.

Full Usage Example

// Make sure you have Composer's autoload file included
require 'vendor/autoload.php';

$strana = new \Strana\Paginator();
$records = array(1, 2, 3, .... 100);
$paginator = $strana->perPage(10)->make($records);

// Loop paginated items
foreach ($paginator as $item) {
    echo $item['field_name'] . '<br>';
}

// Print pagination links
echo '<br><br>;' . $paginator;

There are some advanced options which are documented below. Sold? Lets install.