Skip to content

Instantly share code, notes, and snippets.

ivan shabarin

  • Ivanovo, Russia
View GitHub Profile
View 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 Dec 19, 2016
self-signed ssl cert
View generate_cert.sh
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
pagespeedngx
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
shabarin / testmail.php
Last active Sep 14, 2016
tmweb base64 html email test
View testmail.php
<?php
$to = "ivan@shabarin.ru";
$subject = "base64 html email test";
$messageHtml = <<<EOF
<html>
<head>
<title>HTML email test</title>
</head>
<body>
You can’t perform that action at this time.