Archive for April 2019

Creating Laravel Package

If you already have Laravel move to Step 2 Step 1. Get Laravel composer create-project –prefer-dist laravel/laravel . Step 2. Create following folder structure: mkdir -p packages/aghayevi/modulename/src Step 3. Do the following cd packages/aghayev/modulename composer init   This command will guide you through creating your composer.json config.   Package name (<vendor>/<name>) [root/modulename]: aghayevi/modulename Description []: […]

Difference between abstract class and interface

In short, in case of full abstraction of methods you want to define use interface, in case of partial abstraction, if some methods you want to define are common among concrete classes but some are not then use abstract class Abstract class can have definitions of constants, abstract methods or method stubs (methods without body/implementation) […]

Top 10 security vulnerabilities by OWASP

A1 Injection (PHP include, global variables, Sql Injection through Url) A2 Broken authentication (To avoid broken authentication put into practice not leaving the login page for admins publicly accessible. Rename /wp-admin/ on WordPress to something else. Rename /admin in Magento to something else) A3 Sensitive data exposure (arp spoofing resulting traffic sniffing, stealing auth passwords, […]

4 Main principles of modern object based programming

Abstraction (Abstract classes and Interfaces) > Inheritance (class extends parent Abstract or concrete class). Encapsulation (blackbox, isolation methods, getters, setters, Creational Patterns) Polymorphism (overriding, logical cluster principle – many classes (nodes) on same level with diff implementation of same function (operation), Operational patterns, Strategy pattern) Inheritance – пожалуй, важнейшая особенность object based programming. Если требуется […]

How-to disable screen lock (screensaver) on Ubuntu

Applications -> System Settings -> Brightness & Lock -> Lock On/Off