Skip to content

Instantly share code, notes, and snippets.

View JeffGuKang's full-sized avatar
🚀
Flying

Jeff Gu Kang JeffGuKang

🚀
Flying
View GitHub Profile
@JeffGuKang
JeffGuKang / App.tsx
Last active September 15, 2021 13:31
Swipe Animation for `swipe to delete` in React Native
import { StatusBar } from 'expo-status-bar';
import React, { useRef } from 'react';
import { Animated, PanResponder, StyleSheet, Text, View } from 'react-native';
const SWIPE = 80;
export default function App() {
const viewX = useRef(new Animated.Value(0)).current;
const interpolateX = viewX.interpolate({
inputRange: [-SWIPE, 0],
outputRange: [-SWIPE, 0],
@JeffGuKang
JeffGuKang / AndroidManifest.xml
Created January 30, 2020 06:08
react-native-push-notification with react-native-firebase-messaging v6.2.0
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourpackage">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATION" />
<application
android:name=".MainApplication"
@JeffGuKang
JeffGuKang / gist:89dddaad84533c99a2172f0f8ecfc4ce
Created December 2, 2019 08:07
Default getting android sha1 script for react native debug mode
keytool -list -v -keystore ./android/app/debug.keystore -alias 'androiddebugkey' -storepass android -keypass android
@JeffGuKang
JeffGuKang / PublicText.tsx
Created October 6, 2019 12:24
[React Native] PublicText component having same UI for iOS, Android platform
import React, { ReactNode } from 'react';
import { Text, Platform, TextProps } from 'react-native';
interface Props extends TextProps {
children: ReactNode;
}
const PublicText: React.FC<Props> = ({ style, children, ...props }: Props) => {
const defaultStyle = Platform.select({
ios: { fontFamily: 'AppleSDGothicNeo-Regular' },
@JeffGuKang
JeffGuKang / settings.json
Created September 6, 2019 01:55
React Native with typescript vscode settings
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": true,
"cucumberautocomplete.steps": [
// "test/features/step_definitions/*.js",
],
"typescript.validate.enable": false,
"eslint.validate": [
"javascript",
[
{
"id": "bitcoin",
"name": "Bitcoin",
"symbol": "BTC",
"rank": "1",
"price_usd": "10262.639669",
"price_btc": "1.0",
"24h_volume_usd": "16983997056.0",
"market_cap_usd": "183579760947",
@JeffGuKang
JeffGuKang / image-resize.js
Last active August 18, 2019 12:37
Image resize and orientation
/**
* Resie and auto rotate
* using https://github.com/blueimp/JavaScript-Load-Image
* @param {file from input} file
* @param {number} maxSize
*/
function ResizeImage(file, maxSize=1024) {
return new Promise(function(resolve, reject) {
if (window.File && window.FileReader && window.FileList && window.Blob) {
/**