Skip to content
1 min readServers

Simple MySql daily and weekly backups on Linux

Recently I had a task to create automatic Mysql database backups daily and weekly and keep some number of those backups. After some short googling I come up with a quite small and simple shell script that just works. To make this happen we need few following steps: Create a new file in /etc/cron.daily/ folder … Continue reading Simple MySql daily and weekly backups on Linux

2 min readLaravel6 comments

MS SQL on Vagrant Ubuntu Homestead box for development on Laravel

Hi everyone! Recently I had a chance to setup and successfully run development environment with Microsoft SQL Server on Laravel’s Homestead Vagrant box. I used Homestead installation per project. And here is how I’ve done it. Prepare Homestead box First step is to install Homestead for a project: composer require laravel/homestead –dev php vendor/bin/homestead make … Continue reading MS SQL on Vagrant Ubuntu Homestead box for development on Laravel

1 min readFacebook1 comment

Facebook Graph API – upload photo using JavaScript from local computer

Hi everyone, recently I encountered a problem with uploading photos to Facebook using Graph API with JavaScript. And there were no working solutions on Stack Overflow nor some example in official Facebook documentation. So I have to figure out something, and here is how I do it: $(‘#button_upload’).click(function (e) { e.preventDefault(); // Get file object … Continue reading Facebook Graph API – upload photo using JavaScript from local computer

1 min readServers2 comments

MySql (MariaDB) crashes on small RAM VPS, what to do

Recently I encountered one weird problem, my MariaDB database started to crash from time to time on one of my small RAM (512mb) virtual private servers. After some short googling I found out what what is potential problem with MariaDB on small RAM machines and how to fix it. First of all, if you have this … Continue reading MySql (MariaDB) crashes on small RAM VPS, what to do

3 min readWordpress40 comments

Using WordPress Media Library in Widgets options

So how to add WordPress media uploader popup to our custom widget? That’s not so hard, hovewer there are a few caveats. Let’s start from our simple widget class, I’d recommend to get example from https://codex.wordpress.org/Widgets_API#Example. Then we will need to add our new option, it will be called “image”. Just copy and paste fields in … Continue reading Using WordPress Media Library in Widgets options

3 min readCSS3

CSS vertical centering techniques

So what is the best way to center blocks vertically using CSS? There are bunch of techniques, lets try each of them! 1. “line-height” property HTML code: <div class="outer-block"> <div class="inner-block"> <p>Some text</p> <p>Some more text</p> </div> </div> CSS code: .outer-block { height: 200px; line-height: 200px; text-align: center; } .inner-block { display: inline-block; line-height: 1.5; text-align: left; … Continue reading CSS vertical centering techniques

4 min readCSS32 comments

Image slider on pure CSS3

Recently I’ve read one article about slider without any JS code and I decided to extend this idea and here is what i’ve got. First, we will need basic HTML layout for slider: <ul class="css-slider"> <li><img src="slides/1.jpg" alt=""></li> <li><img src="slides/2.jpg" alt=""></li> <li><img src="slides/3.jpg" alt=""></li> <li><img src="slides/4.jpg" alt=""></li> <li><img src="slides/5.jpg" alt=""></li> </ul> Quite simple and straightforward. … Continue reading Image slider on pure CSS3