Skip to content

Instantly share code, notes, and snippets.

∇ app
∇ core
∇ guards
auth.guard.ts
module-import.guard.ts
no-auth.guard.ts
∇ interceptor
token.interceptor.ts
error.interceptor.ts
∇ services
@ijakparov
ijakparov / gist:d398a93b24876fa62f603c30ffb241f8
Created October 20, 2020 13:13
WPRESTStarter FieldReader
<?php
namespace RESTAPI\Fields\FieldsReaders;
use Controllers\DepotsController;
use Inpsyde\WPRESTStarter\Common\Field\Reader;
class ContactsFieldReader implements Reader
{
/**
~~php
public function store(ProjectRequest $request)
{
//
//$morphy = new \phpMorphy(null, 'ru_RU');
$now = Carbon::now();
<?php
$args = array(
'label' => '', // Text in Label
'class' => '',
'style' => '',
'wrapper_class' => '',
'value' => '', // if empty, retrieved from post meta where id is the meta_key
'id' => '', // required
'name' => '', //name will set from id if empty
@ijakparov
ijakparov / WP RESTAPI controller
Created August 31, 2019 05:16
WP RESTAPI controller
class My_REST_Posts_Controller {
// Here initialize our namespace and resource name.
public function __construct() {
$this->namespace = '/my-namespace/v1';
$this->resource_name = 'posts';
}
// Register our routes.
public function register_routes() {
@ijakparov
ijakparov / !Как установить сфинкс.md
Created August 28, 2019 16:48 — forked from codedokode/!Как установить сфинкс.md
Как установить и настроить сфинкс.

Как установить и настроить сфинкс.

Скачиваем сфинкс (берем версию с MySQL и со стеммингом на 15 языков Win32 binaries w/MySQL+PgSQL+libstemmer+id64 support соответствующую битности твоей ОС), распаковываем например в d:\temp\s\

На этом установка sphinx завершена. В дебиане просто делаем sudo apt-get install sphinxsearch.

Создаем таблицы:

CREATE TABLE news 

(id INT(10) AUTO_INCREMENT PRIMARY KEY, topic INT(10) NOT NULL, header VARCHAR(200) NOT NULL,

[
{
shouldDeps: []
},
]
"123".toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1 ")
_onButtonClick: function (e) {
if (e.bemTarget.params.action && e.bemTarget.params.args && this[e.bemTarget.params.action]) {
this[e.bemTarget.params.action].apply(this, e.bemTarget.params.args);
} else if (e.bemTarget.params.action && this[e.bemTarget.params.action]) {
this[e.bemTarget.params.action]();
}
},
block('demo')({
content: (node, ctx) => [
{
elem: 'inner',
content: ''
}
]
});