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
<?php | |
class RebuildAroShell extends AppShell { | |
public $uses = array('User', 'Group'); | |
public function main() { | |
$groups = $this->Group->find('all'); | |
$users = $this->User->find('all'); | |
$aro = new Aro(); |
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
<?php | |
// Validates tenant | |
switch (isset($this->request->params['tenant'])) { | |
case true: | |
// The tennant should exist | |
$this->loadModel('Tenant'); | |
if ($this->Tenant->isExist($this->request->params['tenant']) == 0) { | |
throw new NotFoundException(); | |
} |
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
{ | |
init: function(elevators, floors) { | |
var elevator = elevators[0]; // Let's use the first elevator | |
_.each(floors, function(floor) { | |
floor.on("up_button_pressed down_button_pressed", function() { | |
elevator.goToFloor(floor.floorNum()); | |
}); | |
}); | |
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
Rails CMS alternatives | |
====================== | |
Note: project activity was checked on 11/26/09. | |
Active projects: | |
---------------- | |
Railsyard | |
site: http://www.railsyardcms.org/ | |
Last update: 02/07/12 | |
repo: https://github.com/cantierecreativo/railsyardcms |
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
#!/bin/sh | |
svn remove log/* | |
svn commit -m 'Removing log files' | |
svn propset svn:ignore "*.log" log/ | |
svn update log/ | |
svn commit -m 'Ignoring all files in /log/ ending in .log' | |
svn move config/database.yml config/database.example | |
svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code' | |
svn propset svn:ignore "database.yml" config/ | |
svn update config/ |
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
# | |
# Original blog here http://honoluluhacker.com/2009/11/19/install-shoulda-and-rcov-the-right-way/ | |
# Update your test/test_helper.rb, add | |
# require 'shoulda/rails' | |
# | |
require File.expand_path(File.dirname(__FILE__) + "/../../config/boot") | |
require 'rake' | |
require 'rake/testtask' | |
require 'rake/rdoctask' | |
require 'tasks/rails' |
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
## add this to test/test_helper.rb | |
require 'shoulda/rails' | |
## add this to Rakefile | |
require 'shoulda/tasks' | |
namespace :test do | |
desc 'Measures test coverage' | |
task :coverage do | |
rm_f "coverage" | |
rm_f "coverage.data" |
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
require 'date' | |
require 'rubygems' | |
require 'www/delicious' | |
delicious = WWW::Delicious.new('username', 'password') | |
params = { :fromdt => "#{Date.new(2010, 9, 1)}T00:00:00Z", | |
:todt => "#{Date.new(2010, 9, -1)}T00:00:00Z" } | |
posts = delicious.posts_all(params) |
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
*.log | |
database.yml | |
tmp/ |
OlderNewer