Skip to content

Instantly share code, notes, and snippets.

<?php
namespace App\Model\Table;
use Cake\ORM\Table;
use Cake\Validation\Validator;
use Cake\Model\Behavior\TreeBehavior;
class MembershipClassesTable extends AppTable {
public function initialize(array $config){
<?php
namespace App\Model\Table;
use App\Model\Entity\IdentificationTypesPerson;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
use SoftDelete\Model\Table\SoftDeleteTrait;
use Cake\Event\Event;
@commercial-hippie
commercial-hippie / gist:f26c7ccaa5edc0c08a3e
Last active August 29, 2015 14:25
Fix Ruby OpenSSL & compass issue
brew rm openssl
brew cleanup openssl
brew install openssl
rvm reinstall ruby
gem install compass
gem uninstall sass
gem install sass
@commercial-hippie
commercial-hippie / select2.less
Created July 9, 2015 04:33
Select2 4 - Bootstrap 3 Initial less style test
.select2-container {
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle;
.select2-selection--single {
cursor: pointer;
display: block;
height: @input-height-base;
$Snapshot = ClassRegistry::init('Snapshot');
$dates = $Snapshot->find
(
'all',
array
(
'fields' => array
(
'DISTINCT period_offset',
'id',
<?php
Router::connect('/orange-county-real-estate/search/**', ['controller' => 'properties', 'action'=>'search']);
// /orange-county-real-estate/search/orange/1/0
public function search($city = 'orange', $list = 0, $map = 0) {
}
<?php
public function add() {
// You don't need to call this,
// if you need the Users model you
// can use $this->Admins->Users
// $this->loadModel('Users');
$admin = $this->Admins->newEntity($this->request->data);
// This is not required!
<?php
namespace Chocolate\View\Helper;
use \Cake\View\Helper\FormHelper;
use \Cake\View\View;
class BootstrapFormHelper extends FormHelper {
protected $_defaultConfig = [
@commercial-hippie
commercial-hippie / sandbox
Created February 2, 2014 09:43
Just a basic html file that I can download to quickly test some JavaScript/HTML. Includes bootstrap CSS and JS, and AngularJS CDNs.
<!DOCTYPE html>
<html>
<head>
<title>Sandbox Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">
@commercial-hippie
commercial-hippie / angular_test.html
Last active August 26, 2021 18:51
AngularJS 101: Trying to figure out how to make clone-able or duplicate-able form inputs and input groups.
<!DOCTYPE html>
<html ng-app="sasApp">
<head>
<title>AngularJS Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">