This file contains 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
import 'dart:async'; | |
import 'dart:io'; | |
import 'package:mime/mime.dart'; | |
import 'package:shelf/shelf.dart' as shelf; | |
import 'package:shelf_rest/shelf_rest.dart'; | |
class Api { | |
@Post('upload') | |
Future upload(shelf.Request request) async { |
This file contains 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
import 'dart:math'; | |
/// Преобразует число в строку прописью | |
class NumericToWords { | |
// TODO: когда исправят баг в дарте, использовать данное регулярное выражение | |
//final _triadesRegExp = RegExp(r'(?<=\d)(?=(\d{3})+(?!\d))'); | |
final _digitWords = { | |
0: {'male': 'ноль'}, | |
1: {'male': 'один', 'female': 'одна'}, | |
2: {'male': 'два', 'female': 'две'}, |
This file contains 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
{config, pkgs, ...}: | |
{ | |
imports = [ | |
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-graphical-plasma5.nix> | |
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix> | |
]; | |
# configure proprietary drivers | |
nixpkgs.config.allowUnfree = true; | |
boot.initrd.kernelModules = [ "wl" ]; |
This file contains 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
import 'dart:convert'; | |
void main() { | |
var org = <String, dynamic>{ | |
'id': '12345678990', | |
'name': 'Roga & Kopyta', | |
'facebook': null | |
}; | |
print(toCypherObject(org)); | |
} |
This file contains 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
import 'package:dartz/dartz.dart' show Tuple3; | |
/// Грамматический род | |
enum Gender { male, female, neuter } | |
/// Называет одну цифру (числа перого десятка) | |
/// | |
/// [digit] - число первого десятка: 1 - 9. | |
/// [gender] - род числительного | |
String sayDigits(int digit, {Gender gender = Gender.male}) { |
This file contains 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
-- Грамматический род числительных | |
data Gender = Male | Female | Neuter deriving (Eq, Show) | |
-- Называет одну цифру (числа перого десятка) | |
sayDigits :: Gender -> Int -> String | |
sayDigits g x | |
| x == 1 && g == Male = "один" | |
| x == 1 && g == Female = "одна" | |
| x == 1 && g == Neuter = "одно" | |
| x == 2 && g == Female = "две" |
This file contains 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
/// Выполняет сравнение нарядов по критерию связанности | |
int compareDetachments (Detachment a, Detachment b) { | |
final finishAtComparison = a.finishAt.compareTo(b.finishAt); | |
if(finishAtComparison != 0) return finishAtComparison; | |
return a.order.id.compareTo(b.order.id); | |
} | |
typedef bool TestRelated(Detachment detachment); | |
/// Возвращает функцию типа [TestRelated], которая проверяет, |
This file contains 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
import 'package:angular/angular.dart'; | |
import 'package:component_testing/src/components/my_component.dart'; | |
@Component( | |
selector: 'app', | |
template: ''' | |
<h1>Component Testing</h1> | |
<my-component></my-component> | |
''', | |
directives: const [MyComponent], |
This file contains 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
import 'package:angular/angular.dart'; | |
import 'package:component_testing/src/components/my_component.dart'; | |
import 'package:component_testing/src/services/my_component_service.dart'; | |
@Component( | |
selector: 'app', | |
template: ''' | |
<h1>Component Testing</h1> | |
<test></test> | |
''', |
This file contains 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
import 'package:angular/angular.dart'; | |
import 'package:angular_components/utils/browser/window/module.dart'; | |
import 'package:angular_components/material_datepicker/module.dart'; | |
import 'package:angular_components/material_datepicker/material_date_time_picker.dart'; | |
@Component( | |
selector: 'my-app', | |
styleUrls: ['app_component.css'], | |
templateUrl: 'app_component.html', |
NewerOlder