A user binary folder is a great place to put personal scripts and links to often-used commands.
First, create a folder in your home folder -- you can call it anything, but I prefer to call mine bin
:
mkdir ~/bin
<!-- products/_form.rhtml --> | |
<% for category in Category.find(:all) %> | |
<div> | |
<%= check_box_tag "product[category_ids][]", category.id, @product.categories.include?(category), {:id => dom_id(category, dom_id(@product)) %> | |
<%= label_tag dom_id(category, dom_id(@product)), category.name %> | |
</div> | |
<% end %> | |
<!-- example label output: --> | |
<label for="product_7_category_3">Widget</label> |
# Find foo's and replace with bar's, backing up as *.bak | |
grep -rl "foo" app/views | xargs sed -i .bak s/foo/bar/g | |
# Alternate: Require other patterns on the line | |
grep -rl "grok" app/views | xargs sed -i .bak -e '/grok/ s/foo/bar/g' | |
# Throw away the backup files |
# Don't do this... | |
my_url = @thing.new_record? ? new_thing_path : thing_path(@thing) | |
# Do this... | |
my_url = polymorphic_path(@thing) | |
# Especially useful for cases where you need to change the namespace or add extra params... |
After downloading VSCode, it's probably just a binary sitting in your Downloads folder. The first thing you want to do is copy that binary into your /Applications
folder. (Or open Explorer windows for both folders and just drag and drop the VSCode icon into the Applications folder.)
Next, you'll want to make a link to the VSCode app in your user binary folder. (If you don't have one, create it first and then come back.)
Double-check the location of the VSCode binary (mine is at /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
). Create a soft link to it like so: