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
function getStatusCode(url) { | |
var url_trimmed = url.trim(); | |
// Check if script cache has a cached status code for the given url | |
var cache = CacheService.getScriptCache(); | |
var result = cache.get(url_trimmed); | |
// If value is not in cache/or cache is expired fetch a new request to the url | |
if (!result) { | |
var options = { |
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
function getRemainingTime(endDate){ | |
// Time difference betwwen now and deadline in milliseconds | |
let timeDifference = Date.parse(endDate) - Date.parse(new Date()) | |
let seconds = Math.floor( (timeDifference/1000) % 60 ) | |
let minutes = Math.floor( (timeDifference/1000/60) % 60 ) | |
let hours = Math.floor( (timeDifference *60*60) % 24 ) | |
let days = Math.floor( timeDifference/ (1000*60*60*24) ) | |
return `Countdown ${days} Days, ${hours} Hours, ${minutes} minutes, ${seconds} seconds` | |
} |
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
@keyframes donut-spin { | |
0% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(360deg); | |
} | |
} | |
.donut { | |
display: inline-block; |
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
# Refrences: | |
# https://community.magento.com/t5/Magento-2-x-Technical-Issues/A-technical-problem-with-the-server-created-an-error-Try-again/td-p/114492/page/3 | |
# https://github.com/magento/magento2/issues/16531 | |
# Change "fileUploader" to "imageUploader" in the "formElement" attribute on lines 57, 154 in vendor/magento/module-theme/view/adminhtml/ui_component/design_config_form.xml | |
# line 57 | |
<field name="head_shortcut_icon" formElement="imageUploader"> | |
# line 154 |
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
cat path/tp/docroot/app/etc/env.php | grep "frontName" |
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
# https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/sign-up.html | |
aws cognito-idp sign-up \ | |
--region YOUR_COGNITO_REGION \ | |
--client-id YOUR_COGNITO_APP_CLIENT_ID \ | |
--username admin@example.com \ | |
--password Passw0rd! | |
--user-attribute Name=string,Value=string |
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
# Go to the s3 bucket's Permissions -> CORS configurations and add the following policy | |
<CORSConfiguration> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>PUT</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>HEAD</AllowedMethod> | |
<AllowedMethod>DELETE</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> |
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
# Reference: https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html | |
aws s3 sync SOURCE_DIR s3://DEST_BUCKET/ |
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
du -sh folder_name |
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
# Prints out a list of storage drives with their sizes, usage, and locations | |
df -ah |
NewerOlder