Skip to content

Instantly share code, notes, and snippets.

View MaksimAbramchuk's full-sized avatar

Maksim Abramchuk MaksimAbramchuk

View GitHub Profile
<bill_data>
<id>3</id>
<canceled>true</canceled>
</bill_data>
<client_data>
<phone>+375291111111</phone>
<emaia>example@co.rus</emaia>
<first_name>Валерий</first_name>
<last_name>Володин</last_name>
<patronymic>Васильевич</patronymic>
<is_jurist>False</is_jurist>
<uniq_id>112233445566</uniq_id>
<birth_date>2018-11-06</birth_date>
<city>Минск</city>
import React, { Component } from 'react';
import {
Route,
Switch,
} from 'react-router-dom';
import { YMInitializer } from 'react-yandex-metrika';
import NoMatch from '../../components/NoMatch';
import UsersEdit from '../Users/edit';
import React from 'react';
import GoogleAnalytics from 'react-ga';
const { NODE_ENV } = process.env;
GoogleAnalytics.initialize('UA-47365686-9');
const withTracker = (WrappedComponent) => {
const trackPage = (page) => {
GoogleAnalytics.set({ page });
GoogleAnalytics.pageview(page);
renderAllStoryBlocks() {
const blocksTree = arrayToTree(this.state.stories, {parentProperty: 'parentId'});
blocksTree.forEach((story, index) => {
this.renderStoryBlock(story, index, 0, window.innerHeight);
});
}
renderStoryBlock(story, index, left, right) {
const ua = require('universal-analytics');
const bluebird = require('bluebird');
const GOOGLE_ANALYTICS_ID = require('../../config').googleAnalytics.uid;
class GoogleAnalytics {
constructor(uid) {
this._uid = uid;
this._visitor = ua(GOOGLE_ANALYTICS_ID, this._uid, { strictCidFormat: false, });
sendEvent(category, action, label) {
if (!this._visitor) return;
this._visitor.eventAsync(category, action, label)
.catch(error => console.error(error));
}
const ua = require('universal-analytics');
const bluebird = require('bluebird');
const GOOGLE_ANALYTICS_ID = require('../../config').googleAnalytics.uid;
class GoogleAnalytics {
constructor(uid) {
this._uid = uid;
this._visitor = ua(GOOGLE_ANALYTICS_ID, this._uid, { strictCidFormat: false, });
require 'rails_helper'
describe OrdersController do
describe 'GET #index' do
it_requires_authentication do
get :index
end
for_users :admin, :analyst do
it 'loads all the orders in distinct order' do
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :telegram_id
t.string :first_name
t.string :last_name
t.jsonb :bot_command_data, default: {}
t.timestamps null: false
end