This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| // | |
| // StickyHeaderFlowLayout.h | |
| // Wombat | |
| // | |
| // Created by Todd Laney on 1/9/13. | |
| // Copyright (c) 2013 ToddLa. All rights reserved. | |
| // | |
| // Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS! | |
| // |
| // this function will active menu using href match | |
| // Author: http://www.paulund.co.uk/use-jquery-to-highlight-active-menu-item | |
| function auto_active_menu() {¬ | |
| var url = window.location.href;¬ | |
| // Work for relative and absolute hrefs¬ | |
| $('.menu a').filter(function() { | |
| return this.href == url;¬ | |
| }).addClass('active');¬ | |
| } |
| static NSInteger mYStringlength = 60; | |
| - (NSString *)brief:(NSString *)text | |
| { | |
| NSRange stringRange = {0, MIN([text length], mYStringlength)}; | |
| stringRange = [text rangeOfComposedCharacterSequencesForRange:stringRange]; | |
| NSString *shortBrief = [text substringWithRange:stringRange]; | |
| NSString *firstLine =[[self.text componentsSeparatedByString: @"\n"] objectAtIndex:0]; | |
| // | |
| // UIView+JZLocalizedIB.m | |
| // | |
| // Created by haojianzong on 12/5/17. | |
| // | |
| // A Category to Set LocalizedString for Xib Files in User Define Runtime Attributes | |
| #import <UIKit/UIKit.h> | |
| #import "JZLocaleUtils.h" |
| #!/bin/sh | |
| # This script move files from an old directory into a new dirctory | |
| # using the file hierarchy from a reference directory, while preserving svn | |
| # log history. | |
| # The purpose is to organize files in one place and do 'svn mv' after | |
| # you have finished organizing. In this way you don't need to worry about other | |
| # developers commiting files while you are moving files around. |
| #!/bin/bash | |
| types=($(find . -type f -name '*.*' | sed 's|.*\.||' | sort -u)) | |
| IFS=$'\n'; | |
| for type in ${types[@]}; do | |
| sum=$(find . -type f -name "*.$type" -exec du -ch {} + | grep total$) | |
| echo "$type : $sum" | |
| done |
| import Foundation | |
| import UIKit | |
| // A small utility for NSLayoutDimension shortcuts | |
| public protocol PinObject { | |
| var topAnchor: NSLayoutYAxisAnchor { get } | |
| var bottomAnchor: NSLayoutYAxisAnchor { get } | |
| var leadingAnchor: NSLayoutXAxisAnchor { get } | |
| var trailingAnchor: NSLayoutXAxisAnchor { get } |
| // Why do you want a numeric version? Because number format is easier to use than string. | |
| // For example, you may want to write a NSPredicate for Core Data fetch for different version: | |
| // NSPredicate(format: "clientVersionNumber < %@", "2070500") // 2.7.5 | |
| // This gist assume the version digit is limitted to 4. | |
| public static var versionString: String { | |
| return (Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String) ?? "1.0" | |
| } | |
| // Only support 4 digits, invalid string will return 0, longer digits will be dropped |
| import Foundation | |
| import UIKit | |
| // Implements UITextFieldDelegate to support input features like showing thousand separator | |
| // Useful for financial App currency number input, tested for multiple localizations, copy and paste numbers into the field. | |
| // Usage: | |
| // | |
| // 1. Setup | |
| // let textField = UITextField() | |
| // let coordinator = DecimalTextFieldCoordinator(balanceTextField) |