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
| # ----------------------------- | |
| # PostgreSQL configuration file | |
| # ----------------------------- | |
| # | |
| # This file consists of lines of the form: | |
| # | |
| # name = value | |
| # | |
| # (The "=" is optional.) Whitespace may be used. Comments are introduced with | |
| # "#" anywhere on a line. The complete list of parameter names and allowed |
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 'test_helper' | |
| require 'minitest/autorun' | |
| class MiniTest::Spec | |
| include ActiveSupport::Testing::SetupAndTeardown | |
| include ActiveRecord::TestFixtures | |
| alias :method_name :__name__ if defined? :__name__ | |
| self.fixture_path = File.join(Rails.root, 'test', 'fixtures') | |
| 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
| # ruby 1.9 supports 4 ways to call a proc! ex: f =->n {[:hello, n]}; f[:ruby]; f.call(:ruby); f.(:ruby) | |
| # | |
| # turns out, you can also call a proc via proc === :arg -- which means you can use proc's in when clauses! | |
| # ruby doc: http://ruby-doc.org/ruby-1.9/classes/Proc.html#M001165 | |
| # | |
| # ... kudos to @chadfowler for the tip! | |
| # | |
| # (note: works on 1.8.7 as well :-)) | |
| def am_i_awesome? |
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
| # In response to: | |
| # http://mlomnicki.com/ruby/tricks-and-quirks/2011/02/10/ruby-tricks2.html | |
| # Ruby 1.9.2 has some neat stuff that lets us make a readable | |
| # alternative case statement that calls each method in turn. | |
| # 1.9.2 features used: | |
| # * hashes are ordered in 1.9.2 | |
| # * cool JSON-style hash syntax | |
| # * concise lambda syntax |
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 tip(msg); puts; puts msg; puts "-"*100; end | |
| # | |
| # 30 Ruby 1.9 Tips, Tricks & Features: | |
| # http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
| # | |
| tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
| tip "Ruby 1.9 supports named captures in regular expressions!" |
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
| FIXED: See the next file for a working RawFileUpload class. | |
| UPDATE: Heroku uses thin server and I use webrick. When I tried thin on my local machine, it didn't work. | |
| So, the conclusion is there is some difference between webrick and thin that's causing the problem. | |
| This file is related to this blog post: | |
| http://mooooooooooo.wordpress.com/2010/12/03/paperclip-valums%E2%80%99s-file-uploader-and-middleware-continued/ | |
| The code in the blog post works fine on my local machine but not on Heroku. |
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
| <html> | |
| <head> | |
| <script src="jquery-1.6.1.min.js"></script> | |
| <script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script> | |
| <script src="underscore-min.js"></script> | |
| <script src="backbone-min.js"></script> | |
| <script src="example.js"></script> | |
| <style type="text/css"> | |
| fieldset { |
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
| # src_files | |
| # | |
| # Return an array of filepaths relative to src_dir to include before jasmine specs. | |
| # Default: [] | |
| # | |
| # EXAMPLE: | |
| # | |
| # src_files: | |
| # - lib/source1.js | |
| # - lib/source2.js |
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 'rubygems' | |
| require 'eventmachine' | |
| children = [] | |
| Signal.trap('SIGINT') do | |
| EventMachine.next_tick { EventMachine.stop_event_loop } | |
| end | |
| Signal.trap('EXIT') do |
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 'thread' | |
| module EventMachine | |
| module Test | |
| module Utils | |
| module Cranking | |
| # Stolen from MenTaLguYs Omnibus | |
| class Waiter | |
| def initialize |