Sometimes you want to install react native on ubuntu 16.04 and you’ve got the error that the app can’t connect to the emulator so you have to type the next command to see the output I’ve got the next result the result is proper Java: 1.8.0_265 – /usr/bin/javac but before I didn’t see this like…
Working with xml or html in php
So sometimes we need to work with html or xml editing some file or whatever. Recently I encountered with such type of job. The main operations: 1 read file2 search and replace data3 write file Reading files To read file we use this code notice that we are using $dom->loadXML because the file is .xml….
PHP How to get the duration between the two dates
We have a simple function which return the duration between the time() and the unix time That’s it 🙂
Chrome how to import or export the visited links to the another chrome
Sometimes we need pass the old data to the new computer where is set up a new chrome browser. For instance, assume that we want to save a old browser history data to a new browser. To do that we have to do the next: find the path to the folder where chrome stores data….
How to turn off phpmyadmin log out automatically
Phpmyadmin always logout in a while time that is annoying… To fix that you have to change some variables in /etc/phpmyadmin/config.inc.php and /etc/php/7.0/fpm/php.ini. It’s for Ubuntu 16.04. Here is an official phpmyadmin documentation Cookie authentication options In the /etc/phpmyadmin/config.inc.php add the next code
1 2 3 4 5 |
$sessionDuration = 60*60*24*7; // 60*60*24*7 = one week ini_set('session.gc_maxlifetime', $sessionDuration); $cfg['LoginCookieValidity'] = $sessionDuration; $cfg['LoginCookieValidity'] = 604800; $cfg['LoginCookieStore'] = 604800; |
In the file /etc/php/7.0/fpm/php.ini change the variable to
1 |
session.gc_maxlifetime = 999999 |
Restart php-fpm
1 |
sudo systemctl restart php7.0-fpm |
That’s it
Gipm sclerotic
How to make color transparent here is tutorial https://www.youtube.com/watch?v=C2UdO4xbfsA 1 we have to create an alpha channel by clicking on an image right mouse click > Layer > Transparency > Add Alpha Channel 2 select by color needed color in the menu right mouse click > Select > By Color 3 clear the selected color right…
JavaScript sclerotic
How to convert value to string you have three ways Converting a value to string in JavaScript String(value) “” + value value.toString() value.toString is the worst. It doesn’t always work. So don’t use it. I personally use String(value) or “” + value How to use this (hard binding in javascript) this is a binding…
photoshop sclerotic
How to create a circle in photoshop I needed to create a circle and it was very difficult. So at the end I created it. At first you need a write circle, To do this use a tool Elipse tool, they are grouped together with other shapes to see this dialog you have to click…
mysql sclerotic
How to check row existence You can use this query
1 2 3 4 5 |
INSERT INTO `usersAndProjects` (status, userId, projectId) SELECT * FROM (SELECT 'unresolved', 2, 1) AS tmp WHERE NOT EXISTS ( SELECT id FROM `usersAndProjects` WHERE userId = 2 AND projectId = 1 ) LIMIT 1 |
How to insert data and make sure the data is being inserted by users whom the data is belong Sometimes we have to insert data to the tables where only ids, and we don’t know which user the data is belong. To find…
How to remove an image from the google search
Sometimes need to remove an image from the google search. First of all you should remove the image from the site and then make a request to the google. On the google help page is not clear written what to do. There is said you have to copy link and put it to their remove…