Skip to content

Instantly share code, notes, and snippets.

View dan-dm's full-sized avatar
📚
Learning

Dan Dumitrescu dan-dm

📚
Learning
View GitHub Profile
@dan-dm
dan-dm / mkcert.sh
Created April 3, 2023 22:39
dovecot SSL configuration script
#!/bin/sh
# Generates a self-signed certificate.
# Edit dovecot-openssl.cnf before running this.
umask 077
OPENSSL=${OPENSSL-openssl}
SSLDIR=${SSLDIR-/etc/ssl}
OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf}
@dan-dm
dan-dm / markdown-details-collapsible.md
Created December 3, 2021 20:29 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@dan-dm
dan-dm / memoized-fibonacci-JSbench.md
Last active November 23, 2021 23:15
Memoization is an optimization technique that speeds up applications by storing the results of expensive function calls and returning the cached result when the same inputs occur again. Check it out -> https://jsbench.me/foktstl85t/1
function fibonacci(n) {
  if (n <= 1) {
    return 1
  }

  return fibonacci(n - 1) + fibonacci(n - 2);
}

function memoizedFibonacci(n, memo) {

Commit Message Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the Angular change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

@dan-dm
dan-dm / parse-int-query.ts
Created November 16, 2021 12:00 — forked from ezirmusitua/parse-int-query.ts
[Parse integer query params] parse integer query parameters in nestjs #node #nestjs
import {
Controller,
Get,
ParseIntPipe,
Query,
} from '@nestjs/common';
export class GalleryController {
constructor() {
}
@dan-dm
dan-dm / clean_code.md
Created November 12, 2021 19:19 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@dan-dm
dan-dm / terminal-cheat-sheet.txt
Created October 14, 2021 11:20 — forked from cferdinandi/terminal-cheat-sheet.txt
Terminal Cheat Sheet
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
1. El autocompletado de un IDE realiza las siguientes funciones:
Seleccione una:

a. Visualiza un listado de los comentarios en el código.
b. Ninguna respuesta es correcta.
c. Justifica (tabula) el código seleccionado.
d. ✅Visualiza un listado de sugerencias al empezar a escribir un nombre de una variable, clase u objeto entre otros. 

---

Keybase proof

I hereby claim:

  • I am dan-dm on github.
  • I am danmarius (https://keybase.io/danmarius) on keybase.
  • I have a public key whose fingerprint is ACC2 2FC9 16B2 C732 5247 075F 69A3 CF12 5FBE 00C7

To claim this, I am signing this object:

@dan-dm
dan-dm / gist:463aae699ae367b2feb0030482561fff
Created May 10, 2021 13:57 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: