This file contains 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
<pre> | |
<?php | |
echo("POST variables:\n"); | |
print_r($_POST); | |
echo("\nGET variables:\n"); | |
print_r($_GET); | |
if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) | |
{ | |
echo("Raw POST:\n"); | |
echo(trim(file_get_contents('php://input'))); |
This file contains 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
main(a){float x,i,j,t,y;for(y=-30;y<30;puts(""),y++)for(x=-120;x<60;putchar(" ."[a>>6]),x++)for(i=j=a=0;i*j<2&&a<64;t=i*i-j*j+x/60,j=2*i*j+y/30,i=t)a++;} |
This file contains 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 replace_things(string) | |
string = string.gsub(/lice/, 'dam') | |
end | |
def alter_things(string) | |
string.gsub!(/lice/, 'dam') | |
end | |
person = "Alice" |
This file contains 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 |
This file contains 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 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 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 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 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 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) |