Open onerandomusername opened 1 year ago
What about some code in a list? That's insane, right?
In Ruby you can map like this:
['a', 'b'].map { |x| x.uppercase }
In Rails, you can do a shortcut:
['a', 'b'].map(&:uppercase)
Some people seem to like definition lists
What the hell is going on
What the hell is going on
what the h is going on*
GitHub Flavored Markdown
View the source of this content.
Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:
Roses are red Violets are blue
The next paragraph has the same phrases, but now they are separated by two spaces and a newline character:
Roses are red
Violets are blue
Oh, and one thing I cannot stand is the mangling of words with multiple underscores in them like perform_complicated_task or do_this_and_do_that_and_another_thing.
A bit of the GitHub spice
In addition to the changes in the previous section, certain references are auto-linked:
These are dangerous goodies though, and we need to make sure email addresses don't get mangled:
My email addy is tom@github.com.
Math is hard, let's go shopping
In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7.
Triangles man! a^2 + b^2 = c^2 We all like making lists
The above header should be an H2 tag. Now, for a list of fruits:
This is a nested list:
Level 1
Level 1.1 Another line, it's also very very very very very very very very very very long.
Another line with two newlines before.
Let's get crazy:
This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.
What about some code in a list? That's insane, right?
In Ruby you can map like this:
In Rails, you can do a shortcut:
Some people seem to like definition lists
I am a robot
Maybe you want to print
robot
to the console 1000 times. Why not?You see, that was formatted as code because it's been indented by four spaces.
How about we throw some angle braces and ampersands in there?
Set in stone
Preformatted blocks are useful for ASCII art:
Playing the blame game
If you need to blame someone, the best way to do so is by quoting them:
Or perhaps someone a little less eloquent:
Table for two
Crazy linking action
I get 10 times more traffic from Google than from Yahoo or MSN.