S.O.L.I.D-ый JavaScript https://www.youtube.com/watch?v=wi3wPzReKZQ
Состояние состояния https://www.youtube.com/watch?v=8VesYob7OJg
Angular Schematics - как потерять время с пользой https://www.youtube.com/watch?v=13XC9tewi2g
Превышаем скоростные лимиты с Angular 4
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
function useFormik(props) { | |
// useState to keep the same observable around without recreating it on each render | |
const [formik] = React.useState(() => | |
mobx.observable({ | |
values: props.initialValues || {}, | |
touched: {} | |
}) | |
) | |
// just mutate state, this function itself can be considered an action+reducer |
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 PropTypes from 'prop-types'; | |
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>; | |
type Defined<T> = T extends undefined ? never : T; | |
/** | |
* Get the type that represents the props with the defaultProps included. | |
* | |
* Alternatively, we could have done something like this: |
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
createEnvFile() { | |
production=$1 | |
hmr=$2 | |
file=$3 | |
echo "export const environment = {" > $file | |
echo " production: $production," >> $file | |
echo " hmr: $hmr" >> $file | |
echo "};" >> $file | |
} |
From: https://www.jesgs.com/blog/2017/12/18/deploying-from-github-to-vps-using-travis-ci
Recently, I spent around 14 to 16 hours learning all of the necessary steps to getting an existing repo set up with Travis CI to run unit tests, and then once successful, connect to a remote server that isn't a PaaS (in this case, Linode) and then proceeds to use Git hooks to do post deployment things.
Starting with your local machine and you have your project already checked out from Github.
- Assuming you have Ruby (at least 2.3.1) installed, run
gem install travis
. This installs the Travis CI command-line tools. We're going to use these tools to encrypt RSA keys that Travis will use to connect to your remote server. - This tutorial also assumes that you have a working repo and a Travis-CI account set up.
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
<?php | |
namespace AppBundle\Repository; | |
use AppBundle\Entity\Country; | |
use AppBundle\Entity\CountryTranslation; | |
use Doctrine\ORM\EntityRepository; | |
use Doctrine\ORM\Query\ResultSetMapping; | |
use Doctrine\ORM\QueryBuilder; |
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
#!/usr/bin/env bash | |
echo "php-cs-fixer pre commit hook start" | |
PHP_CS_FIXER="bin/php-cs-fixer" | |
PHP_CS_CONFIG=".php_cs" | |
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php') | |
if [ -n "$CHANGED_FILES" ]; then | |
$PHP_CS_FIXER fix --config "$PHP_CS_CONFIG" $CHANGED_FILES; | |
git add $CHANGED_FILES; |
...
"require": {
"vendor/package": "1.3.2", // exactly 1.3.2 (exact)
// >, <, >=, <= | specify upper / lower bounds
"vendor/package": ">=1.3.2", // anything above or equal to 1.3.2
"vendor/package": "<1.3.2", // anything below 1.3.2
// * | wildcard
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
<?php | |
/** | |
* A modified version of the original symfony form type that adds the timezone offset. | |
* | |
* Original version at: | |
* https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php | |
*/ | |
/* | |
* Installation: |
NewerOlder