Skip to content

Instantly share code, notes, and snippets.

View cozzin's full-sized avatar
🎯
Focusing

SeongHo Hong cozzin

🎯
Focusing
View GitHub Profile
@cozzin
cozzin / ViewControllerBasedOnKeyboard.h
Last active January 11, 2017 07:41
change view based on keyboard height
@property CGFloat currentKeyboardHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *btnBottomConstraint;
@cozzin
cozzin / BarcodeGenerator.java
Last active March 21, 2017 02:13
Using ZXing library in Android Studio
package com.dotincorp.android.util;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.AsyncTask;
import android.util.Log;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.common.BitMatrix;
@cozzin
cozzin / appDelegate.m
Created January 29, 2018 04:34
iOS Local Push
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
// push received
}
@cozzin
cozzin / AddProjectToGithub
Last active March 11, 2018 12:18
Adding an existing project to GitHub using the command line
git init
git add .
git commit -m "First commit"
git remote add origin 원격_저장소_URL
git remote -v
git push -u origin master
@cozzin
cozzin / ProtocolGetAndSet.swift
Created March 15, 2018 07:11
Undetstanding about getter and setter of protocol
// https://teamtreehouse.com/community/i-dont-understand-get-and-get-set
protocol TestProtocol {
var testVar: Int { get }
}
class TestClass: TestProtocol {
var testVar: Int = 0
}
@cozzin
cozzin / setting python on centOS7
Last active April 1, 2018 09:20
python 기본 세팅하기
# https://janikarhunen.fi/how-to-install-python-3-6-1-on-centos-7.html
# Install the necessary utilities
sudo yum update
sudo yum install yum-utils
sudo yum groupinstall development
sudo yum install https://centos7.iuscommunity.org/ius-release.rpm
sudo yum install python36u
sudo yum install python36u-pip
extension UITableView {
func reloadDataAndKeepOffset() {
let offset = contentOffset
reloadData()
layoutIfNeeded()
setContentOffset(offset, animated: false)
}
}
func formatByteCount(bytes: Int64) -> String {
let byteCountFormatter = ByteCountFormatter()
return byteCountFormatter.string(fromByteCount: bytes)
}
@objc protocol AAA {
}
extension AAA {
var aa: Int {
return 0
}
}