Skip to content

Instantly share code, notes, and snippets.

View passion4code's full-sized avatar

Jason Rose passion4code

View GitHub Profile
<?php
protected function _getPaymentMethodsHtml()
{
// ob_start();
// include(BASE_PATH.'app/design/frontend/d1sn_interface/default/template/checkout/onepage/cc_pick.phtml');
// $output = ob_get_clean();
// return $output;
@passion4code
passion4code / gist:929892
Created April 19, 2011 22:40
default layout file
<body>
<div id="container">
<?php if($auth_user = $this->Session->read('Auth.User')): ?>
<div class="member-box">
<div class="center">
<div class="share-btn"><a class="btn small small-share"><span><?php __('Share Your Idea Here'); ?></span></a></div>
<div class="float-right">
<?php echo $this->element('user_header',array('auth_user'=> $auth_user)); ?>
<?php
//Load the string up
$string = '<html><body><h4 class="itemheading" id="bizTitle0">
<a id="bizTitleLink0" href="/biz/facial-bungalow-west-hollywood#query:esthetician">I NEED THIS</a>
</h4>
BUNCH OF HTML
<address>
I NEED THIS
</address></body></html>';
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($regionCode).'&region='.urlencode($regionCode).'&sensor=false');
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$response = curl_exec($ch);
$resp = @json_decode($response);
curl_close($ch);
$found = false;
if($resp){
$("label").click(
function () {
var labelFor = $(this).attr('for');
labelFor = $('#'+labelFor);
if(labelFor.length > 0 && labelFor[0].type == 'checkbox'){
if(labelFor[0].checked == true){
$(this).removeClass("select");
labelFor.removeAttr('checked');
}else{
<?php
echo ($this->Paginator->sortKey() == 'LessonPlan.favorite_count') ? $this->Paginator->sortKey(): $this->Paginator->sort(__('Favorites',true),'favorite_count',array('direction' => 'desc'));
echo ($this->Paginator->sortKey() == 'LessonPlan.created_at') ? $this->Paginator->sortKey() : $this->Paginator->sort(__('Date',true),'created_at',array('direction' => 'desc'));
//both returns '0'
@passion4code
passion4code / css.php
Created May 18, 2011 19:31
CSS File Merge and Caching
<?php
define('DS',DIRECTORY_SEPARATOR);
$base_path = $_SERVER['DOCUMENT_ROOT'].DS.'app'.DS.'webroot'.DS;
$files = array(
<?php
class Person extends AppModel{
public $hasMany = array('PromiseRequest','PromiseResponse');
public $hasOne = array('PersonInfo');
public function beforeSave(){
//check for accounts with the same info
$found_person = null;
if(isset($this->data['Person']['email'])){
<?php
class TestsController extends AppController{
var $uses = array();
function promises_get(){
if(isset($this->params['named']['auth_token'])) $this->authToken = $this->params['named']['auth_token'];
if(isset($this->params['named']['modified'])){
$this->__send('promises/get',array('modified' => $this->params['named']['modified']));
}elseif($this->params['named']['promise_request_id']){
$this->__send('promises/get',array('promise_request_id' => $this->params['named']['promise_request_id']));
<?php
public function view($techGuideid = null) { //details page for tech-guide
// $params = array(
// 'conditions' => array(
// 'TechGuideline.id' => $techGuideid,
// //'TechGuideline.is_active' => 1,
// ),
// 'fields' => array('User.first_name', 'User.last_name ', 'Technology.id', 'Technology.title', 'TechGuideline.id', 'TechGuideline.user_id', 'TechGuideline.title', 'TechGuideline.content', 'TechGuideline.created', 'TechGuideline.comments_count'),
// 'joins' => array(