val user = User(id = "id", name = "Ruby")
val userFragment: UserFragment = newFragment<User, UserFragment>(user)I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
| // status bar height | |
| int statusBarHeight = 0; | |
| int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
| if (resourceId > 0) { | |
| statusBarHeight = getResources().getDimensionPixelSize(resourceId); | |
| } | |
| // action bar height | |
| int actionBarHeight = 0; | |
| final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes( |
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (
xcode-select --installwill prompt up a dialog) - Java
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Prereq:
apt-get install zsh
apt-get install git-coreGetting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

