This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hideText{ | |
text-indent:-999px; | |
} | |
.hideText{ | |
font: 0/0 a; | |
text-shadow: transparent; | |
color: transparent; | |
text-decoration: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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">. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//--CASE 1 | |
const person = { | |
name: 'Tom', | |
age: 30, | |
country: 'Chile', | |
}; | |
// 👇️ type Keys = "name" | "age" | "country" | |
type Keys = keyof typeof person; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//PWSH | |
$env:PATH | |
//Bash | |
echo $PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@supports selector(:has(*)) { | |
/* do something */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. Use a more-intuitive box-sizing model. | |
*/ | |
*, *::before, *::after { | |
box-sizing: border-box; | |
} | |
/* | |
2. Remove default margin | |
*/ | |
* { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p { | |
overflow-wrap: break-word; | |
hyphens: auto; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.scroll-x { | |
/* | |
[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] */ |
NewerOlder