Install pandoc(https://pandoc.org/getting-started.html)
Clone this Gist find the two files: .less-filter-to-man
& md-to-pdf.sh
1 Add to your /home
or ~
directory. 📘
Install pandoc(https://pandoc.org/getting-started.html)
Clone this Gist find the two files: .less-filter-to-man
& md-to-pdf.sh
1 Add to your /home
or ~
directory. 📘
# SMACSS Property Order | |
# http://smacss.com/book/formatting | |
# Box | |
content | |
display | |
float | |
flex |
// создать массив из N элементов, и заполнить его числами от 1 до N: | |
[...Array(N+1).keys()].slice(1) | |
// деструктуризация и присваивание в уже существующие переменные: | |
let isOnline = true; | |
let isLoggedIn = false; | |
const data = { isOnline: false, isLoggedIn: true }; | |
({ isOnline, isLoggedIn } = data); |
# How to rebase automatically on git pull | |
https://dev.to/mliakos/don-t-git-pull-use-git-pull-rebase-instead-5b8k | |
# How to remove untraceable files | |
git clean -df |
<?php | |
/*************** | |
* set attr defer for js-scripts | |
***************/ | |
add_filter( 'script_loader_tag', 'add_defer_attribute', 10, 2 ); | |
function add_defer_attribute( $tag, $handle ) { | |
$scripts_to_defer = array( 'google-map', 'google-map-init' ); | |
foreach ( $scripts_to_defer as $defer_script ) { |
class Configuration { | |
private static $instance; | |
private function __construct() {/* */} | |
public static function getInstance() { | |
if (self::$instance === null) { | |
self::$instance = new Configuration(); | |
} | |
return self::$instance; | |
} | |
public function get($key) {/* */} |
`npx npm-check -u` - checks all available updates, shows safe and unsafe updates, and give ability to make updates | |
OR | |
https://stackoverflow.com/questions/16525430/npm-check-and-update-package-if-needed |
function myFunc() { | |
console.log(this); | |
return function () { | |
console.log(this); | |
} | |
} | |
var user = { | |
name: 'Vasya' | |
}; |
npx prettier --check '{worker-exercise,worker-solution}/**/!({.gitignore,package.json})*.*' | |
npx prettier --check 'src/**/!(*{.svg,.pdf,.png})*.*' // for MMS 2.0 | |
npx eslint --fix '{worker-exercise,worker-solution}/**/*.{js,jsx,ts,tsx}' --ignore-pattern node_modules | |
// negating pattern '!(*test).js' will match all JS files, except those ending in test.js, so foo.js but not foo.test.js |
find . -name "node_modules" -type d -prune -print | xargs du -chs
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d"
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;