I was looking for some solution which will allow me to make more efficient update old and insert new item into MySQL database. 1. My story I have some data, which should be imported from a side datasource into my database. So, there is no possibility to match ids of outer data and local. Also… Continue reading Java batch UPDATE/INSERT database
Tag: php
Twitter: simple favorite’ing bot on PHP
Recently I found out that lot of twitter bots are favorite’ing and retweetting you statuses. I decided to create my own to play around a little. Simple search for PHP library, showed me that there are many of these here Twitter Libraries. I selected J7mbo/twitter-api-php and played around a little. Here is what I got: ini_set(‘display_errors’, 1); require_once(‘TwitterAPIExchange.php’);… Continue reading Twitter: simple favorite’ing bot on PHP
Android: how and why not to use ACCESS_COARSE_LOCATION
I will start from why you should avoid using ACCESS_COARSE_LOCATION directive in your Manifest.xml file. ACCESS_COARSE_LOCATION allows you to get approximate location of user’s device. It is detected not by GPS, but using different means – wifi hotspots, network triangulation etc. Actually, it is pretty accurate and it is worth considering to use in case… Continue reading Android: how and why not to use ACCESS_COARSE_LOCATION
Woocommerce & Polylang: shop page in proper language
I combined Woocommerce & Polylang to make multilingual shop. The problem appeared, while I tried to display Shop page in other language than main one. I solved the problem in the following way: Add the code to your theme function.php file. function get_woocommerce_shop_polylang() { return pll_get_post(get_option(‘woocommerce_shop_page_id’ ) ); } add_filter(‘woocommerce_get_shop_page_id’, “get_woocommerce_shop_polylang”); This function actually gets… Continue reading Woocommerce & Polylang: shop page in proper language
Polylang and custom fields: How to copy and how to not.
Polylang is a very powerful tool to enable your WordPress site to be multilingual. The only problem, I met during development is not simple and clear way of copying of custom fields to new language posts versions. Answer was found here [resolved] polylang not syncing custom fields If you want to make some custom field… Continue reading Polylang and custom fields: How to copy and how to not.