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
pid=$(sleep 1000 & echo "$PPID") & | |
npx -q press-any-key "Press any key to stop subshell" && kill "$pid"; |
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
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( |
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 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" |
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 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" |
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
/* 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) { |
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
# 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"' -- |
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
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]]) |
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
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
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
// Tested with Unity Personal 2019.2.0a14 | |
using UnityEngine; | |
using System.Collections; | |
public class DragPiece2D : MonoBehaviour | |
{ | |
public float dampingRatio = 5.0f; | |
public float frequency = 2.5f; | |
public float drag = 10.0f; | |
public float angularDrag = 5.0f; |
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
{ | |
parser: babel-eslint, | |
env: { | |
browser: true, | |
jest : true, | |
node : true, | |
es6: true | |
}, | |
parserOptions: { | |
ecmaFeatures: { |
NewerOlder