Use this chunk with react-app-rewired
It disables CRA warning about using files outside src
directory
/* Returns CSS rotateZ compatible angle for verctor */ | |
var getVectorAngle = function(x0,x,y0,y) { | |
if (y0===y) { | |
if (x>x0) angle = 0; | |
else if (x<x0) angle = 180; | |
else if (x===x0) angle = 0; | |
} else if (x0===x) { | |
if (y>y0) angle = 90; | |
else if (y0>y) angle = -90; | |
else angle = 0; |
Use this chunk with react-app-rewired
It disables CRA warning about using files outside src
directory
function svgPathToCubicBezierPoints(path, percentRequired) { | |
var path=path.replace(/([\n])/g, ' ').replace(/[\t]+/g, ''),si=0,cubic=[], | |
task=0, | |
M_EREG = /M[\s\d\.\-\,]+[^\sSCLM]+/i, | |
c_EREG = /c[\s\d\.]+,[\d\.]+\-[\d\.]+,[\d\.]+[^\sSCLM]+/i, | |
s_EREG = /s[\s\d\.\-\,][^\sSCLM]+/i, | |
Parts = [],p=null,shift=0,cubic=[],vals,tonullx=0,tonully=0,i=0,locksblocks=[],addsx=0,addsy=0, | |
minx=9999999,miny=9999999,maxx=0,maxy=0; | |
// Search for M |
pid=$(sleep 1000 & echo "$PPID") & | |
npx -q press-any-key "Press any key to stop subshell" && kill "$pid"; |
export default function findProperty(obj, name, xpath = ["[root]"], storedObjects = []) { | |
let foundedKeys = []; | |
if (storedObjects.includes(obj)) { | |
return foundedKeys; | |
} | |
storedObjects.push(obj); | |
if (Array.isArray(obj)) { | |
for (let i = 0; i < obj.length; i++) { | |
foundedKeys = foundedKeys.concat( |
var http = require("http"), | |
url = require("url"), | |
fs = require('fs'), | |
path = require('path'), | |
here = process.cwd(), | |
extTypes = { | |
"3gp" : "video/3gpp" | |
, "a" : "application/octet-stream" | |
, "ai" : "application/postscript" | |
, "aif" : "audio/x-aiff" |
var http = require("http"), | |
url = require("url"), | |
fs = require('fs'), | |
path = require('path'), | |
here = process.cwd(), | |
extTypes = { | |
"3gp" : "video/3gpp" | |
, "a" : "application/octet-stream" | |
, "ai" : "application/postscript" | |
, "aif" : "audio/x-aiff" |
/* Under MIT License, Vladimir Kalmykov 2019 */ | |
// I'm not sure this is the best solution, but it works and finds cyclical dependencies | |
// Any suggestions? Leave comments. | |
/** | |
* @param packages Array of package.json | |
* @return Array of names | |
*/ | |
function sortAccordingToDepends(packages) { |
# List all node processes | |
ps -ef | grep " node" | awk '{print $8, $2}' | |
# Kill all node processes | |
ps -ef | grep " node" | awk '{print $2}' | xargs -n 1 bash -c 'kill -9 "$1" 2>/dev/null || echo "Pid $1 is invalid"' -- |
module.exports = function getCombinations(letters, count, shift = 0) { | |
let variants = []; | |
for (let i = shift; i < letters.length; i++) { | |
if (count > 1) { | |
const childCombinations = getCombinations(letters, count - 1, i + 1); | |
for (let c = 0; c < childCombinations.length; c++) { | |
variants.push([letters[i]].concat(childCombinations[c])); | |
} | |
} else { | |
variants.push([letters[i]]) |