This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # to delete all lines containing "profile" (remove the /d to show the lines that the command will delete): | |
| :g/profile/d | |
| # to delete all lines that do not contain a pattern, use 'g!' (equivalent to 'v'), like this command to delete all lines that are not comment lines in a Vim script: | |
| :g!/^\s*"/d | |
| :v/^\s*"/d | |
| # to delete all lines except those that contain "error" or "warn" or "fail" | |
| :v/error\|warn\|fail/d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery._data( elem, "events" ); | |
| // http://stackoverflow.com/questions/2518421/jquery-find-events-handlers-registered-with-an-object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :e. (e-space-dot) gives a browsable current directory - then you can /-search for name fragments | |
| # http://stackoverflow.com/questions/573039/any-shortcut-to-open-file-in-vim | |
| Others: | |
| :split | |
| :vsplit | |
| Ctrl+w+w / Ctrl+Shift+w | |
| :res +10 # http://vim.wikia.com/wiki/Resize_splits_more_quickly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def yep | |
| puts "method_name: #{__callee__}" | |
| end | |
| > yep | |
| method_name: yep | |
| Also: __method__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| within "#id" do | |
| expect(page).to have_content("hello") | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| date.beginning_of_day | |
| date.end_of_day |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Gemfile | |
| gem 'debugger', group :development, :test | |
| include 'debugger' where you want to debug | |
| Commands: | |
| - help | |
| - list | |
| - pp variable (print variable content) | |
| - irb (enter in irb; well, rails console) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://www.agileplannerapp.com/blog/building-agile-planner/refactoring-with-hexagonal-rails | |
| https://www.youtube.com/watch?v=CGN4RFkhH2M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| binding.pry instead of debugger | |
| #Gemfile | |
| group :test, :development do | |
| gem "pry-rails" | |
| gem "pry-byebug" | |
| ? gem "binding_of_caller" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Find all files whose name ends with .yml | |
| find * -name "*.yml" | |
| # Find files or directories with the name "name" | |
| locate name | |
| -- | |
| # Search files with the content: | |
| grep -r "content" * |