Cheatography
https://cheatography.com
for rapid access to nose parameters, selenium and python search methods and other stuff like jenkins URL coomands
This is a draft cheat sheet. It is a work in progress and is not finished yet.
|
|
Ruby Math
Command |
Description |
Exponentiation (**) |
Exponentiation raises one number (the base) to the power of the other (the exponent). For example, 23 is 8, since23 means "give me 2 2 2" (2 multiplied together 3 times). |
Modulo (%) |
Modulo returns the remainder of division. For example, 25 % 7 would be4, since 7 goes into 25 3 times with 4 left over. |
Ruby Miscelaneous
Command |
Description |
puts & print |
Puts prints but adds a new line at the end |
=begin multiline comments =end
|
no space between the = and the keyword, they need to be on a line by themselves |
|
Is the Ruby method that gets input from the user. When getting input, Ruby automatically adds a blank line after each bit of input. |
|
removes extra blank lines |
|
It modifies the variable in itself, example: instead of doing print "This is my question?" answer = gets.chomp answer2 = answer.capitalize print = answer2 you can use print "This is my question?" answer = gets.chomp answer.capitalize! print answer
|
Ruby String methods
Command |
Description |
|
returns the length of a string |
|
returns the string backwards |
|
returns the same string all in caps |
|
returns the same string all in lowercased |
|
returns the string with just the first letter in caps and the rest on lowercase |
string interpolation |
first_name = "Kevin" puts "Your name is #{first_name}!" #=> Your name is Kevin
|
|