jq is useful to slice, filter, map and transform structured json data.
brew install jq
git pretty format options | |
------------------------- | |
- '%x20': space | |
- '%H': commit hash | |
- '%h': abbreviated commit hash | |
- '%T': tree hash | |
- '%t': abbreviated tree hash | |
- '%P': parent hashes | |
- '%p': abbreviated parent hashes | |
- '%an': author name |
# | |
# This fix should solve most of the problems with SourceKit (Not only with Swift, also with Obj-C). Such as: | |
# - Not having autocompletion | |
# - False errors | |
# | |
# This is just a temporal fix. The problem could eventually return. | |
# If that happens, just re-run this file | |
# | |
# The implementation comes from an answer in stackoverflow, which helped me a lot. | |
# |
#color utilities | |
Y="\033[1;33m" | |
R="\033[0;31m" | |
G="\033[0;32m" | |
B="\033[0;34m" | |
NC="\033[0m" | |
# handy functions | |
usage() { echo "Usage: ci_tag [-t <tf1|tf2|release>] [-m <release note>]" 1>&2;} |
#clean up cruft on the desktop. | |
Y="\033[1;33m" | |
R="\033[0;31m" | |
G="\033[0;32m" | |
B="\033[0;34m" | |
NC="\033[0m" | |
echo "${G}Cleaning up image cruft:${R}" |
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
Convert .mov/.MP4 to .gif
As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.
This is not limited to developer, anyone has this need can use this method to convert the files.
extension String { | |
func snakeCased() -> String? { | |
let pattern = "([a-z0-9])([A-Z])" | |
let regex = try? NSRegularExpression(pattern: pattern, options: []) | |
let range = NSRange(location: 0, length: count) | |
return regex?.stringByReplacingMatches(in: self, options: [], range: range, withTemplate: "$1_$2").lowercased() | |
} | |
} |