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
/** | |
* Function bind polyfill | |
* https://github.com/ariya/phantomjs/issues/10522 | |
*/ | |
if (!Function.prototype.bind) { | |
Function.prototype.bind = function (context /* ...args */) { | |
var fn = this; | |
var args = Array.prototype.slice.call(arguments, 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
(function() { | |
const mediaQueries = [ | |
{ | |
minWidth: 0, | |
maxWidth: 500, | |
minHeight: 0, | |
maxHeight: 9999, | |
posterUrl: '/storage/thaSxSUsLJxaESsgJiQQ4x98hwyWaI79VUSh0PiE.jpeg?v=1', | |
src: '/assets/video/home.mp4?v=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
version: '3.3' | |
services: | |
frontend: | |
image: wordpress | |
networks: | |
- frontend | |
ports: | |
- 8080:80 |
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
// 1. Put this file in root directory of your App | |
// 2. Run `npm install --save-dev express puppeteer http-proxy isbot` | |
// 3. Change const `renderedAppPort` to port of your app (example: 4200 for Angular by default) | |
// 4. Start serve your app (example: > `ng serve --prod --port=4200`) | |
// 5. Run `node render.server.js` (It will be launched on port 80) | |
// If a crawler bot is detected, the page will be rendered. If not, the application will work as usual. | |
const express = require('express'); // Node Server | |
const httpProxy = require('http-proxy'); // Proxy Server |
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
(function() { | |
function adaptDataTables() { | |
const tableElements = document.querySelectorAll('table'); | |
tableElements.forEach(tableElement => { | |
const headerElements = tableElement.querySelectorAll('thead > tr > *'); | |
const rowElements = tableElement.querySelectorAll('tbody > tr'); | |
rowElements.forEach(rowElement => { | |
const cellElements = rowElement.querySelectorAll('td'); | |
cellElements.forEach((cellElement, index) => { | |
cellElement.setAttribute('data-title', headerElements[index].textContent) |
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
console.clear(); | |
var groupMemberElement = document.querySelector('#groupsMemberBrowserContent'), | |
groupMembers = []; | |
var backDropContainer = document.createElement('div'); | |
var downloadButton = document.createElement('button'); | |
var countParsedMembersElement = document.createElement('span'); | |
function getGroupMembers(searchableElement) { |
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
/* Jquery function to create guids. | |
* Guid code from | |
* http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
*/ | |
(function ( $ ) { | |
$.fn.newguid = function () { | |
this.val('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8; return v.toString(16); })); | |
return this; | |
}; |
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
// Appended className for elements in container | |
// containerSelector — Container with any elements | |
// elementsSelector — Elements to which the class will be added | |
// classNameToAdd — The class to be added to the elements | |
function addClassToContainerElements(containerSelector, elementsSelector, classNameToAdd) { | |
document | |
.querySelectorAll(containerSelector) | |
.forEach(function(containerElement, index) { | |
containerElement | |
.querySelectorAll(elementsSelector) |
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
// Apply function on load and resize | |
(function() { | |
function onResize() { | |
var breakPointsUrls = { | |
3840: 'https://staging.kpwlaw.com/video/home-1080p.mp4', | |
2560: 'https://staging.kpwlaw.com/video/home-1080p.mp4', | |
1440: 'https://staging.kpwlaw.com/video/home-720p.mp4', | |
1024: 'https://staging.kpwlaw.com/video/home-540p.mp4', | |
768: 'https://staging.kpwlaw.com/video/home-540p.mp4', | |
425: 'https://staging.kpwlaw.com/video/home-540p.mp4', |