[Link to the Single hash](#single-hash).
[Link to the Double hash with parens](#double-hash-with-parens).
| # this is the code I used to determine the csv_path to use when using Paperclip with Amazon S3 AWS | |
| # necessary because my development environment doesn't upload to S3 | |
| # get an object that has_attachment with Paperclip | |
| object = ModelWithPaperclip.last | |
| # use url if no file exists at path | |
| csv_path = File.exists?(object.csv.path) ? object.csv.path : object.csv.url | |
| # this should probably be implemented as a model method |
| def sent? | |
| self.status == "sent" | |
| end |
| var $ = require("jQuery") | |
| , Delegator | |
| ; | |
| Delegator = function () { | |
| this.$el = $("<p/>"); | |
| } | |
| // Add a function to the object that delegates to a property on the same object. | |
| // |
| describe Pasta do | |
| describe "#sauce_name" do | |
| describe "when initialized with sauce_type = 2" do | |
| let(:pasta) { Pasta.new(2) } | |
| it "returns \"pesto\"" do | |
| assert_equal(pasta.sauce_name, "pesto") | |
| end | |
| end | |
| end |
[Link to the Single hash](#single-hash).
[Link to the Double hash with parens](#double-hash-with-parens).
| { | |
| "auto_find_in_selection": true, | |
| "enable_tab_scrolling": false, | |
| "ensure_newline_at_eof_on_save": true, | |
| "font_size": 13, | |
| "ignored_packages": | |
| [ | |
| "Vintage" | |
| ], | |
| "margin": 4, |
| class Person | |
| def call_mom! | |
| puts "I just called mom." | |
| end | |
| def wash_car! | |
| puts "I just washed my car." | |
| end |
| ### http://git-prompt.sh/ | |
| source ~/.git-prompt.sh | |
| ### Set PS1 | |
| export PS1="[\[\033[32m\]\w\[\033[0m\]]\$(__git_ps1)\n\[\033[1;36m\]\u\[\033[32m\]$ \[\\033[0m\]" | |
| export PATH=/usr/local/bin:~/bin:$PATH | |
| ### Set SublimeText as default editor | |
| ln -sf "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl |
| ### http://git-prompt.sh/ | |
| source ~/.git-prompt.sh | |
| ### Set PS1 | |
| export PS1="[\[\033[32m\]\w\[\033[0m\]]\$(__git_ps1)\n\[\033[1;36m\]\u@vagrant\[\033[32m\]$ \[\\033[0m\]" | |
| export PATH=/usr/local/bin:~/bin:$PATH |
| # Customize BASH PS1 prompt to show current GIT repository and branch. | |
| # by Mike Stewart - http://MediaDoneRight.com | |
| # http://mediadoneright.com/content/ultimate-git-ps1-bash-prompt | |
| # SETUP CONSTANTS | |
| # Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
| # I don't remember where I found this. o_O | |
| alias g-delete-all-branches-except-master="git branch | grep -v "master" | xargs git branch -D" |