Skip to content

Instantly share code, notes, and snippets.

View EricMiranda's full-sized avatar

Cheto EricMiranda

  • Argentina - Cordoba
View GitHub Profile
@EricMiranda
EricMiranda / tex-colors.md
Created May 28, 2024 18:17 — forked from luigiMinardi/tex-colors.md
Github markdown colors (Using Tex and the github MathJax support)

Small warning for everyone that are thinking if using Tex colors is a good idea or not

  • 2023-05-02 - Since a few days ago \colorbox and \fcolorbox are broken and Github did't talk about if it's a temporary thing or if it will not be added back.
    • 2024-01-04 - Since it has not being added back I deduce that it will never be so I removed all mentions to it on the rest of the gist.
  • 2023-09-29 - Tex seems to not work on h1 to h6 anymore (markdown #'s)
    • 2024-01-04 - Now it works again, I'll keep the message for a while to remember that it may change again in the future

As you can se with the above message(s) Tex may not be very stable and may not be an option to you as of the dates expressed above. You can also check other tex problems here.

Github released Tex support and colors* to the markdown and you din't realized

@EricMiranda
EricMiranda / EnumWithDescription.cs
Last active October 20, 2021 13:35
Set a description to ENUM and get it
public enum ErrorCode
{
[Description("404 Not Found")]
NOT_FOUND = 404,
}
public static class Enums
{
public static string GetDescription<T>(this T e) where T : IConvertible
{
if (e is Enum)
@EricMiranda
EricMiranda / YearsOld.cs
Last active December 10, 2025 12:04
Calculate yearsOld
private int GetEdad(DateTime fechaNacimiento)
{
DateTime fechaActual = DateTime.Now;
if (fechaNacimiento > fechaActual)
return -1;//Todavia no nacio
int edad = fechaActual.Year - fechaNacimiento.Year;
if (fechaNacimiento.Month > fechaActual.Month)
edad--;