-
Use Onion architecture
- Dependencies go inwards. That is, the Core domain doesn't know about outside layers
-
Use pipeline model to implement workflows/use-cases/stories
- Business logic makes decisions
- IO does storage with minimal logic
- Keep Business logic and IO separate
-
Keep IO at edges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [master] | |
GO | |
IF OBJECT_ID('dbo.calendar') IS NOT NULL | |
DROP TABLE [dbo].[calendar]; | |
IF OBJECT_ID('dbo.fn_generate_calendar') IS NOT NULL | |
DROP FUNCTION [dbo].[fn_generate_calendar]; | |
GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file contains your Data Connector logic | |
section MangoOfficeVpbx; | |
[DataSource.Kind="MangoOfficeVpbx", Publish="MangoOfficeVpbx.UI"] | |
shared MangoOfficeVpbx.Contents = (optional dateTimeFrom as datetime, optional dateTimeTo as datetime, optional fields_list as list) => | |
get_full_data( dateTimeFrom, dateTimeTo, fields_list ); | |
// | |
// Mango Office Vpbx Configuration settings | |
// |
Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// На большом объеме данных так работает плохо!!! | |
var date_time_text = format( 'fact_data'[moment]; "dd.MM.yyyy hh:00:00" ) | |
var current_date = DATEVALUE( date_time_text ) | |
var current_time = timeVALUE( date_time_text ) | |
var curent_datetime = current_date + current_time | |
return curent_datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
Source = | |
Table.FromRecords( | |
{ | |
[ moment = DateTime.LocalNow() ] | |
} | |
), | |
AddYearColumn = Table.AddColumn( Source, "year", each Date.Year( [moment] ), Int32.Type ), | |
AddMontholumn = Table.AddColumn( AddYearColumn, "month", each Date.Month( [moment] ), Int32.Type ), | |
AddDayColumn = Table.AddColumn( AddMontholumn, "day", each Date.Day( [moment] ), Int32.Type ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, | |
body { | |
font-size: 16px; | |
} | |
.main-container { | |
display: flex; | |
width: 100%; | |
height: 100%; | |
justify-content: center; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Пример использования функции получения Производственного календаря: | |
// | |
// источник взят отсюда: http://data.gov.ru/opendata/7708660670-proizvcalendar | |
// На момент 24.05.2018 в календаре содержатся описание праздников с 1999 года по 2025 год. | |
// | |
// let | |
// PROD_СALENDAR_URL = | |
// "https://data.gov.ru/opendata/7708660670-proizvcalendar/data-20181017T0930-structure-20181017T0930.csv?encoding=UTF-8", | |
// ProductionCalendar = getProductionCalendar( PROD_СALENDAR_URL ) | |
// in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sparkline Line = | |
// Static line color - use %23 instead of # for Firefox compatibility | |
VAR LineColor = "%2301B8AA" | |
// "Date" field used in this example along the X axis | |
VAR XMinDate = MIN('Table'[Date]) | |
VAR XMaxDate = MAX('Table'[Date]) | |
// Obtain overall min and overall max measure values when evaluated for each date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sparkline Line = | |
// Sample get from: https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-august-2018-feature-summary/ | |
// Formared width: http://www.daxformatter.com/ | |
// Issue: SparlineMeasure var won't work when referenced (all bars end up 100%) | |
// Issue: Refactor to avoid nested SUMMARIZEs | |
// Issue: Negative values currently will not appear | |
VAR SparklineMeasure = | |
SUM ( Sales[SalesAmount] ) // don't use this below per issue above | |
VAR SparklineMeasureTarget = |
NewerOlder