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
# Automatically clear autoptimizeCache if it goes beyond 256MB | |
if (class_exists('autoptimizeCache')) { | |
$myMaxSize = 256000; # You may change this value to lower like 100000 for 100MB if you have limited server space | |
$statArr=autoptimizeCache::stats(); | |
$cacheSize=round($statArr[1]/1024); | |
if ($cacheSize>$myMaxSize){ | |
autoptimizeCache::clearall(); | |
header("Refresh:0"); # Refresh the page so that autoptimize can create new cache files and it does breaks the page after clearall. | |
} |
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://my.aliexpress.com/wishlist/wish_list_product_list.htm?¤tGroupId=0&page=1 | |
const priceNodes = document.querySelectorAll('.price'); | |
const pricesCollection = Array.from(priceNodes); | |
var prices = pricesCollection.reduce((total, prc) => { | |
const prices = prc.textContent.trim().replace(/[^\d,-]/g, '').replace(/,/g, '.').split('-'); | |
const lowestPrice = Number(prices[0]); | |
const highestPrice = Number(prices[1]) || lowestPrice; | |
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
{ | |
"configurations": [ | |
{"source": "https://github.com/Microsoft/vscode-recipes/tree/master/nodemon"}, | |
{ | |
"debug": "nodemon -e --inspect-brk js,graphql -x node src/index.js" | |
}, | |
{ | |
"type": "node", | |
"request": "attach", | |
"name": "BackEnd - Nodemon Debug", |
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
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
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 listeners = (function listAllEventListeners() { | |
let elements = []; | |
const allElements = document.querySelectorAll('*'); | |
const types = []; | |
for (let ev in window) { | |
if (/^on/.test(ev)) types[types.length] = ev; | |
} | |
for (let i = 0; i < allElements.length; i++) { | |
const currentElement = allElements[i]; |
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
// Set remote origin connection | |
git remote add origin ssh://git@git.datenmarkt.de:a.vorobjovs/Pflegegradrechner.git | |
// Get remote URL | |
git config --get remote.origin.url | |
// Clone in current empty directory | |
git clone git@git.datenmarkt.de:a.vorobjovs/Pflegegradrechner.git . | |
// Switch branch |
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
//source: https://remysharp.com/2010/07/21/throttling-function-calls | |
/* Let us work on performance issues while making resource-intensive things */ | |
/* Will wait every `limit` miliseconds until the callback is executed */ | |
function _throttle(fn, threshold, scope) { | |
threshold || (threshold = 250); | |
var last, | |
deferTimer; | |
return function () { | |
var context = scope || this; |
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
//source: https://remysharp.com/2010/07/21/throttling-function-calls | |
/* Let us work on performance issues while making resource-intensive things */ | |
/* Will wait until event is not stopped and wait param is finished, then the callback will be fired */ | |
function _debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { | |
timeout = null; |
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
@media only screen and (min-resolution: 2dppx), (min-resolution: 192dpi) { | |
background-image: url('/assets/build/img/sprite-2x.png'); | |
} |
NewerOlder