Laravel 5 - Device Detector Cache Proxy

Łukasz Piotrowski Comments 0

DeviceDetector is a tool which based on UserAgent detects and returns us very useful information like browser, device, system etc.

It has very interesting option to detect if user which browse our page is bot or not.

Using this tool you can use Cache. By default it supports doctrine/cache. We can by own implement cache. To do this we need to implement interface DeviceDetector\Cache\Cache.

I decided to write my own very simple Proxy which You can use with current using Cache system implemented in Laravel 5


Categories: Laravel

Laravel 5 Global Routing Package

Łukasz Piotrowski Comments 0

Hi!

Laravel 5 Global Routing gives You possibility making own controllers and access to them via URL.
Similar feature was released on CakePHP.


Laravel – Simple Query Debug

Łukasz Piotrowski Comments 0

Sometimes We must check exactly what query was generated by Eloquent or DB. Unfortunately it's not simple as we can imagine.

The solution might be install laravel-debugbar, but if we want check only one query it's unnecessary to install it.

I'll give You very simple solution :)


Laravel 5 – Load ServiceProvider depend on .env file

Łukasz Piotrowski Comments 0

We have many situations when We need register some ServiceProviders only on development version depends on .env file
Ofcourse You can add entry to config/app.php. But on situation when You don't have Provider on production env it throws errors.
This kind of situation can ocures after adding entry to require-dev sectioncomposer.json file.

The solution is very simple and elegant. It saves our time and many trouble.


Sublime Text – Phalcon code completion

Łukasz Piotrowski Comments 0

Hello.

It's my first post in English. I will try to write more and more.
Today I'll show you how to enable Phalcon code completion in Sublime Text 3.

Change Gitlab Sidekiq workers

Łukasz Piotrowski Comments 0

After install GitLab Sidekiq makes default 25 workers. To change it do simple step.

Touch file sidekiq.yml in /home/git/gitlab/config and paste:

---
:concurrency: 5

Next restart GitLab service gitlab restart and done.

Other posible options:

---
:verbose: false
:pidfile: ./tmp/pids/sidekiq.pid
:concurrency: 25
# Set timeout to 8 on Heroku, longer if you manage your own systems.
:timeout: 30
:queues:
  - [critical, 3]
  - [default, 2]
  - [low, 1]

PHP – Array flattern function

Łukasz Piotrowski Comments 0

Hi!

Today I needed small function to flattern my multidimensional array.
It's not normal becouse it fetch all arrays with walues and put it into 2 dimensional array.

Rsync – simple incremental backup v.1.1

Łukasz Piotrowski Comments 0

Hi.

A long time ago I published very simple script to making incremental backup. I've updated it changing some functionality.


Categories: Linux
Tags: Bash rsync Linux
Top