Skip to content

Instantly share code, notes, and snippets.

KBvsMJ / UIDevice+Ext.swift
Created Aug 31, 2020 — forked from SergLam/UIDevice+Ext.swift
Detect iOS device model
View UIDevice+Ext.swift
public extension UIDevice {
enum DeviceModelName: String {
case undefined
case iPodTouch5
case iPodTouch6
case iPhone4
case iPhone4s
case iPhone5
View CodeTextField.swift
import UIKit
class CodeTextField: UITextField, UITextFieldDelegate {
let codeLength: Int
var characterSize: CGSize
var characterSpacing: CGFloat
let textPreprocess: (String) -> String
let validCharacterSet: CharacterSet
View SRCopyableLabel.swift
// SRCopyableLabel.swift
// Created by Stephen Radford on 08/09/2015.
// Copyright (c) 2015 Cocoon Development Ltd. All rights reserved.
import UIKit
class SRCopyableLabel: UILabel {
KBvsMJ /
Created Sep 14, 2018 — forked from yisibl/
如何创建 Git 公钥


  1. 首先启动一个Git Bash窗口(非Windows用户直接打开终端)

  2. 执行:

    cd ~/.ssh

    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!

KBvsMJ / index.ios.js
Last active Aug 18, 2016 — forked from Jpoliachik/index.ios.js
ReactNative LayoutAnimation
View index.ios.js
'use strict';
import React, {
} from 'react-native';
View WhyRSS
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<title>Subscriptions - WHY</title>
<outline text="cool" title="cool">
<outline htmlUrl="" title="kedebug" xmlUrl="" type="rss" text="kedebug"/>
<outline htmlUrl="" title="Lucida" xmlUrl="" type="rss" text="Lucida"/>
<outline htmlUrl="" title="Web前端 腾讯AlloyTeam Blog | 愿景: 成为地球卓越的Web团队!" xmlUrl="" type="rss" text="Web前端 腾讯AlloyTeam Blog | 愿景: 成为地球卓越的Web团队!"/>
KBvsMJ /
Created Nov 25, 2015
Creating a timer with Grand Central Dispatch

##Creating a timer with Grand Central Dispatch

At the following is the implementation file of a sample class that shows, how to make a timer with the help of Grand Central Dispatch. The timer fires on a global queue, just change the queue to the main queue or any custom queue and the timer fires on this queue and not on the global queue anymore.

#import <Foundation/Foundation.h>

@interface SampleClass : NSObject
- (void)startTimer;
KBvsMJ /
Created Oct 10, 2015 — forked from sekati/
Xcode Auto-increment Build & Version Numbers
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
You can’t perform that action at this time.