Skip to content

Instantly share code, notes, and snippets.

View danielhenrymantilla's full-sized avatar
🦀

Daniel Henry-Mantilla danielhenrymantilla

🦀
View GitHub Profile
@danielhenrymantilla
danielhenrymantilla / resize-image-in-github-issue-github-flavored-markdown.md
Created February 21, 2022 14:14 — forked from stevecondylios/resize-image-in-github-issue-github-flavored-markdown.md
How to Resize an Image in a Github Issue (e.g. Github flavored Markdown)

How to Resize an Image in Github README.md (i.e. Github Flavored Markdown)

Percentage:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width=50% height=50%>

Pixels:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width="150" height="280">

Summary

Panics which happen inside a Drop impl currently unwind as long as the drop was not itself called during unwinding (which would otherwise abort immediated due to a double-panic). This design meeting proposes to change this behavior to always abort if a panic attempts to escape a drop, even if this drop was invoked as part of normal function execution (as opposed to unwinding).

The dicussion on this issue dates back to 2014 (rust-lang/rust#14875) where the decision was made to support unwinding in drops but leave the door open to potentially reversing this decision.

Background reading

rust-lang/rust#86027

@danielhenrymantilla
danielhenrymantilla / parse_quote_dbg.rs
Created September 17, 2021 15:14 — forked from jmg-duarte/parse_quote_dbg.rs
Yandros parse_quote! debug
// Credits: Yandros#4299
macro_rules! parse_quote {(
$($code:tt)*
) => ({
eprintln!("[{}:{}:{}] parse_quote! {{ {} }}", file!(), line!(), column!(), quote!( $($code)* ));
::syn::parse_quote!( $($code)* )
})}
macro_rules! parse_quote {(
@danielhenrymantilla
danielhenrymantilla / SimpleHTTPServerWithUpload.py
Created July 15, 2021 18:07 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@danielhenrymantilla
danielhenrymantilla / latest-stable-rustc.md
Created October 5, 2020 19:37 — forked from alexheretic/latest-stable-rustc.md
Latest stable rust as a MSRV policy

Latest stable rust as a minimum

Minimum supported rust version (MSRV) policy that indicates the most recent stable rust release is the minimum whenever a new crate version is published. It is not required to bump a crate's major version after a new stable compiler is released.

For example crate_foo version 0.1.2 published on 2018-12-28 has MSRV 1.31.1 as this compiler was published on 2018-12-20.

The advantages of this approach is simplicity in maintaining a crate's code.

Workarounds for older compiler versions

If you are unable to update your compiler, you may be unable to update crate dependencies following this policy.

@danielhenrymantilla
danielhenrymantilla / death_letter.tex
Created October 12, 2018 14:27 — forked from aeris/death_letter.tex
Lettre de la mort GDPR
\documentclass[10pt]{lettre}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{eurosym}
\usepackage{enumitem}
\usepackage[frenchb]{babel}
\begin{document}
\begin{letter}{