Skip to content

Instantly share code, notes, and snippets.

View gigobyte's full-sized avatar

Stanislav Iliev gigobyte

  • Sofia, Bulgaria
View GitHub Profile
import { Pressable as RNPressable, Text } from 'react-native'
import { FlatList, Pressable } from 'react-native-gesture-handler'
function TestComponent() {
return (
<>
<Text>RN</Text>
<FlatList
horizontal
data={[1, 2, 3, 4, 5]}
import { Pressable, Text } from 'react-native'
import {
Pressable as RNGHPressable,
Text as RNGHText,
} from 'react-native-gesture-handler'
function Reproduction() {
return (
<>
<Pressable
function Test() {
return (
<>
<View>
<Pressable
testID="good"
style={(state) => ({
marginTop: 100,
width: 50,
import { Pressable, ScrollView } from 'react-native-gesture-handler'
function Test() {
return (
<ScrollView style={{ flexGrow: 1, backgroundColor: 'white' }}>
<View style={{ paddingTop: 200, height: 2000 }}>
<Pressable
style={{ width: 30, height: 30, backgroundColor: 'pink' }}
onPress={() => Alert.alert('pressed')}
/>
function Test() {
const [shown, setShown] = useState(true)
if (!shown) {
return (
<Pressable
key="1"
testID="other-pressable"
style={{ width: 30, height: 30, backgroundColor: 'red' }}
onPress={() => console.log('pressed')}
function Screen() {
const opacity = useSharedValue(0)
const [dimensions, setDimensions] = useState({ height: 0, width: 0 })
const containerAnimatedStyle = useAnimatedStyle(() => {
'worklet'
return {
opacity: opacity.value,
transform: [{ scale: opacity.value }],
}
const [isPressed, setIsPressed] = useState(false)
return (
<Pressable
onPressIn={() => setIsPressed(true)}
onPressOut={() => setIsPressed(false)}
onPress={() => console.log('not called')}
/>
)
type input = `Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53
Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1
Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83
Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11`;
type Split<
Str extends string,
Separator extends string,
// Elm architecture - all data fetching is in the reducer
reducer(state, action) {
if (action === LOCATION_CHANGE && action.payload === '/send-payment') {
return loop(state, Cmd.action(fetchData()))
}
if (action === FETCH_DATA) {
return loop(state, corporateApiCall())
}
@gigobyte
gigobyte / infix-do-notation.hs
Created January 11, 2019 20:16
Infix vs do notation
headerToUsername :: Text -> Maybe Text
headerToUsername authHeader = do
JWT.stringOrURIToText <$> (JWT.sub =<< JWT.claims <$> JWT.decode authHeader)
headerToUsernameDo :: Text -> Maybe Text
headerToUsernameDo authHeader = do
unverifiedJwt <- JWT.decode authHeader
subject <- JWT.sub $ JWT.claims unverifiedJwt
return $ JWT.stringOrURIToText subject