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
sudo du -cha --max-depth=1 / | grep -E "M|G" |
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
git status --porcelain | awk '{if($1!="D") {print "scp " $2 " host:/var/www/host_dir/" $2 } }' > ./scp_changed |
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
git log --all --decorate --oneline --graph |
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
zip -r myarch.zip mydir/* | |
unzip myarch.zip -d destination_folder |
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
scp -r [email protected]:/path/to/foo /home/user/Desktop/ |
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
const getKeyByValue = (obj, value) => Object.keys(obj).find(key => obj[key] === value); |
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
import { LANGUAGE, COUNTRY } from './constants'; | |
export const setLanguage = language => ({ | |
type: LANGUAGE, | |
language | |
}); | |
export const setCountry = country => ({ | |
type: COUNTRY, | |
country | |
}); |
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
const build = path => path.reduceRight((o, i) => Object.assign({}, {[i]: o}), {}) |
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
// returns a string. fixed is an optional boolean flag to switch on fixed precision or not. | |
// If you want a number instead of a string prepend the unary plus operator, but then fixed precision cannot be guaranteed. | |
// -0.1 * 0.2 === -0.020000000000000004 | |
// round(-0.1 * 0.2, 3, true) === "-0.020" | |
// round(-0.1 * 0.2, 3) === "-0.02" | |
// +round(-0.1 * 0.2, 3) === -0.02 | |
// +round(-0.1 * 0.2, 3, true) === -0.02 | |
const round = (value, decimals, fixed) => { | |
const r = Number(Math.round(value + 'e' + decimals) + 'e-' + decimals) | |
return fixed ? r.toFixed(decimals) : r + '' |
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
const pick = (props, obj) => props.reduce((acc, curr) => ({ ...acc, ...{[curr]: obj[curr]} }), {}); |
NewerOlder