- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
#!/usr/bin/python | |
import requests | |
import subprocess | |
import time, signal, logging | |
import os | |
logging.basicConfig(level=logging.INFO) | |
cur_dir = os.path.dirname(os.path.abspath(__file__)) | |
nodebb_path = os.path.join(cur_dir, 'nodebb') |
/* Отркойте | |
* https://ru.wikipedia.org/wiki/Список_районов_и_муниципальных_образований_Москвы | |
* и вставте код в отладочную консоль браузера (chrome, opera или firefox) | |
*/ | |
var areas = []; | |
$('table>tbody>tr>td:nth-child(2)>a').each(function(index){ | |
areas.push($(this).text().toLowerCase().split(' ').join('').split('-').join('')); | |
}); | |
console.log(areas); |
var items = []; | |
$('.history-table>ul>li>.td-likes').each(function(item) { | |
// clean spaces | |
var itemText = $(this).text().replace(/\s+/g, ' '); | |
itemText = itemText.replace(/^0\s$/g, '').split(/\s/g,2); | |
var num = parseInt(itemText); | |
if (num && !isNaN(num)) | |
items.push(num); | |
}); |
##### Перемещение курсора: | |
Ctrl + a — переход в начало строки | |
Ctrl + b — переход на 1 символ назад | |
Ctrl + c — посылает программе SIGINT. Обычно, прерывает текущее задание | |
Ctrl + d — удаляет символ под курсором (аналог delete) | |
Ctrl + e — переход к концу строки | |
Ctrl + f — переход на 1 символ вперёд | |
Ctrl + xx — переходит от текущей позиции курса в начало строки и обратно. | |
Ctrl + p — Предыдущая команда (Стрелка вверх) |
#!/bin/bash | |
# Copy this script to /usr/local/bin or to any bin folder you like. Make executable and use it. | |
# cp bashkeys.sh /usr/local/bin | |
# cmod 755 /usr/local/bin/bashkeys.sh | |
# bashkeys.sh | |
echo ' | |
Bash Keyboard Shortcuts | |
Moving the cursor: |
Bash Keyboard Shortcuts | |
Moving the cursor: | |
Ctrl + a Go to the beginning of the line (Home) | |
Ctrl + e Go to the End of the line (End) | |
Ctrl + p Previous command (Up arrow) | |
Ctrl + n Next command (Down arrow) | |
Alt + b Back (left) one word | |
Alt + f Forward (right) one word |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
// factorials | |
function factorial(n) { | |
if ( n == 0 ) return 1; | |
return n * factorial( n - 1 ); | |
} | |
// triangle numbers | |
function triangle(n) { | |
if ( n == 1 ) return 1; | |
return n + triangle(n-1); | |
} |