Skip to content

Instantly share code, notes, and snippets.

View germanfrelo's full-sized avatar
Looking for a job • Improving my React.js skills with joyofreact.com

Germán Freixinós germanfrelo

Looking for a job • Improving my React.js skills with joyofreact.com
View GitHub Profile
@germanfrelo
germanfrelo / extensions.txt
Last active April 11, 2024 15:19
My Visual Studio Code extensions
alefragnani.bookmarks
antfu.file-nesting
antfu.iconify
antfu.retypewriter
antfu.smart-clicks
bierner.color-info
bierner.github-markdown-preview
bierner.lit-html
bierner.markdown-checkbox
bierner.markdown-footnotes
@germanfrelo
germanfrelo / settings.jsonc
Last active April 21, 2024 09:07
My Visual Studio Code settings
{
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint",
/*
1. Indentation of 4 spaces. See:
- https://github.com/DavidAnson/vscode-markdownlint/issues/86#issuecomment-579860824
- https://github.com/search?q=org%3Amarkdown-it+path%3Aeditorconfig+md&type=code
2. Keep trailing whitespace in order to create hard line breaks. See:
- https://code.visualstudio.com/docs/languages/markdown#_keep-trailing-whitespace-in-order-to-create-line-breaks
*/
@germanfrelo
germanfrelo / email-validation-regular-expression.md
Last active April 10, 2022 11:52
Best regular expression to validate email addresses

The best regular expression to validate email addresses

Reference: https://www.regular-expressions.info/email.html

I took the last regular expression example that appears at the end of the above web page and made some improvements:

  • I replaced every character (left single quotation mark, code U+2018) with the correct ` character (grave accent/backquote/backtick, code U+0060).

  • I replaced the last {1,63} with {2,63} so that the top-level domain must be at least 2 characters long instead of 1.

@germanfrelo
germanfrelo / .gitattributes
Last active January 7, 2023 17:33
Normalize line endings in Git (.gitattributes)
# Ensure that text files introduced to the repository have their line endings normalized to LF. More info:
# - https://git-scm.com/docs/gitattributes#_end_of_line_conversion
# - https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
# - https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/
* text=auto
@germanfrelo
germanfrelo / .editorconfig
Last active October 7, 2023 07:38
My local .editorconfig file
# Local .editorconfig file.
# This file should only include settings that affect the physical contents of the file, and that you want enforced in the repository, not just how it appears in an editor.
# Do not include personal preference presentation-only settings (such as `indent_size` or `tab_width`) in this file; those should be specified in a (personal) parent .editorconfig file outside of the repository.
# From editorconfig.org: "when `indent_style` is set to `tab`, it may be desirable to leave `indent_size` unspecified so readers may view the file using their preferred indentation width".
# For more information, see https://blog.danskingdom.com/Reasons-to-use-both-a-local-and-global-editorconfig-file/.
# Top-most EditorConfig file
root = true
@germanfrelo
germanfrelo / getRandomIntInclusive.js
Last active March 3, 2022 16:51
Get a random integer between two values, inclusive
// Getting a random integer between two values, inclusive
// Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#getting_a_random_integer_between_two_values_inclusive
function getRandomIntInclusive(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1) + min);
}