first=$1
second=$2
# Replace
find -name *.cpp -or -name *.h | xargs grep "$first" -l | xargs perl -pi -e "s/$first/$second/g"
a=getDefaultIncludes; b=get_include_dirs_def; find -name "*.py" -or -name "SC*" | xargs grep "$a" -l | xargs perl -pi -e "s/$a/$b/g"
a=abc; b=def; find -name "*.cpp" -or -name "*.h" | xargs grep "$a" -l | xargs perl -pi -e "s/$a/$b/g"
This file contains 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
{ | |
"workbench.startupEditor": "newUntitledFile", | |
"editor.fontSize": 14, | |
"editor.lineHeight": 1.8, | |
"javascript.suggest.autoImports": true, | |
"javascript.updateImportsOnFileMove.enabled": "always", | |
"editor.rulers": [80, 120], | |
"extensions.ignoreRecommendations": true, | |
"typescript.tsserver.log": "off", | |
"files.associations": { |
FWIW: I (@Rondy) am not the author of the content presented here, which is an outline from Edmond Lau's book. I've just copy-pasted it from somewhere and saved as a personal gist, before it got popular on newsnews.ycombinator.com. I don't remember where exactly the original source is from and neither could find the author's name, so I cannot give him/her the proper credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
This file contains 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
# This template is inspired on https://github.com/basecamp/audits1984/blob/master/.rubocop.yml | |
# | |
# 1 - Add dependencies to group :development, :test | |
# gem "rubocop", "~> 1.26", require: false | |
# gem "rubocop-performance", require: false | |
# gem "rubocop-rails", require: false | |
# | |
# 2 - Create a file .rubocop.yml and add the lines below | |
# inherit_from: https://gist.githubusercontent.com/lazaronixon/7815d84702f277ead5e89c9f2aa5581f/raw/rubocop.yml | |
# |
use must for positive expectations and wont for negative expectations.
- must_be | list.size.must_be :==, 0
- must_be_close_to | subject.size.must_be_close_to 1,1
- must_be_empty | list.must_be_empty
- must_be_instance_of | list.must_be_instance_of Array
- must_be_kind_of | list.must_be_kind_of Enumerable
This file contains 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
# The following comments fill some of the gaps in Solargraph's understanding of | |
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but | |
# ignored at runtime. | |
# | |
# You can put this file anywhere in the project, as long as it gets included in | |
# the workspace maps. It's recommended that you keep it in a standalone file | |
# instead of pasting it into an existing one. | |
# | |
# @!parse | |
# class ActionController::Base |
This file contains 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
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |
Based on method outlined in this comment
Based on approach outlined here.
- Advantages
This file contains 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
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
NewerOlder