Skip to content

Instantly share code, notes, and snippets.

View piaskowyk's full-sized avatar
🚀

Krzysztof Piaskowy piaskowyk

🚀
  • Software Mansion
  • Poland
View GitHub Profile
import math
class Solver:
_found_primes = set()
def _is_prime(self, num):
# jeżeli jest już pierwszą to nie szukaj dalej, O(1)
if num in self._found_primes:
import instagram
def instagram_algorythm(story_reaction):
if story_reaction is '🔥':
do_notething()
import React, {Component} from 'react';
import {View, TouchableOpacity, Text} from 'react-native';
import Animated, {
useSharedValue,
useAnimatedStyle,
withTiming,
} from 'react-native-reanimated';
function RotationAnimation(props) {
var rotationValue = 0;
rm -rf ./node_modules
yarn cache clean
yarn
cd ios
pod deintegrate
rm -rf ./Pods
pod install
cd ..
cd android
rm -rf ./build
import Animated, {
useSharedValue,
withTiming,
useAnimatedStyle,
runOnUI,
makeMutable,
runOnJS,
} from 'react-native-reanimated';
import { View, Button } from 'react-native';
import React from 'react';
import Animated, {
useSharedValue,
withTiming,
useAnimatedStyle,
runOnUI,
withRepeat,
useFrameCallback,
makeMutable
} from 'react-native-reanimated';
import { View, Button } from 'react-native';
This isn't a regression - it's the design of a new shared values.
You can think of the shared value as a shared memory that can be accessed by
many threads simultaneously. It requires control by a mutex to prevent volatile
memory access and potential application crashes.
In the previous approach, we maintained an additional copy of each shared value.
This copy was used to read them from JS thread, while the original was intended
for use on the UI thread. Reading shared values from the JS thread could occur
without blocking any threads, but it forced us to create a copy on each shared
import React, { useState } from 'react';
import { Pressable, Text } from 'react-native';
import Animated, { css } from 'react-native-reanimated';
export default function ParticleButton() {
const [pressed, setPressed] = useState(false);
const [showParticles, setShowParticles] = useState(false);
return (
<Pressable
import React, { useState } from 'react';
import { Pressable, Text } from 'react-native';
import Animated, { css } from 'react-native-reanimated';
export default function OutlineButton() {
const [pressed, setPressed] = useState(false);
const animation1 = {
animationName: css.keyframes({
'0%': {
import React, { useState } from 'react';
import { Pressable, Text } from 'react-native';
import Animated, { css } from 'react-native-reanimated';
export default function PhysicalButton() {
const [pressed, setPressed] = useState(false);
return (
<Pressable onPressIn={() => setPressed(true)} onPressOut={() => setPressed(false)}>
<Animated.View style={[styles.button, pressed ? styles.animationDown : styles.animationUp]}>