Tutorial by Examples: e

To turn on the vim spell checker run :set spell. To turn it off run :set nospell. If you always want the spell checker to be on, add set spell to your vimrc. You can turn spelling on only for certain filetypes using an auto command. Once the spell checker is on, misspelled words will be highligh...
To set the word list that vim will use for spell checking set the spelllang option. For example :set spelllang=en # set to English, usually this is the default :set spelllang=en_us # set to U.S. English :set spelllang=en_uk # set to U.K. English spellings :set spelllang=es ...
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 <...
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}' ...
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...
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.
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...
A classic use of here documents is to create a file by typing its content: cat > fruits.txt << EOF apple orange lemon EOF The here-document is the lines between the << EOF and EOF. This here document becomes the input of the cat command. The cat command simply outputs its in...
You can override 4 methods of SKScene to detect user touch class GameScene: SKScene { override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { } override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) { ...
If you need to add custom headers to your volley requests, you can't do this after initialisation, as the headers are saved in a private variable. Instead, you need to override the getHeaders() method of Request.class as such: new JsonObjectRequest(REQUEST_METHOD, REQUEST_URL, REQUEST_BODY, RESP_L...

Page 429 of 1191