Skip to content

Instantly share code, notes, and snippets.

View smontlouis's full-sized avatar

Montlouis-Calixte Stéphane smontlouis

  • Freelance
  • Annecy
View GitHub Profile
@smontlouis
smontlouis / InteractiveLottie.tsx
Last active November 15, 2024 11:16
Interactive lottie
import LottieView from 'lottie-react-native'
import Animated, {
makeMutable,
useAnimatedProps,
useAnimatedStyle,
useFrameCallback,
useSharedValue,
withTiming,
} from 'react-native-reanimated'
import { Button, XStack } from 'tamagui'
@smontlouis
smontlouis / AnimatedAudioLines.tsx
Created October 30, 2024 12:21
Animated audio lines
import { UseThemeResult } from '@tamagui/core'
import React from 'react'
import Animated, {
Easing,
SharedValue,
interpolateColor,
useAnimatedStyle,
useDerivedValue,
useSharedValue,
withRepeat,
@smontlouis
smontlouis / SplitScreen.tsx
Created November 13, 2023 06:53
Amie in-app split screen in react-native
import { useWindowDimensions } from 'react-native'
import { Gesture } from 'react-native-gesture-handler'
import Animated, {
Extrapolation,
WithSpringConfig,
interpolate,
scrollTo,
useAnimatedRef,
useAnimatedScrollHandler,
useAnimatedStyle,
@smontlouis
smontlouis / SeemlessLooper.ts
Last active October 20, 2024 13:00
seemless / gapless loop crossfade solution with expo-av
import {
AVPlaybackSource,
AVPlaybackStatus,
AVPlaybackStatusError,
AVPlaybackStatusSuccess,
Audio,
} from 'expo-av'
const FADE_DURATION = 4000
@smontlouis
smontlouis / react-query-lite.tsx
Last active November 22, 2023 17:37
React Query Lite
import React from 'react'
import { usePrevious } from './usePrevious'
export type QueryStatus = 'idle' | 'loading' | 'error' | 'success'
type QueryClientProviderProps = {
children: React.ReactNode
client: QueryClient
}
const lunr = require('lunr')
require('lunr-languages/lunr.stemmer.support')(lunr)
require('lunr-languages/lunr.fr')(lunr)
require('./lunr.unicodeNormalizer')(lunr)
var idx = lunr(function () {
this.use(lunr.fr)
this.use(lunr.unicodeNormalizer)
...
import glamorous from 'glamorous'
const Row = glamorous.div(({ extended }) => ({ // THIS IS OK
position: 'relative',
maxWidth: extended ? 1330 : 1200,
margin: '0 auto',
boxsizing: 'border-box',
display: 'flex',
flexDirection: 'row',
flexWrap: 'wrap',
@smontlouis
smontlouis / Component.js
Last active September 11, 2022 11:13
React Native - Fixed header/footer disappearing on scroll
import React, { PropTypes, Component } from 'react'
import {
Animated,
ScrollView,
Text,
View,
} from 'react-native'
import EStyleSheet from 'react-native-extended-stylesheet'
const styles = EStyleSheet.create({
{
"name": "este-app",
"description": "Robust and comfortable dev stack for isomorphic web apps",
"author": "Daniel Steigerwald",
"version": "9.2.0",
"private": true,
"scripts": {
"postinstall": "cd node_modules/material-ui && npm install && npm uninstall react && gulp build --production",
"start": "node src/server",
"test": "gulp test",
<App>
<Component>
<Component2>
<Component3>
<Child/>
</Component3>
</Component2>
</Component>
</App>