Skip to content

Instantly share code, notes, and snippets.

View JJMoon's full-sized avatar

Jongwoo Moon JJMoon

  • Mokam
  • Korea
View GitHub Profile
// Reference :: https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project
// package.json
"devDependencies": {
"@babel/code-frame": "7.0.0",
"@babel/parser": "7.3.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-decorators": "^7.1.2",
"@types/react": "^16.7.3",
"@types/react-native": "^0.57.7",
// 이렇게 반복하는 애니메이션.
animationStart2(sclF) {
Animated.loop(
Animated.sequence([
Animated.timing(this.state.sclX, {
toValue: 0.9 * width * sclF, duration: 1000, delay: 0,
}),
Animated.timing(this.state.sclX, {
// 이렇게 반복하는 애니메이션.
animationStart2(sclF) {
Animated.loop(
Animated.sequence([
Animated.timing(this.state.sclX, {
toValue: 0.9 * width * sclF, duration: 1000, delay: 0,
}),
Animated.timing(this.state.sclX, {
@JJMoon
JJMoon / AnimationBasicCompo.js
Last active November 21, 2018 10:37
React Native Animation
import { Alert, Animated, Easing } from 'react-native';
this.aniStg = new Animated.Value(0); // 어디선가 초기화를.
startAnimation() {
const easing = Easing.ease; // elastic(1);
Animated.timing(
this.aniStg,
{
toValue: 1, duration: 1000, delay: 50, easing, // 1 second
@JJMoon
JJMoon / appsflyercase.m
Created May 18, 2018 07:31
Selected Import on objective-c
#if __has_include(<AppsFlyerLib/AppsFlyerTracker.h>) // from Pod
#import <AppsFlyerLib/AppsFlyerTracker.h>
#else
#import "AppsFlyerTracker.h"
#endif
@JJMoon
JJMoon / jsonToDic.m
Created May 9, 2018 07:39
Obj-c json to dictionary
NSData *jsonData = [theJson dataUsingEncoding:NSUTF8StringEncoding];
NSError *err;
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsonData
options:NSJSONReadingAllowFragments error:&err];
@JJMoon
JJMoon / rn_cli_commands.sh
Last active May 29, 2018 15:25
React Native Dev commands
# run on other port
react-native start --port 8085
npm start -- --port=8080
@JJMoon
JJMoon / jsFetchErrorHandling.js
Last active April 26, 2018 03:32
JS fetch error handling
// Ref: https://www.w3schools.com/js/js_errors.asp
// 모든 함수 공통 사용 에러 표시 메시지.
export const fetchRespNotOK = (resp) => {
console.log(resp, resp.status, resp.statusText);
const msg = _.isNil(resp.statusText) ? '네트워크 오류' : resp.statusText;
Alert.alert('네트워크 오류', `인터넷 연결을 확인해 주세요 (${msg})`);
};
export const parseResult = (resp, nullCaseObj) => {
if (!_.isNil(resp) && resp.result && resp.result.ret === 'success') {
@JJMoon
JJMoon / codepush.sh
Created April 24, 2018 06:15
Code Push Commands (MOIN)
code-push deployment ls mobile-android
# Release Current Version
code-push release-react mobile-ios ios --deploymentName Production --mandatory true