Skip to content

Instantly share code, notes, and snippets.

View manzhikov's full-sized avatar
🏠
Working from home

Ildar Manzhikov manzhikov

🏠
Working from home
View GitHub Profile
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@summerwind
summerwind / build-a-os-image-with-packer-and-qemu.md
Last active April 10, 2024 19:32
Build a OS image with Packer and QEMU

Build a OS image with QEMU and Ubuntu Cloud Image

Prerequirements

  • Packer
  • QEMU
  • Docker

Build an image of cloud-init settings

@rendro
rendro / parsecookie.js
Last active May 4, 2024 15:38
Parse document.cookie into object
document.cookie.split(';').map(function(c) {
return c.trim().split('=').map(decodeURIComponent);
}).reduce(function(a, b) {
try {
a[b[0]] = JSON.parse(b[1]);
} catch (e) {
a[b[0]] = b[1];
}
return a;
}, {});