Skip to content

Instantly share code, notes, and snippets.

View therne's full-sized avatar
๐ŸŽฏ
Focusing

Jun Kim therne

๐ŸŽฏ
Focusing
View GitHub Profile
@therne
therne / ISP.java
Last active August 29, 2015 14:21
SOLID : Interface Segregation Principle Example
/**
* ClientDataReceiver
* ํด๋ผ์ด์–ธํŠธ๋กœ๋ถ€ํ„ฐ ๋ฐ์ดํ„ฐ๊ฐ€ ์ˆ˜์‹ ๋  ๋•Œ ํ˜ธ์ถœ๋˜๋Š” ๋ฆฌ์‹œ๋ฒ„์ด๋‹ค.
*/
interface ClientDataReceiver {
public void onLoginDataReceive(User user);
public void onGamePlayDataReceive(PlayData data);
}
/**
/**
* Glide (์ด๋ฏธ์ง€ ๋กœ๋”ฉ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ)๋ฅผ ์ดˆ๊ธฐํ™”ํ•œ๋‹ค.
*/
void initGlide() {
Glide.setup(new GlideBuilder(this)
.setDiskCache(DiskLruCacheWrapper.get(Glide.getPhotoCacheDir(this), DISK_CACHE_SIZE))
.setDecodeFormat(DecodeFormat.PREFER_RGB_565)
);
Glide.get(this).register(GlideUrl.class, InputStream.class,
new OkHttpUrlLoader.Factory(new OkHttpClient()));
@therne
therne / Starter.java
Created January 31, 2015 09:10
The super, gorgeous and compatible Entrypoint class for Vert.x Gradle
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
/**
* Starter - Entry point of the Vert.x gradle module.
* @author vista
@therne
therne / gist:9013755
Created February 15, 2014 02:35
Rubbish XML Data...
<xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<!-- This is an title area -->
<LinearLayout android:layout_width="match_parent" android:layout_height="48dp" android:orientation="horizontal">
<TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center"
android:text="Google" android:textSize="18sp" android:textColor="#FFFFFF"
android:layout_marginLeft="8dp" android:layout_marginRight="16dp" />
<EditText android:layout_width="match_parent" android:layout_height="match_parent"
android:id="@+id/searchField" android:hint="Search Google" android:layout_weight="1.0" />
@therne
therne / README.md
Last active December 30, 2015 22:49
Clutch API Documentation

Clutch Application Server

ํด๋Ÿฌ์น˜ ์„œ๋น„์Šค์˜ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„œ๋ฒ„์ด๋‹ค.

์„œ๋ฒ„ ์–ธ์–ด๋กœ๋Š” Node.js๋ฅผ ์‚ฌ์šฉํ•˜๋ฉฐ, ExpressJs ๋ฐ ejs๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ API์™€ ์›น ๋ฐฑ์—”๋“œ๋ฅผ ๊ตฌ์ถ•ํ•œ๋‹ค. ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์—”์ง„์œผ๋กœ๋Š” MongoDB, ๋“œ๋ผ์ด๋ฒ„๋กœ๋Š” mongoose๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.

ํด๋ผ์ด์–ธํŠธ๋‹จ์—์„œ ์„œ๋ฒ„๋กœ์˜ ๋ชจ๋“  ํ˜ธ์ถœ์€ ๋น„๋™๊ธฐ์‹์œผ๋กœ ์ด๋ฃจ์–ด์ง€๋ฉฐ(Asynchronize), ์„œ๋ฒ„๋Š” ๊ทธ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•ด JSON ํ˜•ํƒœ์˜ ๊ฒฐ๊ณผ๊ฐ’์„ HTTP ์‘๋‹ต ํ˜•ํƒœ(application/json)๋กœ ๋ฐ˜ํ™˜ํ•œ๋‹ค.

@therne
therne / gist:6177138
Last active December 20, 2015 18:39
MoonlightDriver API Documentation

Codename 'MoonlightDriver' REST API Documentation


1. Summary

๋ฉ”์ธ์„œ๋ฒ„๋Š” Google Web Toolkit (GWT)์„ ์‚ฌ์šฉํ•˜๋ฉฐ, Java EE๋กœ ์ž‘์„ฑ๋˜์—ˆ๋‹ค. ๋ฉ”์ธ์„œ๋ฒ„์— ๋ถ€์†๋œ ํ‘ธ์‹œ์„œ๋ฒ„๋Š” Google Cloud Messaging(GCM) ๊ธฐ์ˆ ์„ ์‚ฌ์šฉํ•˜๋ฉฐ, PHP๋กœ ์ž‘์„ฑ๋˜์—ˆ๋‹ค.

ํด๋ผ์ด์–ธํŠธ๋‹จ์—์„œ ์„œ๋ฒ„๋กœ์˜ ๋ชจ๋“  ํ˜ธ์ถœ์€ ๋น„๋™๊ธฐ์‹์œผ๋กœ ์ด๋ฃจ์–ด์ง€๋ฉฐ(Asynchronize), ์„œ๋ฒ„๋‹จ์—์„œ ์„œ๋ธ”๋ฆฟ์€ ๊ทธ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•ด JSON ํ˜•ํƒœ์˜ ๊ฒฐ๊ณผ๊ฐ’์„ HTTP Response๋กœ ๋ฐ˜ํ™˜ํ•œ๋‹ค.