function Block1() {
let a, b, c
/* another code */
}
(function() { /* my code */ })()
Вопрос: как это работает?
function Button(props: IButtonProps) {
const scaleX = useSharedValue(1);
const scaleY = useSharedValue(1);
const scaleFontSize = useSharedValue(1);
const [isPressed, setIsPressed] = useState(false);
useEffect(() => {
scaleFontSize.value = animationWithRepeat(1.07070707070707072);
scaleX.value = animationWithRepeat(1.1071428571428572);
scaleY.value = animationWithRepeat(1.1111111111111111);
}, []);
return (
<AnimatedPressable style={[
styles.defaultButton,
!isPressed ? styles.notPressedButton : styles.pressedButton,
{ transform: [ {scaleX}, {scaleY} ] },
props.styles
]}>
<AnimatedText style={[
styles.defaultText,
!isPressed ? styles.notPressedText : styles.pressedText,
]}>Принять</AnimatedText>
</AnimatedPressable>
)
}
const menu = document.querySelector('.burger-menu');
const menuList = document.querySelector('.menu__list');
const activateMenu = () => (menuList.classList.toggle('active-menu'), menu.classList.toggle('active'));
menu.addEventListener('click', activateMenu, true);
const array = [1, 255, 639, 9, 7, 8, 5, 4, 2];
const randomIndex = arr => Math.round(Math.random() * (arr.length-1));
const randomEl = arr => {
let index = randomIndex(arr), prev = arr[index];
return () => {
do {
index = randomIndex(arr);
}
while(prev === arr[index]);
prev = arr[index];
return arr[index];
}
}
const getRandomEl = randomEl(array);
for(let i = 0; i < 10; i++) {
console.log(getRandomEl());
}
- awk -i inplace '/location \/projects\/'"$location"'/,/}/ {if(/proxy_pass/) sub(/:[0-9]+.;/,":'"$port"';")} {print}' "$file"
+ awk -i inplace '/location \/projects\/'"$location"'/,/}/ {if(/proxy_pass/) sub(/:[0-9]+.;/,":'"$port"';")} {print}' $(ls $file)
./replace_location_port.sh -n who-am-i -v v2.50.6 -p 222 -f etc/nginx/locations/\*.locations