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 libUrl = null; | |
var scriptTag = Array.prototype.slice | |
.call(document.getElementsByTagName("script")) | |
.filter(x => /\?proxy?/.test(x.src)); | |
if (scriptTag.length > 0) { | |
libUrl = scriptTag[0].src.split("m.js")[0]; | |
} else { | |
throw new Error("missing '?proxy' query parameter in your proxy url!"); | |
} |
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
<?php | |
class Awesome extends League\Flysystem\Adapter\Local { | |
public function write($path, $contents, League\Flysystem\Config $config) { | |
$location = $this->applyPathPrefix($path); | |
$this->ensureDirectory(dirname($location)); | |
if (($size = file_put_contents($location, $contents, $this->writeFlags)) === false) { | |
return false; | |
} |
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
computed: { | |
parsedErrors() { | |
const parseDotNotation = function(str, val, obj) { | |
let currentObj = obj, | |
keys = str.split('.'), | |
i, l = Math.max(1, keys.length - 1), | |
key | |
for (i = 0; i < l; ++i) { | |
key = keys[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
var BKDRHash = function(str) { | |
var seed = 131; | |
var seed2 = 137; | |
var hash = 0; | |
// make hash more sensitive for short string like 'a', 'b', 'c' | |
str += 'x'; | |
// Note: Number.MAX_SAFE_INTEGER equals 9007199254740991 | |
var MAX_SAFE_INTEGER = parseInt(9007199254740991 / seed2); | |
for(var i = 0; i < str.length; i++) { | |
if(hash > MAX_SAFE_INTEGER) { |