Skip to content

Instantly share code, notes, and snippets.

@kb100824
kb100824 / xcode-build-bump.sh
Created October 10, 2015 08:54 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @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)
@kb100824
kb100824 / TimerWithGCD.md
Created November 25, 2015 01:44
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;
@kb100824
kb100824 / WhyRSS
Created March 25, 2016 01:25 — forked from callmewhy/WhyRSS
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Subscriptions - WHY</title>
</head>
<body>
<outline text="cool" title="cool">
<outline htmlUrl="http://kedebug.com/" title="kedebug" xmlUrl="http://kedebug.com/atom.xml" type="rss" text="kedebug"/>
<outline htmlUrl="http://lucida.me/" title="Lucida" xmlUrl="http://lucida.me/atom.xml" type="rss" text="Lucida"/>
<outline htmlUrl="http://www.alloyteam.com" title="Web前端 腾讯AlloyTeam Blog | 愿景: 成为地球卓越的Web团队!" xmlUrl="http://www.alloyteam.com/feed/" type="rss" text="Web前端 腾讯AlloyTeam Blog | 愿景: 成为地球卓越的Web团队!"/>
@kb100824
kb100824 / index.ios.js
Last active August 18, 2016 02:52 — forked from Jpoliachik/index.ios.js
ReactNative LayoutAnimation
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';
@kb100824
kb100824 / git-key.md
Created September 14, 2018 08:53 — forked from yisibl/git-key.md
如何创建 Git 公钥

如何创建公钥

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

  2. 执行:

    cd ~/.ssh

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

@kb100824
kb100824 / SRCopyableLabel.swift
Created December 24, 2018 10:11 — forked from steve228uk/SRCopyableLabel.swift
Copyable UILabel
//
// SRCopyableLabel.swift
//
// Created by Stephen Radford on 08/09/2015.
// Copyright (c) 2015 Cocoon Development Ltd. All rights reserved.
//
import UIKit
class SRCopyableLabel: UILabel {
import UIKit
class CodeTextField: UITextField, UITextFieldDelegate {
let codeLength: Int
var characterSize: CGSize
var characterSpacing: CGFloat
let textPreprocess: (String) -> String
let validCharacterSet: CharacterSet
@kb100824
kb100824 / UIDevice+Ext.swift
Created August 31, 2020 09:16 — forked from SergLam/UIDevice+Ext.swift
Detect iOS device model
public extension UIDevice {
enum DeviceModelName: String {
case undefined
case iPodTouch5
case iPodTouch6
case iPhone4
case iPhone4s
case iPhone5
@kb100824
kb100824 / swiftc_help.txt
Created March 30, 2021 10:03 — forked from enomoto/swiftc_help.txt
$ swiftc -help
OVERVIEW: Swift compiler
USAGE: swiftc [options] <inputs>
MODES:
-dump-ast Parse and type-check input file(s) and dump AST(s)
-dump-parse Parse input file(s) and dump AST(s)
-dump-scope-maps <expanded-or-list-of-line:column>
Parse and type-check input file(s) and dump the scope map(s)
-dump-type-refinement-contexts
@kb100824
kb100824 / CustomUrlProtocolRequestInterceptor.swift
Created August 26, 2022 12:33 — forked from nil-biribiri/CustomUrlProtocolRequestInterceptor.swift
CustomURLProtocol for swizzle network logging.
import Foundation
extension CustomUrlProtocolRequestInterceptor: RequestInterceptor {
public func startRecording() {
URLProtocol.registerClass(CustormUrlProtocol.self)
swizzleProtocolClasses()
}
public func stopRecording() {
URLProtocol.unregisterClass(CustormUrlProtocol.self)