git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9
mv 6fb35afd237e42ef25f9 ConvertTo-Markdown
cd ConvertTo-Markdown
// origin: https://github.com/robert/wavefunction-collapse/blob/master/main.py | |
interface Direction { | |
x: number; | |
y: number; | |
} | |
const UP: Direction = {x: 0, y: 1}; | |
const DOWN: Direction = {x: 0, y: -1}; | |
const LEFT: Direction = {x: -1, y: 0}; |
Windows Registry Editor Version 5.00 | |
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS here] | |
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW64 here] | |
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW32 here] |
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
// FizzBuzz solution with one comparison: | |
// Bitwise operations, using predefined 0-15 numbers mask | |
// live demo: http://jsfiddle.net/TbAuQ/ | |
// source: http://www.zoharbabin.com/which-fizzbuzz-solution-is-the-most-efficient | |
var words = [undefined, "Fizz", "Buzz", "FizzBuzz"], | |
mask = 810092048, //11 00 00 01 00 10 01 00 00 01 10 00 01 00 00 | |
c = 0; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118
Your problem with Vim is that you don't grok vi.
You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).
The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:
0 go to the beginning of this line. y yank from here (up to where?)
Moved, see VIM Cheatsheet