Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrey Chernomyrdin chernomyrdin

  • Russia, Saint-Petersburg
View GitHub Profile
View snap.debug.log
SNAPD_DEBUG=1 /snap/bin/telegram-desktop
2021/12/17 22:41:19.635801 tool_linux.go:204: DEBUG: restarting into "/snap/snapd/current/usr/bin/snap"
2021/12/17 22:41:19.660235 cmd_run.go:425: DEBUG: SELinux not enabled
2021/12/17 22:41:19.660538 tracking.go:45: DEBUG: creating transient scope snap.telegram-desktop.telegram-desktop
2021/12/17 22:41:19.661082 tracking.go:185: DEBUG: using session bus
2021/12/17 22:41:19.663368 tracking.go:290: DEBUG: StartTransientUnit failed with "org.freedesktop.DBus.Error.Spawn.ChildExited": [Process org.freedesktop.systemd1 exited with status 1]
2021/12/17 22:41:19.663391 cmd_run.go:1187: DEBUG: snapd cannot track the started application
2021/12/17 22:41:19.663407 cmd_run.go:1188: DEBUG: snap refreshes will not be postponed by this process
DEBUG: umask reset, old umask was 022
DEBUG: security tag: snap.telegram-desktop.telegram-desktop
View expr.go
package qb
import (
"io"
"strconv"
"strings"
)
const PlaceHolder = "?"
View keybase.md

Keybase proof

I hereby claim:

  • I am chernomyrdin on github.
  • I am chernomyrdin (https://keybase.io/chernomyrdin) on keybase.
  • I have a public key ASCq-emI1BAZyD5J-aF5Mb0SlfgYDaMb3J6_aaqKqFU1AQo

To claim this, I am signing this object:

@chernomyrdin
chernomyrdin / sample-phar.php
Created Mar 16, 2015
Make phar from laravel app
View sample-phar.php
<?php
class UserFilter extends FilterIterator {
public function accept () {
$file = $this->getInnerIterator()->current();
$path = explode("/", $file, 3);
if (count($path) < 2 or !in_array($path[1], array('app','bootstrap','vendor'))) return FALSE;
elseif ("/." == substr($file, -2)) return FALSE;
elseif ("/.." == substr($file, -3)) return FALSE;
# echo $file, PHP_EOL;
@chernomyrdin
chernomyrdin / pg_listen.php
Created Mar 11, 2015
Using LISTEN/NOTIFY PostgreSQL in PHP (async/pool mode)
View pg_listen.php
<?php
/**
* Class Main - Проверяем возможность работы с LISTEN/NOTIFY в PostgreSQL
* Вывод: Подобное возможно только начиная с PHP 5.6, так как только там появилась функция pg_socket($dbh)
* Так-же демонстрируется возможность работать по опросу, что менее удобно, но это лучше чем ничего
*/
class Main {
/**
@chernomyrdin
chernomyrdin / Replacer.php
Created May 27, 2014
Replace substring, append some string demo for preg_replace_callback
View Replacer.php
<?php
class Replacer {
private static $__instance;
private $regex = '';
private $append = '';
private $replace = array(
'ул' => 'улица',
'ш' => 'шоссе',
View for_closure.js
/**
* @output_file_name default.js
* @compilation_level ADVANCED_OPTIMIZATIONS
* @formatting pretty_print
*/
/**
* Sample location parameter access classs
*/
View if_grep.pl
#!/usr/bin/perl -w --
use strict;
use Benchmark;
my $num = 3;
my $match = 0;
timethese( 1e8, {
just_if => sub {
if ($num == 0 or $num == 1 or $num == 2 or $num == 3 or $num == 4 or $num == 5) {
@chernomyrdin
chernomyrdin / template.php
Created Nov 21, 2012
Small template engine for PHP
View template.php
<?php
class Template {
private $vars = array();
private $file = null;
function __construct ($file = null, $vars = null) {
$this->file = $file;
if (!is_null($vars)) {
$this->vars = $vars;
View autoload.pl
#!/usr/bin/perl -w --
use strict;
use warnings;
use diagnostics;
sub new {
my $class = shift;
my $obj;