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 path<R>(obj: R) { | |
// function createKeyAccessor<O>(parent: O) { | |
// const accessor = <K extends keyof O>(key: K) => { | |
// const value = parent ? parent[key] : null | |
// return createKeyAccessor(value) | |
// } | |
// accessor.get = () => parent | |
// return accessor |
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
{} |
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
{"lastUpload":"2020-03-12T16:14:34.251Z","extensionVersion":"v3.4.3"} |
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
/** | |
* Handles multithread processing on an array through promise-ified Web Workers | |
* (through workerize-loader https://github.com/developit/workerize-loader) | |
* | |
* @example | |
* const piranhas = new Piranhas( | |
* Worker, | |
* // Listens for messages from workers | |
* e => { e.data.type === 'INCREMENT' && someIncrementer() } | |
* ) |
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 strToHSL(input) { | |
return intToHSL(getHashCode(input)); | |
function intToHSL(int) { | |
var shortened = int % 360; | |
return "hsla(" + shortened + ",70%,40%,0.4)"; | |
}; | |
function getHashCode(str) { | |
var hash = 0; |
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
// Class for simultaneously pushing/retrieving from foreign chrome.sync and local object. | |
var Storage = function() { | |
this.set = function(property,value,cb) { | |
this[property] = value | |
chrome.storage.sync.set( | |
{property: value}, | |
function sentToStorage(storage) { | |
console.log("Set new "+property+" = "+value) | |
if(typeof cb === 'function') cb() | |
} |
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
/* | |
// Usage | |
var w = popupWindow("","_blank",400,600); | |
w.document.write(html); | |
var retrieveData = w.opener.data; | |
w.close(); | |
*/ | |
function popupWindow(url, title, w, h) { | |
var left = (screen.width/2)-(w/2); |
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 CanvasFont(obj) { | |
this.weight = obj.weight || 400; | |
this.size = obj.size || "12px"; | |
this.family = obj.family.name || "sans-serif"; | |
this.fallback = obj.fallback; // array | |
} | |
CanvasFont.prototype.set = function(obj) { | |
for(var prop in obj) { this[prop] = obj[prop]; } | |
} | |
CanvasFont.prototype.toString = function() { |
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
ErrorDocument 400 /errors.php | |
ErrorDocument 401 /errors.php | |
ErrorDocument 402 /errors.php | |
ErrorDocument 403 /errors.php | |
ErrorDocument 404 /errors.php | |
ErrorDocument 500 /errors.php |