A collapsible section containing markdown
Click to expand!
Heading
- A numbered
- list
- With some
- Sub bullets
#!/bin/sh | |
# | |
# Autoformat all modified files before commit | |
# | |
function format_if_required { | |
FILES=$1 | |
flutter format $FILES | grep -Ev '^(Unchanged)' |
#!/bin/sh | |
# | |
# Autoformat all modified files before commit | |
# | |
function format_if_required { | |
FILES=$1 | |
flutter format $FILES | grep -Ev '^(Unchanged)' |
// Use language features to build the url | |
String buildUrlWithQueryParams(String url, Map<String, dynamic> queryParams) { | |
final uri = Uri.parse(url); | |
final fullUri = uri.replace( | |
queryParameters: { | |
...uri.queryParameters, | |
...queryParams, | |
}, | |
); |
name: PR Commenter | |
on: | |
pull_request: | |
types: [opened, reopened] | |
jobs: | |
comment: | |
runs-on: ubuntu-latest | |
steps: |
import 'dart:async'; | |
Future main() async { | |
print('start'); | |
final li = await Future.wait([fetch(4), fetch(6)]); | |
print('results: ${li[0]} ${li[1]}'); // results: 4 2 | |
final li2 = await Future.wait([fetch(6), fetch(3)]); | |
print('results 2: ${li2[0]} ${li2[1]}'); // results: 6 3 |
class UpdateUserInteractor { | |
Future<void> call(String name) async { | |
print("done $name"); | |
return; | |
} | |
} | |
void main() async { | |
final updateUser = UpdateUserInteractor(); | |
await updateUser('Dan'); |
/// | |
/// The Result Monad | |
/// | |
abstract class Result<T> { | |
bool isSuccess() { | |
return this is Success; | |
} | |
Success<T> asSuccess() { | |
return this as Success<T>; |
/// | |
/// The Result Monad | |
/// | |
abstract class Result<T> { | |
bool isSuccess() { | |
return this is Success; | |
} | |
Success<T> asSuccess() { |
# https://www.regextester.com/109925 | |
CONVENTIONS_URL = "your link" | |
def validate_title_format | |
def valid_title_format?(title) | |
conventional_commit_regex = /^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?: .*$/ | |
result = title =~ conventional_commit_regex | |
result != nil | |
end |