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
| 127.0.0.1 localhost | |
| 255.255.255.255 broadcasthost | |
| ::1 localhost | |
| fe80::1%lo0 localhost |
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
| irb(main):004:0> t1 = Time.now | |
| => Fri May 08 11:14:09 +0100 2009 | |
| irb(main):005:0> t2 = Time.utc(2009, 5, 9) | |
| => Sat May 09 00:00:00 UTC 2009 | |
| irb(main):006:0> difference = t2 - t1 | |
| => 49550.731764 | |
| irb(main):007:0> t1 + difference | |
| => Sat May 09 01:00:00 +0100 2009 |
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
| irb(main):001:0> a = 10.12 | |
| => 10.12 | |
| irb(main):002:0> b = (a*100) | |
| => 1012.0 | |
| irb(main):003:0> sprintf("%.16f", b) | |
| => "1011.9999999999998863" | |
| irb(main):004:0> b.to_i | |
| => 1011 | |
| irb(main):005:0> b.round | |
| => 1012 |
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
| # Use in conjunction with the tab helper to create a list of tabs | |
| # | |
| # For example: | |
| # | |
| # <% tab_list do -%> | |
| # <%= tab "Photos", campaign_photos_path(:campaign_id => @campaign), "campaign_photos", :selected %> | |
| # <%= tab "Videos", campaign_videos_path(:campaign_id => @campaign), "campaign_videos" %> | |
| # <%= tab "Information", campaign_information_path(:campaign_id => @campaign), "campaign_information" %> | |
| # <% end -%> | |
| def tab_list(id=nil, &block) |
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
| before :each do | |
| 10.times do |i| | |
| Factory.create(:action) | |
| 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
| <?xml version="1.0"?> | |
| <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> | |
| <cross-domain-policy> | |
| <allow-http-request-headers-from domain="*" headers="Authorization,Accept,Content-Type"/> | |
| </cross-domain-policy> |
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
| Array.prototype.indexOf = function(objectToFind) { | |
| var i; | |
| var l = this.length; | |
| for (i = 0; i < l; i++) { | |
| if (this[i] === objectTofind) { | |
| return i; | |
| } | |
| } | |
| return -1; | |
| } |
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
| New clause row, 'organisation_state' (?) which can be empty, 'pending' or 'active'. Empty is the initial state, while organisation details are being entered; 'pending' is once all details have been entered and we are waiting for the founding meeting; 'active' is once the founding meeting has been confirmed. | |
| Somewhere to store the founding meeting's date, time and location | |
| Draft template for founding meeting agenda | |
| 'Induction' controller: | |
| Action for setting the founder's user details | |
| Actions for setting the organisation/constitution settings | |
| Action for setting the founding meeting details (which moves the organisation from empty to 'pending' state) |
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 ActiveRecord | |
| module Base | |
| def self.valid_attributes?(test_attributes) | |
| self.new(test_attributes).valid? | |
| 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
| class Test | |
| def test | |
| hash = {:entry => ""} | |
| array = [] | |
| array << self.test2(hash.dup) | |
| array << self.test2(hash.dup) | |
| array << self.test2(hash.dup) | |
| array << self.test2(hash.dup) | |
| array << self.test2(hash.dup) | |
| array |