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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.wilcoxd.passenger_standalone</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/Users/rwilcox/.rvm/bin/radiant_site_ruby</string> | |
| <string>/Users/rwilcox/.rvm/gems/ruby-1.8.7-p299@radiant_site/bin/passenger</string> |
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
| # Create our own FileSystemResolver so that it looks for a .html file to render if | |
| # the (action).(format).erb file is not there. Useful for our MIME alias format.partial - | |
| # instead of needing to create a (something).partial.erb file we can use (something).html.erb | |
| # and use the template for both | |
| # | |
| # In this case (something).partial.erb files will be used if we want to provide something different than | |
| # what the normal partial provides us. WD-rpw 05-12-2011 | |
| class DefaultHtmlTemplateFormat < ActionView::FileSystemResolver |
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
| /* See this in action at: https://github.com/rwilcox/rails_js_representation/blob/master/app/views/todos/show.js.erb */ | |
| (function(){ | |
| var myobj = { | |
| reallyDue: function() { | |
| if (<%= @todo.new_record? -%>) { | |
| alert("this is a new record"); | |
| } else { | |
| alert("old record"); | |
| } |
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
| # Motion commands | |
| map "<Alt-Delete>", "<Alt-Right><Alt-Delete>" # Delete entire current word | |
| map "<Cmd-Alt-Delete>", "<Cmd-Right><Cmd-Delete>" # Delete entire current line | |
| # Move the current line one line up, or one line down (switch this line with the line currently | |
| # above or below it) | |
| # | |
| # See also: TextMate's Text -> Move Selection -> Line Up (or Line Down) | |
| map "<Cmd-Ctrl-Up>", "<Cmd-Left><Shift-Cmd-Right><Cmd-x><Delete><Up><Return><Shift-Cmd-Left><Delete><Cmd-v>" | |
| map "<Cmd-Ctrl-Down>", "<Cmd-Left><Shift-Cmd-Right><Cmd-x><Delete><Down><Cmd-Right><Return><Shift-Cmd-Left><Delete><Cmd-v>" |
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
| module AssetPath | |
| # Why this instead of Sproket's require_tree? | |
| # Sprokets compiles one SASS file at a time, which works OK... until you want | |
| # to pull out some SASS things (mixins, layout settings) into separate files. | |
| # In that case, you want to have SASS compile everything all at once, in one big file | |
| # So, use this helper to include all the SASS files down a path | |
| # | |
| # The alternative is the ugly (and not DRY!): <http://asciicasts.com/episodes/268-sass-basics> | |
| # where you list every file manually in the application.css.scass file. |
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
| # WITH HASHIE (https://github.com/intridea/hashie) | |
| # ###################################################### | |
| class User | |
| before_create :default_preferences_value | |
| serialize :preferences_hash | |
| delegate :full_name, :to => :preferences_hash | |
| delegate :full_name=, :to => :preferences_hash | |
| delegate :timezone, :to => :preferences_hash |
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
| # If the item has one comment, show it, else show the last comment and allow the user to expand | |
| # (yes, a slightly contrived example) | |
| def primary_comment | |
| if self.comemnts.count > 1 | |
| "<details class='primary_comment details'><summary><h3>" + self.comments.last.text + " (and #{self.comments.count - 1} others)" | |
| "<ul>" | |
| self.comments.each[0...-1] do |comment| | |
| "<li>" + comment.text + "</li>" | |
| end | |
| else |
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
| hello world |
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
| HI WERLD |