Random stuff: Adjust viewport

Mozilla: adjust viewport and scale More cool stuff – this is a tiny fraction of the research I do on a typical day: Split a string literal across multiple lines device-width usage suggestions User-Agent in UIWebView: SO question change User-Agent in Google Chrome what’s my user agent? changing the headers using method swizzling (not recommended)…Continue Reading…

UIWebView usage

Injecting JavaScript functions into a UIWebView Control zooming with JavaScript Retina web clip icons – I need to use these in my new app! I can use my new app to highlight websites that have Retina web clip icons. These apps are likely to provide a good experience on the iPad. HockeyApp – Better beta distribution….Continue Reading…

UITextField vertical alignment

myTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; myTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentTop; myTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom; myTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentFill; Source

rename a git branch

rename a git branch: git branch -m old_branch new_branch use -M to overwrite an existing branch commit only part of a file in git using git blame URL Encode NSString in Objective-C: NSString* escapedUrlString = [unescapedString stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding]; but I used NSUTF8StringEncoding instead. git: who wrote the most code? – lines changed by one author git…Continue Reading…

Automatically remove untracked files in git

Use git clean. -f : force. if clean.requireForce is true, nothing will actually happen (in recent-enough versions of git) -d : remove directories too -X : remove ignored files (according to .gitignore) (note uppercase X) -x : remove ignored and non-ignored files (note lowercase x) via StackOverflow

Squashing commits with rebase

Squashing commits with rebase is wonderful for creating a clean commit history. When using Gerrit, be sure to use Change-Ids to ensure that change revisions appear as new patch sets, not new changes. UITextChecker can probably be used to do some cool word-suggestion stuff. Renaming a branch with git is easy: git branch -m old_branch…Continue Reading…