Skip to content

Instantly share code, notes, and snippets.

View kyungkoo's full-sized avatar
:octocat:
work?!

kyungkoo kyungkoo

:octocat:
work?!
View GitHub Profile
@kyungkoo
kyungkoo / universal-framework.sh
Created May 25, 2021 04:29 — forked from cromandini/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
import unittest
class Ch2Test(unittest.TestCase):
# range 정의는 https://docs.python.org/3/library/functions.html#func-range 참고
def test_ragne(self):
# 1 ~ 4
wrong = [n for n in range(1, 4)]
self.assertEqual(3, len(wrong))
@kyungkoo
kyungkoo / python-type-test.py
Last active April 3, 2021 07:24
python type check tests
# execute: python -m unittest python-type-test.py
import unittest
class TestDefaultTypes(unittest.TestCase):
def test_is_bool(self):
# True or False
is_korean: bool = True
self.assertTrue(type(is_korean) is bool)
@kyungkoo
kyungkoo / build.gradle
Created December 1, 2016 04:18
Kotlin gradle build script
buildscript {
ext.kotlin_version = '1.0.5-2'
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@kyungkoo
kyungkoo / Podfile
Last active November 8, 2016 11:30
react-native-linear-gradient Podfile Setting
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# change AwesomeProject to your target name.
target 'AwesomeProject' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# React is deprecated. so change path.
pod 'React', :path => '../node_modules/react-native'
@kyungkoo
kyungkoo / Base64.md
Created April 14, 2016 06:59 — forked from JeOam/Base64.md
Converting between Image and Base64 string in iOS

EDIT : In iOS7, you can use NSData's base64EncodedStringWithOptions

Now encode as:

- (NSString *)encodeToBase64String:(UIImage *)image {
 return [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn];
}

Decode as:

그동안 놓쳐왔던 리엑티브 프로그래밍에 대한 소개

(by @andrestaltz, translated by @devthewild)

그래서 이제 (함수형) 리엑티브 프로그래밍(FRP, Functional Reactive Programming)라는 새로운 것을 배워보고 싶겠지.

배우는 것은 어렵고 좋은 교재가 없어서 더 어렵다. 내가 배웠을 때는, 튜토리얼을 찾으려고 해봤다. 간단하거나 실전 가이드 정도만 있었고, 그냥 겉핥기식이었지 어떻게 아키텍쳐 전체를 다루는지에 대한 시도조차 없었다. 라이브러리 문서조차 함수들을 전부 이해하기는 어려웠다. 내 말은, 솔직히, 그냥 이걸 봐라.

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

관찰가능한(observable) 시퀀스의 각 엘리먼트들을 관찰가능한 시퀀스들의 새로은 시퀀스들에 그 엘리먼트의 인덱스와 결합해서 투사하고 나서,

/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
import android.util.Log;
import com.squareup.leakcanary.AnalysisResult;
import com.squareup.leakcanary.DisplayLeakService;
import com.squareup.leakcanary.HeapDump;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.http.Multipart;
import retrofit.http.POST;
import retrofit.http.Part;
import retrofit.mime.TypedFile;
- (BOOL)stringContainsEmoji:(NSString *)string {
__block BOOL returnValue = NO;
[string enumerateSubstringsInRange:NSMakeRange(0, [string length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock:
^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
const unichar hs = [substring characterAtIndex:0];
// surrogate pair
if (0xd800 <= hs && hs <= 0xdbff) {
if (substring.length > 1) {
const unichar ls = [substring characterAtIndex:1];