Skip to content

Instantly share code, notes, and snippets.

View zidenis's full-sized avatar

Denis Albuquerque zidenis

View GitHub Profile
@zidenis
zidenis / simple_echo_server.dart
Created November 13, 2016 19:49
Simple http server using Dart Shelf package
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}');
}
@zidenis
zidenis / null.dart
Created April 30, 2017 14:00
Null - Dart implementation
// 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.
*
@zidenis
zidenis / var_initialization.dart
Last active April 30, 2017 17:48
Dart inicializa toda nova variável alocada para null
int variavelA = null;
String variavelB;
if (variavelA == variavelB)
print("Dart inicializa toda nova variável alocada para null");
@zidenis
zidenis / if-null_operator.dart
Last active April 30, 2017 19:00
if-null operator
// 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;
}
@zidenis
zidenis / null-aware_assignment.dart
Created April 30, 2017 19:31
null aware assignment
var languageA = "Dart";
var languageB = null;
languageA ??= "not Dart";
languageB ??= "not Dart";
print(languageA); // "Dart"
print(languageB); // "not Dart"
@zidenis
zidenis / conditional_access.dart
Created April 30, 2017 19:47
Conditional Member Access
List<String> lst;
lst?.add("Java");
lst = [];
lst?.add("Dart");
lst?.add("C");
print(lst); // [Dart, C]
@zidenis
zidenis / runtimeType.dart
Last active May 9, 2017 21:02
runtimeType behaviour
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
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);
}
@zidenis
zidenis / OCI_Architect_Associate-Reading_List.md
Created February 8, 2022 11:15
Reading list to prepare for OCI Architect Associate Certificate Exam
@zidenis
zidenis / proxmox_web_gui_api_lets_encrypts_acme_alias_mode_duck_dns-english.md
Last active June 5, 2025 10:55
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.

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.


Objective

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].