Skip to content

Instantly share code, notes, and snippets.

View tjboudreaux's full-sized avatar
🎯
Focusing

Travis Boudreaux tjboudreaux

🎯
Focusing
View GitHub Profile
set :application, "app"
set :domain , "domain"
set :repository, "your repository"
set :slice_ip, '##.###.###.###'
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/var/www/vhosts/#{domain}/htdocs"
set :document_root, "/var/www/vhosts/#{domain}/htdocs/current"
$this->_helper->viewRenderer->setNoRender(true);
<!-- Wrapper for a slate -->
<div id="<?=$this->id ?>" class="<?=$this->slate ?> slate-wrapper">
<?=$this->content?>
<div>
<!-- 3 Slate List View -->
<? if ($this->slate == Kfx2_View_Helper_ThreeSlate::SLATE_BLANK ) : ?>
<? elseif ($this->slate == Kfx2_View_Helper_ThreeSlate::SLATE_ERROR) :?>
def self.find_scrabble_words ( letters )
words = Array.new
(1..letters.size).each do |i|
letters.permutation(i).to_a.each{
|word| words.push(word.join(""))
}
end
return self.find(:all,
:conditions => ["word in (?)", words.compact ],
class User_Model_User extends User_Model_Base_User
{
const IS_ACTIVE_OFF = 0;
const IS_ACTIVE_ON = 1;
public static $isActiveFlag = self::IS_ACTIVE_OFF;
public function hook()
public function findLeadersBySchool($schoolId = 1, $limit = 3)
{
return $this->findLeadersBaseQuery()
->leftJoin('u.Assignment_Assignee a ON u.id = a.assigned_entity_id ')
->addWhere('a.assigned_entity_type = ?', User_Model_Student::ENTITY_TYPE)
->addWhere('a.assignee_entity_type = ?', Plan_Model_Classroom::ENTITY_TYPE)
->addWhere('a.assignee_entity_id = ?', $schoolId)
//->limit($limit)
->execute();
}
public function postUpdate($event)
{
$profile = Zend_Registry::getInstance()->get("role");
$currentRecord = $this->getTable()->find($event->getInvoker()->id);
$profile->steps = $profile->steps - $currentRecord->steps +
$event->getInvoker()->steps;
$profile->save();
}
require 'rubygems'
require 'active_record'
require 'robots'
dbconfig = YAML::load(File.open("db.yml"))
ActiveRecord::Base.establish_connection(dbconfig)
ActiveRecord::Base.logger = Logger.new(STDERR)
class DomainName < ActiveRecord::Base
end
grep '2010-02-17' error.log
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install