Skip to content

Instantly share code, notes, and snippets.

View Skrip42's full-sized avatar
👨‍🔧

Skrip42 Skrip42

👨‍🔧
  • owl technology
  • Russia, Novokuznetsk
View GitHub Profile
@Skrip42
Skrip42 / select-top-n-for-each-group.sql
Created September 28, 2021 09:32 — forked from lysender/select-top-n-for-each-group.sql
MySQL Select top n for each group
set @num := 0, @type := '';
select type, variety, price
from (
select type, variety, price,
@num := if(@type = type, @num + 1, 1) as row_number,
@type := type as dummy
from fruits
order by type, price
) as x where x.row_number <= 2;
@Skrip42
Skrip42 / install-vim-8-with-python-ruby-lua-opensuse.sh
Last active October 1, 2020 04:14 — forked from erickpatrick/install-vim-8-with-python-ruby-lua-ubuntu.sh
Install Vim 8 with Python, Python 3, Ruby (2.5) and Lua support on openSuse
# remove current vim
sudo zypper rm vim vim-runtime vim-gnome vim-tiny vim-gui-common
# removes current link for vim
sudo rm -rf /usr/local/share/vim /usr/bin/vim
sudo zypper addrepo https://download.opensuse.org/repositories/home:ochaton/openSUSE_Tumbleweed/home:ochaton.repo
sudo zypper refresh
# installs everything needed to make/configure/build Vim