Skip to content

Instantly share code, notes, and snippets.

View doyonghoon's full-sized avatar

Yong Hoon Do doyonghoon

View GitHub Profile
private static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
@doyonghoon
doyonghoon / gist:9431756
Created March 8, 2014 14:57
초성검색
/**
* 초성 검색 알고리즘을 위한 클래스 이다.
* @author roter
*
*/
public class SoundSearcher
{
private static final char HANGUL_BEGIN_UNICODE = 44032; // 가
private static final char HANGUL_LAST_UNICODE = 55203; // 힣
private static final char HANGUL_BASE_UNIT = 588;//각자음 마다 가지는 글자수
@doyonghoon
doyonghoon / gist:6739509
Last active December 24, 2015 03:49
compare AFNetworking data-receive part
// Watcha's connection:
- (void)connection:(NSURLConnection __unused *)connection
didReceiveData:(NSData *)data
{
self.totalBytesRead += [data length];
if ([self.outputStream hasSpaceAvailable]) {
const uint8_t *dataBuffer = (uint8_t *) [data bytes];
[self.outputStream write:&dataBuffer[0] maxLength:[data length]];
}