Check Status of file permissions
Change Owner of File/Folder
Check Status of all services
Run Apache
// At index.html | |
if (navigator.serviceWorker) { | |
navigator.serviceWorker.register('/serviceworker.js') | |
} | |
// Main file serviceworker.js | |
const staticCacheName = 'cacheFile-v.0'; | |
self.addEventListener('install', installEvent => { | |
installEvent.waitUntil( | |
caches.open(staticCacheName) |
// Creating a XHR request | |
// Create new XHR Object | |
const xhrObject = new XMLHttpRequest(); | |
xhrObject.open('GET', 'https://api.unsplash.com/search/photos/?page=1&query=nature'); | |
xhrObject.setRequestHeader('Authorization', 'Client-ID xxxxx'); | |
// Handle resposne | |
xhrObject.onload(handleResponse); |
/* | |
1) When the user requests an HTML file, | |
a) fetch that page from the network; | |
i) and put a copy in the cache; | |
b) otherwise look for a cached version of the page; | |
c) otherwise show the fallback page. | |
2) When the user requests an image, | |
a) look for a cached version of the image; | |
i) fetch a fresh version from the network | |
(1) and update the cache; |
function trimCache(cacheName, maxItems) { | |
cacheName.open( cache => { | |
cache.keys() | |
.then( items => { | |
if (items.length > maxItems) { | |
cache.delete(items[0]) | |
.then( | |
trimCache(cacheName, maxItems) | |
); // end delete then | |
} // end if |
let $photoInput = document.getElementById("input"); | |
let image = new Image(); | |
let $editor = document.getElementById("editor"); | |
let $editorCtx = $editor.getContext("2d"); | |
function opacitor(op) { | |
let imgData = $editorCtx.getImageData(0, 0, $editor.width, $editor.height); | |
for (let x = 0; x < image.width; x++) { | |
for (let y = 0; y < image.height; y++) { | |
let index = (x + y * image.width) * 4; |
let $photoInput = document.getElementById("input"); | |
let fileReader = new FileReader(); | |
let image = new Image(); | |
let $editor = document.getElementById("editor"); | |
let $editorCtx = $editor.getContext("2d"); | |
//This is a performance test | |
function opacitor(op) { | |
let imgData = $editorCtx.getImageData(0, 0, $editor.width, $editor.height); | |
for (let x = 0; x < image.width; x++) { |
/*****************/ | |
//@TODO Update Omnisend separately with list id | |
/*****************/ | |
// An object of options to indicate where to post to | |
var options = { | |
"method": "POST", | |
"protocol": 'https:', | |
"hostname": 'api.omnisend.com', | |
"path": '/v3/contacts', |
function sponsor_pagination($pages = '', $range = 4) | |
{ | |
$showitems = ($range * 2)+1; | |
global $paged; | |
if(empty($paged)) $paged = 1; | |
if($pages == '') | |
{ | |
global $wp_query; |
//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); |