Skip to content

Instantly share code, notes, and snippets.

View webfrogs's full-sized avatar

Carl Chen webfrogs

View GitHub Profile
@webfrogs
webfrogs / keybase.md
Created July 24, 2018 07:33
keybase.md

Keybase proof

I hereby claim:

  • I am webfrogs on github.
  • I am nswebfrog (https://keybase.io/nswebfrog) on keybase.
  • I have a public key ASC0IR-1W_VJwxy7D1vzx0FUYLGzHKZKQSoB7BRKcRHFqgo

To claim this, I am signing this object:

@webfrogs
webfrogs / shell.sh
Created March 30, 2017 02:55
Output swift function information whose compile time is large than 100ms
xcodebuild -workspace XXX.xcworkspace -scheme XXX clean build OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" | grep '^\d\{3,\}[.]\{1\}'
@webfrogs
webfrogs / gist:dc49f3c0991f83c2fe2a
Created April 6, 2015 07:09
letter path animation
let letters = CGPathCreateMutable()
let font = CTFontCreateWithName("Helvetica-Bold", 72, nil)
let attrs: [String: AnyObject] = [kCTFontAttributeName: font]
let attrString = NSAttributedString(string: "~", attributes: attrs)
let line = CTLineCreateWithAttributedString(attrString)
let runArray = CTLineGetGlyphRuns(line)
func p_setupTextLayer(text: String) -> CAShapeLayer {
var letters = CGPathCreateMutable()
let font = CTFontCreateWithName("Helvetica-Bold", 72, nil)
let attrs = [kCTFontAttributeName: font]
var attrString = NSAttributedString(string: text, attributes: attrs)
let line = CTLineCreateWithAttributedString(attrString)
let runArray = CTLineGetGlyphRuns(line)