Skip to content

Instantly share code, notes, and snippets.

View leeyc09's full-sized avatar

Youngchan leeyc09

  • jiransoft
  • S.korea
View GitHub Profile
//https://github.com/leeyc09/L10nStringResourceAutomation/blob/master/sample_build.gradle
ext.download_res_folder = 'src/main/res_down' //저장될 별도의 리소스 폴더
ext.script_path = 'script/languageResource.py' //스크립트 저장 경로
ext.GoogleDocId = 'Google Doc ID' //구글 스프레드시트 독 아이디
ext.json_key_path = 'script/some_auth_file.json' ///구글 키 저장 경로
task StringResourceSync(type: Exec) {
doFirst {
println ":::" + "Start to get String Resources..." + ":::"
@leeyc09
leeyc09 / RetrofitException
Created April 29, 2017 05:08
RxErrorHandlingCallAdapterFactory
package net.stylemilk.app.repository.api.exception;
import java.io.IOException;
import java.lang.annotation.Annotation;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Response;
import retrofit2.Retrofit;
@leeyc09
leeyc09 / PostCheckInterceptor
Last active May 2, 2017 07:02
Custom error Check Interceptor
package net.stylemilk.app.repository.api;
import android.util.Log;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.stream.MalformedJsonException;
import java.io.EOFException;
import java.io.IOException;
@leeyc09
leeyc09 / retrofitupload1.java
Created March 8, 2017 01:24
retrofit upload 1
/**
* 파일 업로드 -1
* @Body에 parameter를 모두 추가하는 방법
*/
@POST("app/item/upload")
Observable<JsonObject> FileUpload_test(@Body RequestBody params);
RequestBody requestBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("node", MY_FOLDER_NODE)
/*Activity */
package jiran.com.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import io.realm.Realm;
function onOpen() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var entries = [{
name : "iOS Resource sheet",
functionName : "iOSSheet"
}, {
name : "Android Resource sheet",
functionName : "AndroidSheet"
}];
sheet.addMenu("리소스 만들기", entries);
@leeyc09
leeyc09 / languageResource.py
Created March 9, 2016 05:36
android resource automation
import os
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import csv;
import gdata.docs.service
import gdata.spreadsheet.service
from xml.etree.ElementTree import ElementTree, Element, SubElement, dump
@leeyc09
leeyc09 / SerializableHttpCookie.java
Created February 5, 2016 03:16
SerializableHttpCookie
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.HttpCookie;
public class SerializableHttpCookie implements Serializable {
private static final long serialVersionUID = 6374381323722046732L;
private transient final HttpCookie cookie;
@leeyc09
leeyc09 / PersistentCookieStore.java
Created February 5, 2016 03:14
okhttp3 save Cookie
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
public static class RecyclerViewOnItemClickListener extends RecyclerView.SimpleOnItemTouchListener {
private OnItemClickListener mListener;
private GestureDetector mGestureDetector;
public RecyclerViewOnItemClickListener(Context context, final RecyclerView recyclerView, OnItemClickListener listener) {
this.mListener = listener;
mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onSingleTapUp(MotionEvent e) {