Skip to content

Instantly share code, notes, and snippets.

View leeyc09's full-sized avatar

Youngchan leeyc09

  • jiransoft
  • S.korea
View GitHub Profile
@leeyc09
leeyc09 / OkHttp3NetworkFetcher.java
Created January 15, 2016 09:34
Fresco Network fetcher that uses OkHttp3 as a backend.
package your.package
import android.net.Uri;
import android.os.Looper;
import android.os.SystemClock;
import com.facebook.common.logging.FLog;
import com.facebook.imagepipeline.image.EncodedImage;
import com.facebook.imagepipeline.producers.BaseNetworkFetcher;
import com.facebook.imagepipeline.producers.BaseProducerContextCallbacks;
@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;
@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;
//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;
public class RestfulAdapter {
public static final int CONNECT_TIMEOUT = 15;
public static final int WRITE_TIMEOUT = 15;
public static final int READ_TIMEOUT = 15;
private static final String SERVER_URL = "https://api.server.net/"; //2부터 url뒤에 /를 입력해야 합니다.
private static OkHttpClient client;
private static sample_Interface Interface;
public synchronized static sample_Interface getInstance() {
if (Interface == null) {
@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);