Skip to content

Instantly share code, notes, and snippets.

View dev-yong's full-sized avatar
๐Ÿค”
Let's think more

LeeGwangYong dev-yong

๐Ÿค”
Let's think more
  • Viva Republica (TOSS)
  • Korea, Republic of
View GitHub Profile
find . -type f '(' -name '*.storyboard' -o -name '*.xib' -o -name '*.swift' ')' -exec sed -E -i '' 's/[Find]/[Replaced]/g' {} +
class ViewController: UIViewController {
let targetView = UIView(frame: .init(x: 50, y: 150, width: 50, height: 50))
let slider = UISlider(frame: .init(x: 0, y: 100, width: 300, height: 30))
var animator: UIViewPropertyAnimator?
var displayLink: CADisplayLink?
var token: NSKeyValueObservation?
override func loadView() {
import Foundation
import Alamofire
private extension Date {
static func second(from referenceDate: Date) -> Int {
return Int(Date().timeIntervalSince(referenceDate).rounded())
}
}
public class Throttler {
public class DynamicHeightTableView: UITableView {
public var maxHeight: CGFloat = UIScreen.main.bounds.height
override public var contentSize: CGSize {
didSet {
self.invalidateIntrinsicContentSize()
}
}
override public func reloadData() {
// Created by ์ด๊ด‘์šฉ on 2018. 7. 3..
// Copyright ยฉ 2018๋…„ ์ด๊ด‘์šฉ. All rights reserved.
//
import UIKit
typealias KeyboardInfo = (CGRect, TimeInterval)->()
protocol KeyboardControlDelegate: class {
func setKyeboardControl(willShow: KeyboardInfo?, willHide: KeyboardInfo?)
func removeKeyboardControl()
@dev-yong
dev-yong / topological_sort.cpp
Created April 1, 2017 10:33
์œ„์ƒ์ •๋ ฌ
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
vector<vector<int>> singer_vector;
stack <int> result;
bool visited[1001] = { false };
bool finish[1001] = { false };
bool cycle = false;
@dev-yong
dev-yong / BFS,DFS(vector).cpp
Created March 14, 2017 13:16
vector๋ฅผ ์ด์šฉํ•œ BFS,DFS
#include<iostream>
#include<algorithm> //sort ํ•จ์ˆ˜๋ฅผ ์ถœ๋ ฅํ•˜๊ธฐ ์œ„ํ•œ ํ—ค๋”
#include<vector>
#include<queue>
using namespace std;
int n, m, v; //n : vertex(์ •์ )์˜ ๊ฐœ์ˆ˜, m : edge(๊ฐ„์„ )์˜ ๊ฐœ์ˆ˜, v : ์ •์ ์˜ ๋ฒˆํ˜ธ
vector<vector<int>> adj; //vector-vector๋ฅผ ์„ ์–ธ
vector<bool> visited; //node์˜ ๋ฐฉ๋ฌธ ์—ฌ๋ถ€์— ๋Œ€ํ•œ ํ•จ์ˆ˜
@dev-yong
dev-yong / BFS,DFS.CPP
Created March 14, 2017 13:15
graph์˜ ํ–‰๋ ฌ ์ƒ์„ฑ, BFS, DFS
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
using namespace std;
int arr[1020][1020];
bool visited[1020];
int vertex_num, edge_num;
#include <iostream>
#include <algorithm>
using namespace std;
int chess_size;
int map[11][11];
int max_black = 0, max_white = 0;
bool slash[22];
bool back_slash[22];
void black(int y, int x, int cnt) {