Skip to content

Instantly share code, notes, and snippets.

<?php $javascript->link('member_search_form'); ?>
<h1>People</h1>
<div id="rightcol">
<?php echo $this->element('../users/find_a_member')?>
<?php echo $this->element('top_contributors'); ?>
</div>
<div id="leftcol">
<div class="block">
<div class="top"><div class="right"></div>Search Results</div>
<?php $javascript->link('member_search_form'); ?>
<h1>People</h1>
<div id="rightcol">
<?php echo $this->element('../users/find_a_member')?>
<?php echo $this->element('top_contributors'); ?>
</div>
<div id="leftcol">
<div class="block">
<div class="top"><div class="right"></div>Search Results</div>
describe SomeController do
before(:each) do
login as 'user'
end
...
end
begin
require 'spec'
rescue LoadError
require 'rubygems'
gem 'rspec'
require 'spec'
end
Spec::Runner.configure do |config|
config.mock_with :flexmock
>> "day_threshold".camelize.constantize
=> DayThreshold
>> "day_threshold".camelize.constantize.new
=> #<DayThreshold:0xb7a6cbd0>
@boffbowsh
boffbowsh / metastore.rb
Created July 24, 2008 15:14
Put has_metadata.rb in lib, then use has_metadata :os in your model
class Metadata < ActiveRecord::Base
set_table_name "meta_metadata"
belongs_to :meta_object, :polymorphic => true
end
require "shorturl"
# rubyurl
url = ShortURL.shorten( 'http://mypage.com' )
# moourl
moo_url = ShortURL.shorten( 'http://mypage.com', :moourl )
@nrk
nrk / runtest.io
Created July 24, 2008 15:42
just a quick test of Io's unit testing facility
// runtest.io
TestSuite clone setPath(System launchPath) run
[kjell@alentour ~/Sites/beaker]> rake
(in /Users/kjell/Sites/beaker)
/opt/local/bin/ruby -Ilib:test "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb" "test/functional/clients_controller_test.rb" "test/functional/code/commits_controller_test.rb" "test/functional/code/tree_controller_test.rb" "test/functional/deploy/deploys_controller_test.rb" "test/functional/deploy/servers_controller_test.rb" "test/functional/home_controller_test.rb" "test/functional/integrations_controller_test.rb" "test/functional/messages_controller_test.rb" "test/functional/notes/notes_controller_test.rb" "test/functional/notes/versions_controller_test.rb" "test/functional/projects_controller_test.rb" "test/functional/scrum/sprints_controller_test.rb" "test/functional/scrum/stories_controller_test.rb" "test/functional/scrum/story_comments_controller_test.rb" "test/functional/sessions_controller_test.rb" "test/functional/user_assignments_controller_test.rb" "test/functional/users_controller_test.rb"
/Users/kje
package jubishop {
import mx.collections.ArrayCollection;
public class Set extends ArrayCollection {
public function removeItem(item:Object):int {
var itemIndex:int = getItemIndex(item);
if (itemIndex == -1) return -1;
removeItemAt(itemIndex);
return itemIndex;
}