This file contains hidden or 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
#!/bin/bash | |
# Exit immediately if a command exits with a non-zero status | |
set -e | |
# Function to display usage instructions | |
usage() { | |
echo "Usage: $0 <db_name> <db_user> <db_password>" | |
exit 1 | |
} |
This file contains hidden or 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
// vi /etc/systemd/system/foo.service | |
[Unit] | |
Description=Run a command at startup | |
[Service] | |
ExecStart=/path/to/your/command | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or 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
// select the main firebase project | |
firebase use <main-project-id> | |
// list projects | |
firebase projects:list | |
// firebase target:apply hosting <app-id> <site-url> | |
firebase target:apply hosting enjaz-web enjaz.bedayat.ly | |
// firebase deploy --only hosting:<app-id> |
This file contains hidden or 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
//json() is your backend response | |
pm.collectionVariables.set('token', pm.response.json().token) |
This file contains hidden or 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
import jsPdf from 'jspdf'; | |
domToPng(ticketElement).then(dataUrl => { | |
const pdf = new jsPdf(); | |
const imgProps = pdf.getImageProperties(dataUrl); | |
const pdfWidth = pdf.internal.pageSize.getWidth(); | |
// const pdfHeight = pdf.internal.pageSize.getHeight(); |
This file contains hidden or 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
const token = pm.environment.get("variable_key"); | |
pm.request.headers.add('Authorization', token) |
This file contains hidden or 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
const emit = defineEmits<{ | |
(event: "faqDeleted", data: Faq); | |
(event: "close", data: any); | |
}>(); |
This file contains hidden or 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
import moment from "moment"; | |
const formatDate = (date) => { | |
const momntDate = moment(date); | |
if (!momntDate.isValid()) ""; | |
return moment(date).format("D-MM-YYYY"); | |
}; |
This file contains hidden or 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
axios.get('/api/some-endpoint') | |
.then(response => { | |
// Handle successful response | |
console.log(response.data); | |
}) | |
.catch(error => { | |
// Handle error | |
if (error.response) { | |
// The request was made, and the server responded with a status code | |
// that falls out of the range of 2xx |
This file contains hidden or 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
const vuexLocalStorage = new VuexPersist({ | |
key: 'sano-vuex', | |
storage: window.localStorage, // or window.sessionStorage or localForage | |
// pass the state of the store to be persisted | |
reducer: state => ({ | |
auth: state.auth, | |
lang: state.lang, | |
}), | |
}); |
NewerOlder