Skip to content

Instantly share code, notes, and snippets.

View susanahernandezd's full-sized avatar
🤍

Susana Hernandez susanahernandezd

🤍
View GitHub Profile
try {
return await this.http.get(`/whatever`, {
validateStatus: status => status === 301 //this throws an error if status code is not = 301
});
} catch (e) {
const error = {
isAxiosError: true,
response: {
status: HttpStatusCode.INTERNAL_SERVER_ERROR,
data: [
// ASPECT RATIO
// compatible Safary 15
img {
aspect-ratio: 16 / 9;
width: 100%;
}
// WIDTH/HEIGHT
// compatible Safary 14
// In addition to <img>, this feature also works on <video> and <input type="image">.
//--CASE 1
const person = {
name: 'Tom',
age: 30,
country: 'Chile',
};
// 👇️ type Keys = "name" | "age" | "country"
type Keys = keyof typeof person;
//PWSH
$env:PATH
//Bash
echo $PATH
// Destructive Array methods:
//.reverse()
//.sort()
//.splice()
// If we want to apply one of these methods to an Array without changing it, we can use one of the following patterns:
// OPTION 1:
// That is, we first make a copy of arr and then change that copy.
@supports selector(:has(*)) {
/* do something */
}
/*
1. Use a more-intuitive box-sizing model.
*/
*, *::before, *::after {
box-sizing: border-box;
}
/*
2. Remove default margin
*/
* {
p {
overflow-wrap: break-word;
hyphens: auto;
}
.nav-mobile-scroll {
/*
[1]: All items a forced onto a single line, causing the overflow when necessary.
[2]: Automatic overflow means a scroll bar won’t be present if it isn’t needed
[3]: Make it smooth scrolling on iOS devices before
[4]: Hide the ugly scrollbars in Edge until the scrollable area is hovered
[5]: Hide the scroll bar in WebKit browsers
*/
white-space: nowrap; /* [1] */
overflow-x: auto; /* [2] */
git reset HEAD --hard
git checkout my_correct_branch //or do whatelse you need
git stash pop