Skip to content

Instantly share code, notes, and snippets.

View gaintsev's full-sized avatar
🎯
Focusing

gaintsev gaintsev

🎯
Focusing
View GitHub Profile
@gaintsev
gaintsev / gist:a7a79b4644e656ad8096102880d82a70
Created March 16, 2021 11:10 — forked from Neolot/gist:3964380
PHP Склонение числительных
<?php
/**
* Функция склонения числительных в русском языке
*
* @param int $number Число которое нужно просклонять
* @param array $titles Массив слов для склонения
* @return string
**/
$titles = array('Сидит %d котик', 'Сидят %d котика', 'Сидит %d котиков');
function declOfNum($number, $titles)
@gaintsev
gaintsev / gist:132b42dfe309b3cb91453441e2692547
Created September 2, 2019 11:01 — forked from poliveira89/gist:5966434
How to use WebDav on Linux+XFCE+Thunar
davs://poliveira@some.webserver.pt/webdav/someFolder
@gaintsev
gaintsev / README.md
Last active August 28, 2018 17:28 — forked from DamonOehlman/README.md
Provisioning of node + nginx designed for use with vagrant shell provisioner. No need for chef, puppet.

This is a simple shell script that is designed to provision both nginx and node on your machine. I primarily wrote it for use with Vagrant and an example Vagrantfile is included in the Gist as well.

@gaintsev
gaintsev / install.sh
Created October 15, 2017 10:37 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@gaintsev
gaintsev / vdi-file-compacting.md
Created September 4, 2017 17:07 — forked from kuznero/vdi-file-compacting.md
How to compact VirtualBox's VDI file size?

Source: StackOverflow

1. Run defrag in the guest (Windows only)

2. Nullify free space:

With a Linux Guest run this:

sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
@gaintsev
gaintsev / cdn.html
Created August 23, 2017 22:55 — forked from 0frasure/cdn.html
Material Design Icons CDN
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">