Skip to content

Instantly share code, notes, and snippets.

View yomybaby's full-sized avatar

Jong Eun Lee yomybaby

View GitHub Profile
yomybaby / useRequest.ts
Created July 19, 2021 03:12
React hook for handling promise pattern
import React, { useReducer, useCallback } from 'react';
export type Service<R, P extends any[]> = (...args: P) => Promise<R>;
export type RequestState<R, P> = {
data?: R;
error?: any;
pending: boolean;
fulfilled: boolean;
rejected: boolean;
yomybaby / .eslintrc
Created November 17, 2018 13:25 — forked from radiovisual/.eslintrc
React Native AirBnB ESLint Config
"parser": "babel-eslint",
"plugins": [
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
yomybaby /
Last active April 17, 2019 00:05
Collection of CLI for iOS/Android Simulator/Emulator with react-native

Launch & Terminate Application

# iOS
xcrun simctl terminate booted org.reactjs.native.example.codejong-example
xcrun simctl launch booted org.reactjs.native.example.codejong-example

# Android
adb shell am start -n com.codejong_example/com.codejong_example.MainActivity
adb shell am force-stop com.codejong_example
yomybaby / .eslintrc
Created October 27, 2018 00:30 — forked from chourobin/.eslintrc
React Native General Eslint File
"parser": "babel-eslint",
"env": {
"browser": true
"plugins": [
yomybaby /
Last active November 20, 2019 13:03
Chrome developer tools hack : Clean console mode

You want to make console only mode for Screencast or presentation?

  1. open Chrome
  2. open Chrome developer tools (press cmd+alt+i)
  3. Click "Console" Tab of the developer tools.
  4. open Chrome developer tools of Chrome developer tools (press cmd+alt+i one more time)
  5. Paste below scripts to developer tools(created on step 4).
yomybaby / 00_nginx.config
Created July 5, 2018 05:16 — forked from 480/00_nginx.config
자주 쓰는 ebextensions 설정
# 장시간 http 연결로 인한 끊어짐을 방지키 위해 long idle time out 허용 하기
# nginx proxy 에 셋팅 + ELB 의 idle timeout 수정
mode: "000644"
yomybaby /
Last active July 16, 2019 15:15 — forked from eladnava/
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS) (using bitnami image)
# Make sure to:
# 1) Name this file `` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x
# 7) Test it out via ./
yomybaby /
Created September 16, 2016 08:38
`blacklistedURLs` of Titanium WebView

blacklistedURLs of Titanium WebView

blacklistedURLs of Titanium WebView is works after on Android only.(> TiSDK 5.4.0.GA) There is a PR to this for iOS : tidev/titanium-sdk#8019 (@AngelkPetkov Thanks!)

If you want to apply this to 5.5.0.GA, replace TiUIWebView.h and TiUIWebView.m on ~/Library/Application\ Support/Titanium/mobilesdk/osx/5.5.0.GA/iphone/Classes/` to bleow files

yomybaby / example.js
Last active November 11, 2016 02:11
promise httpRequest using Q on Titanium
url: 'YOUR_URL',
method: "POST",
data: {
"access_token" : 'YOUR_TOKEN'
}).then(function (args){
// step 2 : other request
return qHttp({
yomybaby / TiUIWindowProxy.m
Last active August 3, 2016 18:23
iOS hidesBarsOnSwipe on Titanium
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
* WARNING: This is generated code. Modify at your own risk and without support.