Skip to content

Instantly share code, notes, and snippets.

View dimanyc's full-sized avatar

Dimitry Nazarov dimanyc

View GitHub Profile
@dimanyc
dimanyc / vim_commands.md
Last active July 14, 2016 15:39
basic VIM commands

Clipboard

v(*)"+y - will copy lines selected in Visual mode.

Folding

zfat or zfit - folds HTML by indentation?

Find / Replace:

:s%/foo/bar/g - Change each 'foo' to 'bar', (% means in every line)

@dimanyc
dimanyc / capybara cheat sheet
Last active March 2, 2016 00:02 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@dimanyc
dimanyc / google-analytics-regular-experssion-cheatsheet.md
Last active October 7, 2022 01:41
Google Analytics RegEx cheatsheet

Common Google Analytics RegEx operators

^   beginning of string
$   end of string
.   any character (wildcard)
*   match 0 or more times
+   match 1 or more times 
?   match 0 or 1 time
| alternative
@dimanyc
dimanyc / doskey.bat
Last active November 21, 2021 18:28 — forked from PierreMage/PowerShell-profile.ps1
Make your Windows command line better with doskey
:: http://technet.microsoft.com/en-us/library/bb490894.aspx
:: F7 = history
:: Alt+F7 = history -c
:: F8 = Ctrl+R
:: Use & to run multiple commands e.g.: command1 & command2
::
:: 1. Go to your Windows folder and find regedit.exe
:: 2. Head over to:
:: HKEY_LOCAL_MACHINE\Software\Microsoft\Command
:: or
@dimanyc
dimanyc / Game
Created March 12, 2015 00:40
Game
def cls
system ('cls') #for cmd
system ('clear') #for mac / linux
end
class String
def green; "\033[32m#{self}\033[0m" end #< colorizing all instances of the main class String and method green. Solution taken from here: http://stackoverflow.com/questions/1489183/colorized-ruby-output
def red; "\033[31m#{self}\033[0m" end
def brown; "\033[33m#{self}\033[0m" end