Skip to content

Instantly share code, notes, and snippets.

View manthri-mohan-sai's full-sized avatar
👨‍💻
Coding

Mohan Sai Manthri manthri-mohan-sai

👨‍💻
Coding
  • 09:53 (UTC +05:30)
View GitHub Profile
@manthri-mohan-sai
manthri-mohan-sai / datetime_description_extension.dart
Created June 1, 2023 02:23
A descriptive datetime extension
extension DescribeDateTime on DateTime {
void describe() {
final now = DateTime.now();
final difference = this.difference(DateTime(now.year, now.month, now.day));
String description = switch (difference) {
Duration(inDays: 0) => 'today',
Duration(inDays: -1) => 'yesterday',
Duration(inDays: 1) => 'tomorrow',
Duration(inDays: int d, isNegative: false) => "$d days from now",

Import GPG keys

gpg --import <path to your private gpg.key>

Generate GPG keys

gpg --full-generate-key 

The recommended choices are: