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
import 'package:shelf/shelf.dart'; | |
import 'package:shelf/shelf_io.dart' as io; | |
void main() { | |
serverWithLogging(); | |
} | |
Response echoHandler(Request request) { | |
return new Response.ok('echo: ${request.requestedUri}'); | |
} |
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
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
part of dart.core; | |
/** | |
* The reserved word [:null:] denotes an object that is the sole instance of | |
* this class. | |
* |
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
int variavelA = null; | |
String variavelB; | |
if (variavelA == variavelB) | |
print("Dart inicializa toda nova variável alocada para null"); |
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
// As funções whatLangA, whatLangB e whatLangC implementam a mesma funcionalidade. | |
var language = "Dart"; | |
whatLangA() => language ?? "not Dart"; | |
whatLangB() => language == null ? "not Dart" : language; | |
whatLangC() { | |
if (language==null) return "not Dart"; | |
else return language; | |
} |
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 languageA = "Dart"; | |
var languageB = null; | |
languageA ??= "not Dart"; | |
languageB ??= "not Dart"; | |
print(languageA); // "Dart" | |
print(languageB); // "not Dart" |
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
List<String> lst; | |
lst?.add("Java"); | |
lst = []; | |
lst?.add("Dart"); | |
lst?.add("C"); | |
print(lst); // [Dart, C] |
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
void main() { | |
String s = "Dart"; | |
print(s is String); // true | |
print(s.runtimeType); // String | |
Dart d = new Dart(); | |
NotDart nd = new NotDart(); | |
print(d is Dart); // true | |
print(nd is Dart); // false | |
print(nd is NotDart); // true |
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
void main() { | |
var prettyFunc = new PrettyPrint(); | |
print(prettyFunc is Function); // true | |
prettyFunc.call("A", "Dart is cool", "B"); // A Dart is cool B | |
prettyFunc("C", "Dart is cool", "D"); // C Dart is cool D | |
var args = ["E", "Dart is cool", "F"]; // E Dart is cool F | |
Function.apply(prettyFunc, args); | |
} |
Step-by-step guide to configure Proxmox Web GUI/API with Let’s Encrypt certificate and automatic validation using the ACME protocol in DNS alias mode with DNS TXT validation redirection to Duck DNS.
We want to use a certificate in Proxmox GUI/API issued for free by a Certificate Authority trusted by default in browsers and operating systems. The chosen Certificate Authority will be Let's Encrypt [1]. Since the issued certificates are valid for only 90 days, automating the certificate renewal process is crucial. For this purpose, the Automatic Certificate Management Environment (ACME, RFC8555) protocol will be used [2].
OlderNewer