Moved to module: https://github.com/weprovide/magento2-module-dompdf
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 fetch from 'isomorphic-fetch' | |
import { saveAs } from 'file-saver' | |
fetch('/url/with/pdf', { | |
headers: { | |
'Content-Type': 'application/pdf' | |
}, | |
responseType: 'blob' | |
}).then(response => response.blob()) | |
.then(blob => saveAs(blob, 'test.pdf')) |
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
<referenceContainer name="content"> | |
<referenceBlock name="checkout.root"> | |
<arguments> | |
<argument name="jsLayout" xsi:type="array"> | |
<item name="components" xsi:type="array"> | |
<item name="checkout" xsi:type="array"> | |
<item name="children" xsi:type="array"> | |
<item name="authentication" xsi:type="array"> | |
<item name="componentDisabled" xsi:type="boolean">true</item> | |
</item> |
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
// Based on https://www.npmjs.com/package/morgan#vanilla-http-server | |
const { send } = require('micro') | |
const morgan = require('morgan') | |
const logger = morgan('combined') | |
module.exports = async function (req, res) { | |
logger(req, res, function (err) { | |
if (err) { | |
return send(res, 500, 'Error') | |
} |
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
alias get-headers='curl -X HEAD -i' |
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
SET FOREIGN_KEY_CHECKS = 0; | |
TRUNCATE catalog_product_entity_media_gallery; | |
SET FOREIGN_KEY_CHECKS = 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
const list = ` | |
item1 | |
item2 | |
`.trim() | |
const translate = list.split('\n').map(item => `"${item}",""`).join('\n').trim() | |
console.log(translate) |
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 | |
set -e | |
show_help() { | |
cat << EOF | |
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE] | |
${0##*/} -h | |
Open a standard connection in Sequel PRO. |
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 readline = require('readline') | |
const blank = '\n'.repeat(process.stdout.rows) | |
console.log(blank) | |
readline.cursorTo(process.stdout, 0, 0) | |
readline.clearScreenDown(process.stdout) |