Тут перечислены не законы, последние слово всегда за здравым смыслом. Тут перечислены лишь направление, куда надо стремиться. Принципы, которые должны помочь, когда не знаешь, что выбрать.
- Пользователь. Если что-то сильно мешает UX или есть критическая ошибка, то в первую очередь мы спасаем пользователей. Для этого иногда надо взять ответственность на себя, переубедить толпу, написать плохой код.
Данный FAQ был специально создан для телеграм сообщества https://t.me/WebAssembly_ru.
Он базируется на статье от Andre Weissflog, но так же содержит множество моих дополнений и мыслей, которые могут быть уже не слишком актуальны на момент прочтения. Прошу это учитывать.
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 React, {useCallback, useRef} from 'react' | |
function useHookWithRefCallback() { | |
const ref = useRef(null) | |
const setRef = useCallback(node => { | |
if (ref.current) { | |
// Make sure to cleanup any events/references added to the last instance | |
} | |
if (node) { |
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
/* some pre-defined custom properties in my code */ | |
:root { | |
--default-transition-duration: .2s; | |
--default-easing: ease-out; | |
} | |
/* define mixin */ | |
@define mixin transition(--transition-property: all, --transition-duration: var(--default-transition-duration), --easing: var(--default-easing) ) { | |
transition: --transition-property --transition-duration --easing; | |
} |
If you get following error while installing php7.1-bcmath extension
The following packages have unmet dependencies:
php7.1-bcmath : Depends: php7.1-common (= 7.1.17-0ubuntu0.17.10.1) but 7.1.17-1+ubuntu17.10.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages
Download and install https://www.iterm2.com/
xcode-select --install
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
#!/bin/bash | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get install -y software-properties-common | |
add-apt-repository -y ppa:ondrej/php | |
add-apt-repository -y ppa:ondrej/apache2 | |
apt-get update |
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
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "usage: ./publish.sh \"commit message\"" | |
exit 1; | |
fi | |
vendor/bin/sculpin generate --env=prod | |
if [ $? -ne 0 ]; then echo "Could not generate the site"; exit 1; fi |
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
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
else | |
#Update and Upgrade | |
echo "Updating and Upgrading" | |
apt-get update && sudo apt-get upgrade -y |
NewerOlder