Skip to content

Instantly share code, notes, and snippets.

View shabarin's full-sized avatar
💬
https://t.me/asdfasdfasdf

ivan shabarin

💬
https://t.me/asdfasdfasdf
View GitHub Profile
@shabarin
shabarin / problem.py
Last active September 15, 2021 11:43
def solutionC(a):
g = {}
maxnum = 1
for i in range(0, len(a)):
if a[i] > 0:
g[a[i]] = 1
maxnum = max(maxnum, a[i])
for j in range(1, maxnum+2):
if j not in g:
return j
@shabarin
shabarin / umi selector
Created July 20, 2017 13:43
umi selector
<?php
class catalog_custom extends def_module
{
public function mysearch()
{
$searchStr = getRequest('search_str');
$pages = new selector_custom('pages');
$pages->types('hierarchy-type')->name('catalog', 'object');
$pages->where('description')->cslike('%'.$searchStr.'%');
$pages->where('photo')->regexp('jpg$');
@shabarin
shabarin / generate_cert.sh
Last active December 19, 2016 10:44
self-signed ssl cert
openssl req -x509 -newkey rsa:2048 -keyout test.key -out test.crt -days 1 -nodes -subj "/C=RU/CN=*.localhost"
@shabarin
shabarin / ngx.conf
Last active May 13, 2017 10:07
pagespeedngx
#server {
#...
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {