Skip to content

Instantly share code, notes, and snippets.

View chrismear's full-sized avatar

Chris Tucker Mear chrismear

View GitHub Profile
<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')));
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++;}
def replace_things(string)
string = string.gsub(/lice/, 'dam')
end
def alter_things(string)
string.gsub!(/lice/, 'dam')
end
person = "Alice"
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
module ActiveRecord
module Base
def self.valid_attributes?(test_attributes)
self.new(test_attributes).valid?
end
end
end
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)
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;
}
<?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>
before :each do
10.times do |i|
Factory.create(:action)
end
end
# 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)