Skip to content

Instantly share code, notes, and snippets.


ivan shabarin

  • Ivanovo, Russia
View GitHub Profile
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
View umi selector
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');
shabarin /
Last active Dec 19, 2016
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 / ngx.conf
Last active May 13, 2017
View ngx.conf
#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}\.[^.]+" {
shabarin / testmail.php
Last active Sep 14, 2016
tmweb base64 html email test
View testmail.php
$to = "";
$subject = "base64 html email test";
$messageHtml = <<<EOF
<title>HTML email test</title>