This file contains hidden or 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 fs = require('fs'); | |
| if (fs.existsSync(path)) { | |
| // Do something | |
| } |
This file contains hidden or 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 asyncCompose = (…functions) => input => functions.reduceRight((chain, func) => chain.then(func), Promise.resolve(input)); | |
| const asyncPipe = (…functions) => input => functions.reduce((chain, func) => chain.then(func), Promise.resolve(input)); |
This file contains hidden or 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 | |
| return [ | |
| 'log' => [ | |
| 'traceLevel' => 0, // не выводит stack trace | |
| 'targets' => [ | |
| [ | |
| 'class' => 'yii\log\FileTarget', | |
| 'levels' => ['trace','error'], | |
| 'categories' => ['dd'], | |
| 'logFile' => '@app/runtime/logs/debug.log', |
This file contains hidden or 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 React, { Component } from "react"; | |
| import { render } from "react-dom"; | |
| class Parent extends Component { | |
| state = { | |
| key: true, | |
| count: 0 | |
| }; | |
| handleChildUnmount = () => { |
This file contains hidden or 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 apt-get install --reinstall gnome-applets |
This file contains hidden or 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
| # define port running container | |
| docker inspect d50dfd0130f3 | grep "IPAddress" | |
| # define port all apps: | |
| docker inspect -f '{{.Name}} - {{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) | |
| #memory usage | |
| docker stats --all --no-stream --format "table {{.Container}}\t{{.Name}}\t{{.MemUsage}}" | |
| #stop all container | |
| docker stop $(docker ps -q) |
This file contains hidden or 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
| aria2c -j 16 -x 16 <URL TO FILE> |
This file contains hidden or 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
| // dynamic add cordova.js | |
| if (window.location.protocol === 'file:' || window.location.port === '3000') { | |
| var cordovaScript = document.createElement('script') | |
| cordovaScript.setAttribute('type', 'text/javascript') | |
| cordovaScript.setAttribute('src', 'cordova.js') | |
| document.body.appendChild(cordovaScript) | |
| } |
This file contains hidden or 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 apt-get install gradle | |
| export ANDROID_HOME=/<installation location>/android-sdk-linux | |
| export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools |
This file contains hidden or 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 today = new Date().toISOString().slice(0, 10); |