Cheat sheet for programmers or "we google for you"

Introduction, which can not read

A modern programmer, and even more so a beginner at a level lower than junior, hell, needs the ability to use a search engine. It seems there is nothing difficult in this, but nevertheless questions often pop up on questionnaires, which have long been answered in the first tab of the search engine output. Why is that? Inexperience, laziness - a lot of reasons. We are interested in laziness, let's simplify a little and automate the process of “googling”.

Actually, the essence

So, I present to you the service " ". It is written in Python, so that Pythonists may be interested. There are several implementations of it:

  • Through "curl" on the command line;
  • Through the browser.
  • Through code editors: Emacs, Vim, Sublime Text, VSCode.

How to use

Using "curl"

Here you need to have the utility "curl". On Linux distributions, it already exists; for Windows, it needs to be installed separately. I had no problems with Windows.

Go to the console and send a request of this type:
Get the answer:

$ curl
#  How to read a text file into a list or an array with Python ...##  You will have to split your string into a list of values using split()##  So,
lines =',')
#  [Achrome] [so/q/14676265] [cc by-sa 3.0]

Initially, the utility was conceived as a cheat sheet for commands for the Linux terminal, so you can look for help on them:

$  curl
$  curl
$  curl
$  curl

You can also install the console utility:

$   curl > ~/bin/
$   chmod +x ~/bin/

Use example here .
There are no such commands for Windows, so there is an option to use Cygwin, Git bash and so on.
At your peril.

Using a browser

Just go to the desired link in the browser.


A link can be sent as a response to Stackoverflow, for example.

Using code editors

What for? In order not to leave the editor get a copy-paste solution code.

Plugin for Emacs ,
Plugin for Sublime Text ,
Plugin for Vim ,
Plugin for VSCode .


Tab auto-complement

Installation for bash:

    $ curl > ~/.bash.d/
    $ . ~/.bash.d/
    $ # and add . ~/.bash.d/ to ~/.bashrc

Installation for ZSH:

    $ curl > ~/.zsh.d/_cht
    $ echo'fpath=(~/.zsh.d/ $fpath)' >> ~/.zshrc
    $ # Open a new shell to load the plugin

Response parameters

If you do not need syntax highlighting in the answer:

If you need only code without comments:

You can combine this:

Stealth mode

Open the client version with the parameter "--shell" and use:
$ --shell [язык программирования]
$ stealth [параметры]
Why? To quickly get an answer. The author proposes to use this in remote interviews. It's just a matter of your own conscience.

One-line solutions


There is even for Python. Yes, for a language where the separation of blocks of code is a newline.

Oddities of programming languages


View another answer

If you are not satisfied with the current response to your request, you can see another:
curl[язык]/[запрос]/[номер ответа]

And what, with the help of one utility you can learn the basics of the language?

$ curl[язык]/:learn


In general, everything. Maybe someone already knows about “” and uses it, but I did not find any normal materials about it in Russian. On GitHub there is a table of completeness “” by languages, links to plug-ins for editors, and a complete guide if someone doesn’t like mine. Thanks for reading.

Also popular now: