Skip to content

Instantly share code, notes, and snippets.

@turboezh
turboezh / dict_ru.sh
Created October 12, 2018 11:56
Russian spellcheck dictionary for JetBrains
#!/bin/bash
aspell --lang ru-yeyo dump master | aspell --lang ru expand | tr ' ' '\n' > russian.dic
@turboezh
turboezh / ProcessHelper.php
Created April 21, 2016 15:38
Communicate to process by pipes
<?php
namespace app\helpers;
use Yii;
use yii\base\Exception;
/**
*
*/
@turboezh
turboezh / JS.php
Created April 8, 2016 07:14
Yii2 JS script widget
<?php
namespace app\widgets;
use yii\base\Widget;
use yii\web\View;
/**
* Register JS script.
<?php
namespace app\helpers;
use yii\base\InvalidCallException;
use yii\base\UnknownPropertyException;
@turboezh
turboezh / .nanorc
Last active June 6, 2024 09:13 — forked from iromli/gist:1239442
Nano editor config (.nanorc)
## Sample initialization file for GNU nano.
##
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read! Also note that this file should not be in
## DOS or Mac format, and that characters specially interpreted by the
## shell should not be escaped here.
##
## To make sure a value is disabled, use "unset <option>".
##
## For the options that take parameters, the default value is given.
@turboezh
turboezh / IncrementalAvg.php
Created December 17, 2015 14:31
Incremental average counter
/**
* Считает среднее арифметическое,
* позволяя добавлять знаения последовательно без знания их количества.
*/
class IncrementalAvg
{
private $n = 0;
private $mean = 0;
/**
@turboezh
turboezh / solr.sh
Last active March 26, 2016 20:49
Apache solr gentoo openrc init.d script
#!/sbin/runscript
NAME=solr
# customize path
SOLR_PATH=/opt/solr/example
COMMAND=java
OPTIONS="-Dsolr.solr.home=$SOLR_PATH/solr -Djetty.home=$SOLR_PATH -jar $SOLR_PATH/start.jar"
PIDFILE=/var/run/$NAME.pid