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://ao.com/lg |
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
/* eslint-disable max-len, no-process-env */ | |
/* | |
Project setup... | |
*/ | |
const AO_FEA_GLOBALS_PATH = 'node_modules/ao-globals/'; // Change path to point at root globals | |
const PROJECT_NAME = 'pc-gaming-cat-pages'; // Change project name to your project name | |
const PROJECT_SERVER_PATH = '//media.ao.com/uk/qa/pc-gaming-cat-page/'; // Change project server path to your project 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
/** | |
* Create a DOM element from a string without | |
* having to append to a containing <div> | |
* | |
* @param {String} e.g. `<div><span>Hello World</span></div> Foo bar` | |
* @return {Element} | |
*/ | |
export function htmlToFragment(htmlString) { | |
const fragment = document.createDocumentFragment(); | |
const wrapper = document.createElement('div'); |
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
# top-most EditorConfig file | |
root = true | |
# Unix-style newlines with a newline ending every file | |
[*] | |
indent_style = tab | |
indent_size = tab | |
tab_width = 4 | |
end_of_line = lf | |
charset = utf-8 |
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
/** | |
* Create a DOM element from a string | |
* | |
* @param {String} e.g. `<div><span>Hello World</span></div>` | |
* @return {Element} | |
*/ | |
export function htmlToElement(htmlString) { | |
const wrapper = document.createElement('div'); | |
wrapper.innerHTML = htmlString; | |
document.body.appendChild(wrapper); |
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
const PRIVATE_PROPERTY_1 = new Symbol(); | |
class WithPrivates { | |
get prop1(){ | |
return this[PRIVATE_PROPERTY_1]; | |
} | |
set prop1(value){ | |
if(typeof value == 'number'){ |
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
var arr = [1,2,3,4,[5,5,[1,1,1],6,7],[1,2,[2,3,[100,[23,45,11,[600,599]],101,99],4],3]]; | |
function flattenArray(array) { | |
return array.reduce(function(accumulator, current) { | |
if (Array.isArray(current)) { | |
return accumulator.concat(flattenReduce(current)); | |
} else { | |
return accumulator.concat(current); | |
} | |
}, []); |
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
.ao-seo-tool { | |
position: absolute; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
min-height: 100%; | |
font-family: Arial, sans-serif; | |
} |
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
SELECT | |
p.product_id, | |
pd.name, | |
pd.description, | |
pd.title_tag AS meta_title, | |
pd.meta_keywords, | |
pd.meta_description, | |
CONCAT('http://www.domain.co.uk/', u.keyword) AS URL, | |
GROUP_CONCAT(pt.tag) AS tags, | |
p.status |
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
fsutil file createnew 1Mbfile.png 1000000 |