Skip to content

Instantly share code, notes, and snippets.

View patissier-boulanger's full-sized avatar

Juhyoung JUNG patissier-boulanger

View GitHub Profile
@patissier-boulanger
patissier-boulanger / cache_worker.js
Last active February 16, 2023 08:48
Cache worker
// inside service worker eg. sw.ts
self.addEventListener('fetch', function (event) {
if (event.request.url.endsWith('.mp4')) {
event.respondWith(
caches.match(event.request).then(function (response) {
if (response) {
return response
} else {
import React, {Dispatch, SetStateAction, useEffect, useState} from 'react';
import {Pressable, Text, useWindowDimensions, View} from 'react-native';
import Animated, {
Easing,
runOnJS,
useAnimatedStyle,
useSharedValue,
withSpring,
withTiming,
} from 'react-native-reanimated';
import React, {Dispatch, SetStateAction, useEffect, useState} from 'react';
import {Pressable, Text, useWindowDimensions, View} from 'react-native';
import Animated, {
Easing,
runOnJS,
useAnimatedStyle,
useSharedValue,
withSpring,
withTiming,
} from 'react-native-reanimated';
@patissier-boulanger
patissier-boulanger / reanimated_modal3.tsx
Created January 5, 2023 07:55
medium-reanimated-modal 3
import React, {Dispatch, SetStateAction, useEffect} from 'react';
import {Pressable, Text, useWindowDimensions, View} from 'react-native';
import Animated, {
Easing,
useAnimatedStyle,
useSharedValue,
withSpring,
withTiming,
} from 'react-native-reanimated';
@patissier-boulanger
patissier-boulanger / reanimated_modal2.tsx
Last active January 5, 2023 06:36
medium-reanimated-modal 2
import React, {useState} from 'react';
import {Pressable, Text, View, SafeAreaView} from 'react-native';
import {Modal} from './src/components/Modal';
const App = () => {
const [showModal, setShowModal] = useState(false);
const handleOnPress = () => {
setShowModal(modalShownState => !modalShownState);
@patissier-boulanger
patissier-boulanger / gist:301ed3c68e6c571b612fa0e37ebe3fb4
Last active January 5, 2023 06:24
React-Native-modal-dimmed-Area
import React, {useEffect} from 'react';
import Animated, {
Easing,
useAnimatedStyle,
useSharedValue,
withTiming,
} from 'react-native-reanimated';
type ModalPropType = {
showModal: boolean;
desc "Increase Version Name"
lane :increase_version_name_iOS do
package = load_json(json_path: "../package.json")
package_version = package['version']
increment_version_number(
version_number: package_version
)
end
desc "Deploy Application"
lane :patch do
match()
increment_build_number()
increment_version_number(bump_type: "patch")
gym()
pilot()
end
desc "Deploy publ minor"
@patissier-boulanger
patissier-boulanger / androidBuildGradleFlavor.txt
Last active March 18, 2022 05:11
android multiple target build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
desc "Deploy newTarget"
lane :newTarget do
match(type: 'appstore', readonly: true)
gym(scheme: 'newTarget', clean: true) // 여기에 아까 만들었던 scheme의 이름을 넣어줍시다. 그러면 gym이 알아서 빌드합니다.
pilot()
end