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
// 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
git reset HEAD --hard | |
git checkout my_correct_branch //or do whatelse you need | |
git stash pop |
NewerOlder