Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Om! 🕉️

Maxim Uvarov maxim-uvarov

💭
Om! 🕉️
View GitHub Profile
@maxim-uvarov
maxim-uvarov / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View YandexMetrikaDimensionsAndMetricsList - for power query .txt
// Здесь на скорую руку получаем список метрик и измерений в Яндекс.Метрике
let
getMetaData = (url as text, TypeOfField as text, ScopeOfField as text) =>
let
Source = Json.Document(Web.Contents( url )),
attributes = Source[attributes],
#"Table from List" = Table.FromList(attributes, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(#"Table from List",{{"Column1", "dimension"}}),
#"Expand dimension" = Table.ExpandRecordColumn(#"Renamed Columns", "dimension", {"dim", "name", "allow_filters"}, {"dim", "name", "allow_filters"}),
@maxim-uvarov
maxim-uvarov / gist:9b5e8f3283c782f4601860f3ed0d96d3
Created Dec 14, 2016
Новая версия функцию PQYandexMetrika с поддержкой обновления из веба
View gist:9b5e8f3283c782f4601860f3ed0d96d3
/*
Функция, при помощи которой мы забираем из API данные из Яндекс.Метрики
Версия 1.12
PQYM = (ids, dimensions, metrics, date1, date2, token, filters, direct_ids)
Все значения передаются как text.
На выходе получается таблица с запрошенными полями.
Домашняя страница:
https://github.com/40-02/PQYandexMetrika/
@maxim-uvarov
maxim-uvarov / проблем с буффером.md
Created Oct 9, 2017
Скрипт на котором падает power bi. Парсинг CSV. Есть подозрение на ошибки в данных, но пока понять не могу как локализовать.
View проблем с буффером.md

// tags let Source = Csv.Document(File.Contents("\Mac\Home\Documents\Google drive insync\Google Drive\Мои Исследования\Golos power bi\all comments golos2.txt"),[Delimiter="#(tab)", Columns=45, Encoding=65001, QuoteStyle=QuoteStyle.Csv]), #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]), #"Removed Other Columns" = Table.SelectColumns(#"Promoted Headers",{"ID", "json_metadata"}), #"Removed Errors" = Table.RemoveRowsWithErrors(#"Removed Other Columns"), #"Parsed JSON" = Table.TransformColumns(#"Removed Errors",{{"json_metadata", Json.Document}}), #"Expanded json_metadata" = Table.ExpandRecordColumn(#"Parsed JSON", "json_metadata", {"tags"}, {"tags"}), #"Expanded tags1" = Table.ExpandListColumn(#"Expanded json_metadata", "tags"), #"Changed Type" = Table.TransformColumnTypes(#"Expanded tags1",{{"ID", Int64.Type}}),

@maxim-uvarov
maxim-uvarov / list.Obfuscation.pq
Created Oct 25, 2017
simple obfuscation function
View list.Obfuscation.pq
// obfuscastionFun
// simple obfuscation function
(listToTransform as list)=>
let
listBufferMain = List.Buffer(listToTransform),
removeDuplicates = List.Distinct(listBufferMain),
listBuffer = List.Buffer(removeDuplicates),
result = List.Transform(listBufferMain, each List.PositionOf(listBuffer, _))
in
View uri.parts.safe.pq
each try Uri.Parts(_) otherwise [Host=_]
View layout.json
{
"title": "select_input_source example (available since Karabiner-Elements 11.1.9)",
"rules": [
{
"description": "Change input source to U.S. by left_command, RussianWin by right_command. (available since Karabiner-Elements 11.1.9)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command",
View layout3.json
{
"title": "select_input_source example (available since Karabiner-Elements 11.1.9)",
"rules": [
{
"description": "Change input source to U.S. by left_command, RussianWin by right_command. (available since Karabiner-Elements 11.1.9)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command",
View gist:a1fe19115e5dc8974b6cbd883d6d1b50
### Keybase proof
I hereby claim:
* I am maxim-uvarov on github.
* I am maxim_uvarov (https://keybase.io/maxim_uvarov) on keybase.
* I have a public key ASDa1AAiTST5fj8TXGkHvzgV9BKGi_iSgEJRip8qxpN0rgo
To claim this, I am signing this object:
@maxim-uvarov
maxim-uvarov / gist:7092a96912b97cd4366f68e390c363e8
Created Aug 24, 2018
mera описания студентов
View gist:7092a96912b97cd4366f68e390c363e8
p1 =
var FlagOneSelected = HASONEVALUE ( membersTable[Имя] )
var flagEndOfCourse = [_Урок Последний Выполненный Студентом] = [_уроков в курсе количество]
var name1 = membersTable[Имя чистое]
var sbj = membersTable[Subject]
var Beggining = name1 & " - cтудент курса " & sbj & " в NeedForData.ru."