Laravel AuthServiceProvider querying from the database

You know how it is. If you tackle some bigger projects it is very likely you will feel the need for a more flexible authorization system. For example, you would like to have a proper roles and permissions management system in place which communicates with the database. Since Laravel 5.1 this is a fairly easy task to accomplish, but there is something you should consider while messing around with Eloquent and the AuthServiceProvider.

Continue reading

Everything you need to know about PHP7

It took a few more weeks than initially planned, but PHP7 has now finally been released. The development team first expected to roll-out the stable version of PHP7 on November 12, 2015 – but due to some minor issues they decided to postpone its release and make some more release candidates available to the public for testing purposes. Personally, I was really happy to see the PHP team setting their priority to stability and performance instead of just releasing software for the sake of making the community happy. Good job!

Continue reading

Install CM13 on the Nexus5 (updating from CM12.1)

The Cyanogenmod Team has just released the newest version of Cyanogenmod for a bunch of devices. The original blog post already provides a lot of useful information concerning the actual development progress and installation instructions. For testing purposes (and because I am too impatient to wait for the stable release) I will attempt to update my phone (Nexus5) from CM12.1 to CM13.

Continue reading

Use ZSH as your default shell on OSX

Working with the terminal is really great if you know what you are doing. Sadly, the default shell and its configuration won’t offer you some of the handy extensions that are available today. Especially if you need to navigate through complicated directory structures or manage git repositories from your terminal, you might want to consider changing to ZSH to increase your productivity. It offers you a LOT of advantages compared to other shells (like bash), so why shouldn’t we give it a try?

Continue reading

Quick and dirty resizing of ImageIcon in Java

This is going to be quick. When building an graphical user interface, you sometimes might want to include some pictures to give your interface a special taste. In this case we are not talking about big and fancy pictures, we are talking about simple icons.

Continue reading

How to properly read file extensions with PHP

Just yesterday we did something awful – we used  substr($filename,-3) to read a file extension, facepalm time! But sometimes after having done things the “harder way” gives you a greater feeling of satisfaction. But of course, the biggest satisfaction is to do things the proper way. Especially if the proper way saves CPU on your server (which isn’t really the case here but I still want you to show you how it is done right).

Continue reading

Simple image gallery with CodeIgniter

For certain projects with a limited amount of pictures and low budget a very simple image gallery always does the trick. Of course you will soon start missing a few very handy features like automatic thumbnail generation and stuff – but this should just give you some hints on how to use CodeIgniter to read some files out of your filesystem and pass the data over to your view.

Continue reading

Truncate a string in PHP without cutting the word in half

Especially if you are running a blog, you would like to give a short preview about your post content to attract the user to click on the link and read the full article. Short previews are a very common thing, yet for a lot of PHP beginners it is a mistery on how to actually generate the preview text.

Continue reading

Dynamic formatting with CodeIgniter’s pagination library

Just yesterday we were talking about generating a nice pagination with CodeIgniter. But somehow I could not sleep well tonight, why? Because I have the feeling that most of you guys will now try to use some ugly hacks to change the format of the generated links. My fault, this is something I should have added to the other article – but being a technical guy gives me the urge to separate design from functionality. So here is your silver platter on how to generate nice HTML code for your pagination.

Continue reading

How to use the pagination library in CodeIgniter

Pagination is lovely. It gives the visitor of your website a lot of advantages. First of all it ensures a much more efficient handling of the server resources, as you can define how many record per page you would like to load – therefore shorter loading times for the user. Second it pushes the focus on your newer records (depending on whatever elements you are displaying on the site), so the user will not have to scroll him or herself to death. A pagination is not always a very easy task, it can require a lot of code and especially a lot of brainstorming if you are working with a MVC structure.

Continue reading

© 2016 Salvatore Mulas

Theme by Anders NorenUp ↑