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
// this bit is important | |
$w('a div p span img table thead td th tr tbody tfoot input').each(function(e) { | |
window['$' + e] = function() { | |
return new Element(e, arguments[0]); | |
} | |
}); | |
function addLocation(partId) { | |
// create the element | |
newPart = $div({ |
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 | |
error_reporting(E_ALL); | |
require_once('config.php'); | |
// this check prevents access to debug front controllers that are deployed by accident to production servers. | |
// feel free to remove this, extend it or make something more sophisticated. | |
/********************************************************************** | |
******* COMMENTED TO ENABLE THE INSTALL_DEV.PHP FILE TO BE USED ******* | |
*********************************************************************** | |
if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::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
Options +FollowSymLinks +ExecCGI | |
AddDefaultCharset utf-8 | |
<IfModule mod_authz_host.c> | |
<FilesMatch "\.(lock|conf)$"> | |
Order deny,allow | |
Deny from all | |
</FilesMatch> |
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 Checks | |
{ | |
public static function getRequired() | |
{ | |
sfContext::getInstance()->getConfiguration()->loadHelpers(array('I18N')); | |
return array( | |
array(version_compare(phpversion(), '5.2.4', '>='), |
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 ShellCommand { | |
private $last_line; | |
private $cmd; | |
private $output = array(); | |
private $return_value; | |
function __construct( $cmd, $escape=true ) { |
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 MY_Factory extends CI_Model { | |
public static function create() { | |
} | |
public static function find( $id ) { | |
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
rm ~/.gem* | |
gem install bundler | |
PATH=$PATH:/usr/lib/ruby/gems/1.8/bin | |
cd ~ | |
git clone git://github.com/chiliproject/chiliproject.git | |
cd chiliproject | |
git checkout stable |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<title><%=h html_title %></title> | |
<meta name="description" content="<%= Redmine::Info.app_name %>" /> | |
<meta name="keywords" content="issue,bug,tracker" /> | |
<%= csrf_meta_tag %> | |
<%= favicon %> | |
<%= stylesheet_link_tag 'application', :media => 'all' %> |
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
// Get a model from the database, client says | |
Connection conn = DatabaseConnectionHelper.getConnection(); // make this static | |
DBFacade db = new DBFacade( conn ); | |
ExampleModel exModel = ExampleModel.find( db, 15 ); | |
exModel.setName('blah').save(); | |
exModel.delete(); | |
// classes | |
public class SuperModel { |
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 a sale */ | |
CREATE OR REPLACE PROCEDURE add_sale( | |
v_cust_id customers.id%TYPE, | |
v_prod_id products.id%TYPE, | |
v_qty sales.qty%TYPE | |
) | |
IS | |
v_price_single products.price%TYPE; | |
v_price_total sales.price%TYPE; | |
BEGIN |
OlderNewer