Skip to content

Instantly share code, notes, and snippets.

View AppleCEO's full-sized avatar
💻

사이먼 AppleCEO

💻
View GitHub Profile
@AppleCEO
AppleCEO / Parse JWT.m
Created October 29, 2020 11:24 — forked from AlexHedley/Parse JWT.m
Parse a JWT - JSON Web Token
//DECODE JSON WEB TOKEN (JWT) IN IOS (OBJECTIVE-C)
//http://popdevelop.com/2013/12/decode-json-web-token-jwt-in-ios-objective-c/
NSString *jwt = @"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIifQ.bVhBeMrW5g33Vi4FLSLn7aqcmAiupmmw-AY17YxCYLI";
NSArray *segments = [jwt componentsSeparatedByString:@"."];
NSString *base64String = [segments objectAtIndex: 1];
NSLog(@"%@", base64String);
// => "eyJmb28iOiJiYXIifQ"
@AppleCEO
AppleCEO / ViewController.swift
Created March 3, 2020 07:12 — forked from goodmorningcody/ViewController.swift
스위프트 : 위치정보 사용 권한에 따른 예외처리 추가하기
import UIKit
import CoreLocation
class ViewController: UIViewController, CLLocationManagerDelegate {
// 중략
@IBOutlet var requestWeatherButton : UIButton!
override func viewDidAppear(animated: Bool) {
class ParentViewController: UIViewController {
let button: UIButton()
...
func onTapButton() {
let popupVC = PopupViewController()
popupVC.onDoneBlock = { [weak self] in
self?.moveToNextView()
}
}
@AppleCEO
AppleCEO / APDynamicHeaderTableViewController.swift
Created December 31, 2019 06:29 — forked from johndpope/APDynamicHeaderTableViewController.swift
UICollectionView + Snapkit + APDynamicHeaderTableViewController mash up // no autolayout constraint code.
import Foundation
import UIKit
import Dotzu
import SnapKit
class APDynamicHeaderTableViewController : UIViewController {
var largeWideSize = CGSize(width: UIScreen.main.bounds.width , height: 285 )
let headerView = APDynamicHeaderView ()
@AppleCEO
AppleCEO / sync-http.swift
Created September 1, 2019 14:38 — forked from groz/sync-http.swift
Synchronous http request in Swift
import Foundation
func query(address: String) -> String {
let url = URL(string: address)
let semaphore = DispatchSemaphore(value: 0)
var result: String = ""
let task = URLSession.shared.dataTask(with: url!) {(data, response, error) in
result = String(data: data!, encoding: String.Encoding.utf8)!
@AppleCEO
AppleCEO / gist:46a247fe289dc812ab49ed12507d6919
Created August 27, 2019 07:08 — forked from 480/gist:4681b67d2a906db8c6c1321cc678f05f
github 리모트 리포지토리 변경하기

깃 리모트 변경 하기

기존 리포지토리 깔끔하게 pull / push

git pull
git add .
git commit -m "clean push"
git push
@AppleCEO
AppleCEO / monad-in-java.md
Created July 21, 2019 14:19 — forked from jooyunghan/monad-in-java.md
한글번역 - Functor and monad examples in plain Java

Functor and monad examples in plain Java

이 글은 우리가 쓴 책, 'Reactive Programming with RxJava' 의 부록이었다. Reactive programming과 관련이 깊은 주제긴 하지만 모나드를 소개한다는 게 책과 썩 어울리지는 않았다. 그래서 나는 따로 블로그에 올리기로 했다. 프로그래밍을 다루는 블로그에서 *"반은 맞고 반은 틀릴 지 모르는 나만의 모나드 설명"*이란 것이 새로운 *"Hello World"*라는 점을 나도 잘 안다. 하지만 이 글은 펑터(functor)와 모나드(monad)를 자바 자료 구조와 라이브러리라는 각도에서 바라보고 있으며, 이는 공유할 정도의 가치는 있을거라 생각했다.

[공통] 마크다운 markdown 작성법

1. 마크다운에 관하여

1.1. 마크다운이란?

Markdown은 텍스트 기반의 마크업언어로 2004년 존그루버에 의해 만들어졌으며 쉽게 쓰고 읽을 수 있으며 HTML로 변환이 가능하다. 특수기호와 문자를 이용한 매우 간단한 구조의 문법을 사용하여 웹에서도 보다 빠르게 컨텐츠를 작성하고 보다 직관적으로 인식할 수 있다. 마크다운이 최근 각광받기 시작한 이유는 깃헙(https://github.com) 덕분이다. 깃헙의 저장소Repository에 관한 정보를 기록하는 README.md는 깃헙을 사용하는 사람이라면 누구나 가장 먼저 접하게 되는 마크다운 문서였다. 마크다운을 통해서 설치방법, 소스코드 설명, 이슈 등을 간단하게 기록하고 가독성을 높일 수 있다는 강점이 부각되면서 점점 여러 곳으로 퍼져가게 된다.

1.2. 마크다운의 장-단점

1.2.1. 장점

@AppleCEO
AppleCEO / main.swift
Created April 2, 2019 05:59 — forked from hwj0623/main.swift
04/02 pair programming of UnitConverter
//
// main.swift
// UnitConverter
//
// Created by Doran & Dominic on 02/04/2019.
// Copyright © 2019 hw. All rights reserved.
//
import Foundation