Tutorial by Examples

Simple steps to use scrollview with autolayout. Create a new project with single view application Select the default viewcontroller and change its screen size to iPhone-4inch from attributes inspector. Add a scrollview to your viewcontroller's view as follows and set background color to blue ...
Use "-x" to enable debug output of executed lines. It can be run on an entire session or script, or enabled programmatically within a script. Run a script with debug output enabled: $ bash -x myscript.sh Or $ bash --debug myscript.sh Turn on debugging within a bash script. It may ...
Whitespace matters when assigning variables. foo = 'bar' # incorrect foo= 'bar' # incorrect foo='bar' # correct The first two will result in syntax errors (or worse, executing an incorrect command). The last example will correctly set the variable $foo to the text "bar".
The C standard says that files should end with a new line, so if EOF comes at the end of a line, that line may not be missed by some commands. As an example: $ echo 'one\ntwo\nthree\c' > file.txt $ cat file.txt one two three $ while read line ; do echo "line $line" ; done <...
Every single ViewGroup (e.g. LinearLayout, RelativeLayout, CoordinatorLayout, etc.) needs to store information about its children's properties. About the way its children are being laid out in the ViewGroup. This information is stored in objects of a wrapper class ViewGroup.LayoutParams. To include...
Popular within many open source projects but not only. Master branch of a specific location (Github, Gitlab, Bitbucket, local server) contains the latest shippable version. For each new feature/bug fix/architectural change each developer creates a branch. Changes happen on that branch and can be d...
To execute a script file with the bash interpreter, the first line of a script file must indicate the absolute path to the bash executable to use: #!/bin/bash The bash path in the shebang is resolved and used only if a script is directly launch like this: ./script.sh The script must have exe...
To execute a script file with the bash executable found in the PATH environment variable by using the executable env, the first line of a script file must indicate the absolute path to the env executable with the argument bash: #!/usr/bin/env bash The env path in the shebang is resolved and used...
Exit status 0: success Exit status other than 0: failure To test on the exit status of a command: if command;then echo 'success' else echo 'failure' fi
You can do things like this: [[ $s = 'something' ]] && echo 'matched' || echo "didn't match" [[ $s == 'something' ]] && echo 'matched' || echo "didn't match" [[ $s != 'something' ]] && echo "didn't match" || echo "matched" [[ $s -eq...
Will provide the total number of records processed in the current awk instance. cat > file1 suicidesquad harley quinn joker deadshot cat > file2 avengers ironman captainamerica hulk awk '{print NR}' file1 file2 1 2 3 4 5 6 7 8 A total on 8 records were processed in th...
Provides the total number of records processed by the awk instance relative to the files awk is processing cat > file1 suicidesquad harley quinn joker deadshot cat > file2 avengers ironman captainamerica hulk awk '{print FNR}' file1 file2 1 2 3 4 1 2 3 4 Each file had...
Provides the number of columns or fields in each record (record corresponds to each line). Each line is demarcated by RS which defaults to newline. cat > file1 Harley Quinn Loves Joker Batman Loves Wonder Woman Superman is not dead Why is everything I type four fielded!? awk '{print NF}' ...
A plugin could present itself as a single file containing 30 lines of vimscript or as 20MB of vimscript/python/ruby/whatever split into many files across a dozen of directories that depends on a number of external tools. The former is obviously easy to install and manage but the latter could pause ...
Single file plugin Put the file under $HOME/.vim/plugin or $HOME/vimfiles/plugin This would source the plugin on startup of Vim. Now the user could use everything defined in it. If the plugin however needs activation, the user either has to execute the command themselves whenever they want to use...

VAM

https://github.com/MarcWeber/vim-addon-manager
Vundle is a plugin manager for Vim. Installing Vundle (Full installation details can be found in the Vundle Quick Start) Install Git and clone Vundle into ~/.vim/bundle/Vundle.vim. Configure plugins by adding the following to the top of your .vimrc, adding or removing plugins as necessar...
See :help packages.
A heredoc uses the limitstring to determine when to stop consuming input. The terminating limitstring must Be at the start of a line. Be the only text on the line Note: If you use <<- the limitstring can be prefixed with tabs \t Correct: cat <<limitstring line 1 line 2 limit...
Press controlr and type a pattern. For example, if you recently executed man 5 crontab, you can find it quickly by starting to type "crontab". The prompt will change like this: (reverse-i-search)`cr': man 5 crontab The `cr' there is the string I typed so far. This is an incremental s...

Page 485 of 1336