AuthorDaniel V

How to pass data to JavaScript with Basset?

This article explains how to pass data from server PHP to JavaScript with Basset – better asset management for Laravel.

Sometimes you will want to pass data from server PHP to JavaScript but without API. It can be to preload data, or to pass some server specific data which shouldn’t be in API’s.

You can use Basset\Javascript class for that. Whatever you set on this class will be available from the browser JavaScript runtime.

Continue reading

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

How to use Font Awesome with Basset?

This article explains how to use third party font icon sets with Basset – better asset management for Laravel.

In this guide, we will include Font Awesome with Bower and use icons in our Laravel application.

Continue reading

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

Basset – auto .min swapping

Normally, for production build, Basset runs UglifyJS to minify JavaScript, and you get pretty good results from minifying with UglifyJS.

Sometimes third party code (like in bower_components) comes with .min files, already minified files. They are most often minified with UglifyJS.

But sometimes libraries, like AngularJS, come with files minified with Google’s Closure Compiler, which can sometimes have even smaller files then UglifyJS (if you specifically optimize your code for Closure Compiler).

And if you use many of those libraries, you can cut down on your build sizes a lot.

Basset can use that. Basset has feature “auto .min swapping” which will try to discover those .min files and use their content instead of normal raw source files. Those .min files will still go through UglifyJS, but the benefits of Closure Compiler, or any other different minifier, will remain there.

So you can just use gulp production build with Bower components and never think about it. Basset will do the rest for you.

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

Basset – asset collections for Laravel

Introducing Laravel Basset (which stands for Better Asset Management) is a Gulp asset building system with integration for Laravel PHP framework.

Laravel Basset is inspired by Basset package for Laravel by Jason Lewis.

It comes with Browserify, ES6, SCSS, LESS, CoffeeScript, Autoprefixer, Livereload and Bower support included.

Continue reading

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

Validate values in PHP with Respect\Validation

Need a easy validation package for your PHP project. Respect\Validation could be the right library for you. It has 80 fully tested validators and its easy to install and use. How easy? How about:

v::numeric()->positive()->between(1, 256)->validate($myNumber)

See more at:

http://documentup.com/Respect/Validation

To install with Composer:

composer require respect/validation
Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

jQuery Resizable Table Columns

Resize your table columns by dragging the header edges. It also stores cell sizes for page refresh. Works in Chrome & Firefox (Mac + Windows), and IE 9 + 10, and also Chrome for Android.

Read more at:

https://github.com/dobtco/jquery-resizable-columns

Demo:

http://dobtco.github.io/jquery-resizable-columns/

To install with Bower:

bower install jquery-resizable-columns

 

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

The most popular PHP-related sites in 2014

See the most popular websites related to PHP programing language, based on Alexa rankings:

http://szabgab.com/the-popularity-of-php-in-2014.html

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

How to Back Up Your WordPress Database

“WordPress stores a ton of important stuff in the database. You probably know your actual content is in the database: blog posts, pages, custom post types, comments, etc. But the database stores more than content. Much more …”

Read more at:

http://css-tricks.com/back-wordpress-database/

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

PerfBar – website performance metrics

Simple way to collect and look at your website performance metrics quickly, that supports budgeting and adding custom metrics.

Read more at:

http://lafikl.github.io/perfBar/

To install with Bower:

bower install perfbar

 

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

PHP 7 new hashtable implementation

“As part of the work on the upcoming PHP 7, large parts of the Zend Engine have been rewritten with a focus on smaller data structures requiring fewer allocations. In this article I will provide an overview of the new hashtable implementation and show why it is more efficient than the previous implementation.”

Read more at:

http://nikic.github.io/2014/12/22/PHPs-new-hashtable-implementation.html

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest

© 2017 Legacy Blog