Skip to content

Instantly share code, notes, and snippets.

@seedante
seedante / DrawAntiRoundedCornerImage.md
Created April 23, 2016 15:31
Draw a mask image with Core Graphics API in Swift

MaskImage

Draw a mask image like Left-3 to blend a rounded corner:

func UIGraphicsDrawAntiRoundedCornerImageWithRadius(radius: CGFloat, outerSize: CGSize, innerSize: CGSize, fillColor: UIColor) -> UIImage{  
    UIGraphicsBeginImageContextWithOptions(outerSize, false, UIScreen.mainScreen().scale)
    let currentContext = UIGraphicsGetCurrentContext()

let bezierPath = UIBezierPath()

import Foundation
extension String
{
var length: Int {
get {
return countElements(self)
}
}
@seedante
seedante / GIF-Screencast-OSX.md
Created October 21, 2015 02:29 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: