Skip to content

Instantly share code, notes, and snippets.

View yomybaby's full-sized avatar

Jong Eun Lee yomybaby

View GitHub Profile
@yomybaby
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
yomybaby / .eslintrc
Created November 17, 2018 13:25 — forked from radiovisual/.eslintrc
React Native AirBnB ESLint Config
{
"parser": "babel-eslint",
"plugins": [
"react",
"react-native"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
@yomybaby
yomybaby / README.md
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
yomybaby / .eslintrc
Created October 27, 2018 00:30 — forked from chourobin/.eslintrc
React Native General Eslint File
{
"parser": "babel-eslint",
"env": {
"browser": true
},
"plugins": [
"babel",
"react",
"react-native"
],
@yomybaby
yomybaby / ChromeDeveloperToolsTabs.md
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).
document.getElementsByClassName('console-toolbar-container')[0].remove();
@yomybaby
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 수정
#
# https://medium.com/tomincode/extending-gateway-timeouts-with-node-js-elastic-beanstalk-applications-5cb256f08f4b
# https://cloudavail.com/2015/10/18/allowing-long-idle-timeouts-when-using-aws-elasticbeanstalk-and-docker/
# https://github.com/metabase/metabase/tree/b9533d43881090a72d97562fb112a6133cd94127/bin/aws-eb-docker
files:
"/etc/nginx/conf.d/proxy.conf":
mode: "000644"
@yomybaby
yomybaby / mongodb-s3-backup.sh
Last active July 16, 2019 15:15 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS) (using bitnami image)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` 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 backup.sh
# 7) Test it out via ./backup.sh
@yomybaby
yomybaby / README.md
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
yomybaby / example.js
Last active November 11, 2016 02:11
promise httpRequest using Q on Titanium
qHttp({
url: 'YOUR_URL',
method: "POST",
data: {
"access_token" : 'YOUR_TOKEN'
}
}).then(function (args){
// step 2 : other request
return qHttp({
@yomybaby
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.
*/
#ifdef USE_TI_UIWINDOW