Skip to content

Instantly share code, notes, and snippets.


Skrip42 Skrip42

  • centra
  • Russia, Novokuznetsk
View GitHub Profile
View select-top-n-for-each-group.sql
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 /
Created Oct 7, 2020
dbf to sql converter
import sys
from simpledbf import Dbf5
filename = sys.argv[1]
dbf = Dbf5(filename, codec='cp866')
dbf.to_textsql(filename.replace('DBF', 'sql'), filename.replace('DBF','csv'))
View pagemap.yaml
title: 'Главная'
nav: false
route: 'home'
title: 'Логин'
nav: false
View PageMap.php
namespace App\Services;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Security;
Skrip42 / phpdoc.shippet
Created Sep 26, 2019
php docblock for ultisnips
View phpdoc.shippet
global !p
import os
def readconf():
conf = dict(phpversion='7', package = '', author = '', license = '', link = '')
pwd = os.getcwd()
if os.path.isfile(pwd + '/.usrc') != True:
return dict()
conff = open(pwd + '/.usrc', 'r')
data ='\n')
for i in range(0, len(data)):
Skrip42 /
Last active Oct 1, 2020 — forked from erickpatrick/
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
sudo zypper refresh
# installs everything needed to make/configure/build Vim