Syntax Reminders: cheat

Golden bell

How many times have you racked your brain to try to remember some long lost fragment of syntax? You’ve got ‘man’ and ‘gem server’ to crank up at the console, but no, they’re just not immediate enough; they kinda stop you in mid flow. What you could do with, at times like that, is the equivalent of the person offstage at the theatre who prompts the actors when they forget their lines.

As if by magic, the consistently creative err.the_blog guys have read your mind. They have fashioned a commandline-driven cheat sheet utility, appropriately named cheat.

Just install in the time-honoured fashion -

sudo gem install cheat

Then take her for a spin. I’m always forgetting some Textile snippet or other -

chrisduncan:~$cheat textile
textile:
  Quick block modifiers:
    Header: hn.
    Blockquote: bq.
    Footnote: fnn.
    Numeric list: #
    Bulleted list: *
  
  Quick phrase modifiers:
    _emphasis_
    *strong*
    ??citation??
    -deleted text-
    +inserted text+
    ^superscript^
    ~subscript~
    %span%
  
  To apply attributes:
    (class)
    (#id)
    {style}
    [language]
  
  To align blocks:
    < right
    > left
    = center
    <> justify
  
  To insert a table:
    |a|table|row|
    |a|table|row|
  
  To insert a link:
    "linktext":url
  
  To insert an image:
    !imageurl!
  
  To define an acronym:
    ABC(Always Be Closing)
  
  To reference a footnote:
    [n]

Of course, if there isn’t a cheat sheet for your particular missing nugget of knowledge, you can always do some research elsewhere and manufacture a sheet for future use.

My advice to you is: if in doubt, cheat.

Permalink | comments(View)

blog comments powered by Disqus