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 _paperclip_is_csv(field_name) | |
| if attachment_for(field_name).dirty? | |
| begin | |
| FasterCSV.read(attachment_for(field_name).queued_for_write[:original].path) | |
| rescue FasterCSV::MalformedCSVError => e | |
| errors.add_to_base("Please ensure that the #{field_name.to_s.titleize} is a valid CSV file.") | |
| end | |
| end | |
| 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
| [TheOrphanarium] dan:app_name$ tail -f log/development.log | |
| *** In /Users/dan/Code/app_name/config/initializers/haml_and_sass.rb; Testing if we've loaded SASS... | |
| Sass Not Loaded - Configuration likely to be clobbered | |
| *** In /Users/dan/Code/app_name/config/initializers/haml_and_sass.rb; Checking Template Locations and Style options... | |
| [["./public/stylesheets/sass", "./public/stylesheets"], ["/Users/dan/Code/app_name/app/stylesheets", "./public/stylesheets"]] | |
| Sass::Plugin.options[:style] => compressed | |
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
| grey='\e[0;90m' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}(" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})" | |
| function pat_prompt { | |
| (( spare_width = ${COLUMNS} )) | |
| prompt=" " |
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
| var CallbackObject = { | |
| task_a_done = false, | |
| task_b_done = false, | |
| trigger = function(which_task) { | |
| if(which_task == "A") { this.task_a_done = true; } | |
| if(which_task == "B") { this.task_a_done = true; } | |
| if(this.task_a_done && this.task_b_done) { | |
| trigger_task_c(); | |
| } |
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
| require 'net/imap' | |
| imap = Net::IMAP.new("imap.gmail.com", { :ssl => true }) | |
| imap.login("username", "password") | |
| imap.status("INBOX", ["UNSEEN"]) | |
| imap.select("INBOX") | |
| imap.search(["UNSEEN"]) # => message ids | |
| t = imap.fetch(message_id, "RFC822").first.attr["RFC822") # => whole message in RFC822 | |
| Mail.new(t) |
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
| = form_for @enquiry || Enquiry.new, :remote => true, :builder => Paragon::Builder, :html => { :class => "paragon" } do |f| | |
| %fieldset.horizontal | |
| = f.text_field :name | |
| = f.text_field :company_name | |
| = f.text_field :email_address | |
| = f.text_field :contact_number | |
| = f.text_area :message |
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
| ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery => case Rails.env | |
| when "production" then ["http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js", "application", "etc"] | |
| when "development" then %w(jquery jquery-ui jquery-typewatch rails application) | |
| 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
| ZSH_THEME_GIT_PROMPT_PREFIX="" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="" | |
| ZSH_THEME_GIT_PROMPT_CLEAN=" %F{46}±" | |
| ZSH_THEME_GIT_PROMPT_DIRTY=" %F{196}±" | |
| function codeape_prompt { | |
| # set up the biggest possible middle padding we'd need | |
| (( spare_width = ${COLUMNS} )) | |
| prompt=" " |
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
| Feature: Starting the Applcation | |
| In order to avoid reprimands from my boss | |
| As a disobedient little hacker, desperate to flagrantly break IT policy | |
| I want to use Twitter in a stealthy manner |
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
| Because ImageMagick likes to remove tarballs, we're downloading their | |
| stable release from their SVN repo instead. But they only serve the | |
| repo over HTTPS, and have an untrusted certificate, so we auto-accept | |
| this certificate for you. | |
| If this bothers you, open a ticket with ImageMagick to fix their cert. |