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:meta/meta.dart'; | |
@immutable | |
class $NAME$State { | |
const $NAME$State(); | |
const $NAME$State.initial() : this(); | |
$NAME$State copyWith() => $NAME$State(); | |
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'; | |
/// Thanks to https://www.reddit.com/r/ProgrammerHumor/comments/m9r3vz/efficiency/ for the inspiration | |
void main() { | |
final random = Random(); | |
final stopwatch = Stopwatch()..start(); | |
int x; | |
do { |
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:rxdart/streams.dart'; | |
import 'package:rxdart/subjects.dart'; | |
extension StreamUtils<T> on Stream<T> { | |
ReplayStream<T> replay() { | |
final subject = ReplaySubject<T>(); | |
pipe(subject); | |
return subject; | |
} | |
} |
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
const keywords = [ | |
'abstract', | |
'else', | |
'import', | |
'super', | |
'as', | |
'enum', | |
'in', | |
'switch', | |
'assert', |
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:typed_data'; | |
Uint8List padPKCS5(List<int> input) { | |
final inputLength = input.length; | |
final paddingValue = 8 - (inputLength % 8); | |
final outputLength = inputLength + paddingValue; | |
final output = Uint8List(outputLength); | |
for (var i = 0; i < inputLength; ++i) { | |
output[i] = input[i]; |
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
type: entities | |
title: Transmission | |
show_header_toggle: false | |
entities: | |
- entity: switch.transmission_switch | |
icon: 'hass:power' | |
name: Enabled | |
secondary_info: last-changed | |
- entity: switch.transmission_turtle_mode | |
icon: 'hass:turtle' |
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:flutter/gestures.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
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
test( | |
'should $TITLE$', | |
() async { | |
// Arrange | |
$ARRANGE$ | |
// Act | |
$ACT$ | |
// Assert |
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
[Service] | |
ExecStart= | |
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile.json | |
ExecReload= | |
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile.json |