Skip to content

Instantly share code, notes, and snippets.

@tareko
tareko / gist:3922976
Created October 20, 2012 10:57
Should this array save associated?
array(
(int) 1 => array(
'Billing' => array(
'patient_birthdate' => '19200625',
'payment_program' => 'HCP',
'payee' => 'P',
'referring' => '010065',
'healthcare_provider' => '010800',
(int) 0 => array(
'BillingsItem' => array(
@tareko
tareko / gist:3922984
Created October 20, 2012 10:59
From the book?
array(
(int) 1 => array(
'Billing' => array(
'patient_birthdate' => '19530624',
'payment_program' => 'HCP',
'payee' => 'P',
'referring' => '010065',
'healthcare_provider' => '010800'
),
'BillingsItem' => array(
@tareko
tareko / gist:3925458
Created October 21, 2012 02:06
Sample CSV
Provider,Service date,Unique patients seen
10800,2007-12-03,1
10800,2008-03-21,9
10800,2008-04-16,3
10800,2008-04-18,6
11451,2008-06-27,24
11451,2008-07-10,1
11451,2008-07-14,31
11451,2008-07-15,6
12980,2008-06-17,24
@tareko
tareko / gist:4330439
Created December 18, 2012 18:05
Trying to figure out how to set as a condition a Profile.cb_ohip
$conditions = array_merge($conditions, array(
'Profile.cb_ohip' => $healthcare_provider,
));
return $this->User->Profile->find('all', array(
'contain' => array(
'Shift' => array(
'fields' => array('id', 'date'),
'conditions' => array(
'Shift.date >=' => $start_date,
'Shift.date <=' => $end_date,
@tareko
tareko / gist:4391063
Created December 27, 2012 19:10
model for Billing.php
<?php
App::uses('AppModel', 'Model');
/**
* Billing Model
*
* @property BillingsItem $BillingsItem
*/
class Billing extends AppModel {
/**
@tareko
tareko / gist:4411202
Last active December 10, 2015 08:58
Starter functions for club methods
function over21($member = null) {
$isOver21 = true;
return $isOver21;
}
function memberExists($member = null) {
$memberExists = true;
return $memberExists;
}
@tareko
tareko / gist:4703974
Created February 3, 2013 22:24
Joomla
-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 03, 2013 at 11:23 PM
-- Server version: 5.5.29
-- PHP Version: 5.4.6-1ubuntu1.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@tareko
tareko / Output
Last active December 14, 2015 03:18 — forked from anonymous/gist:5019559
attempt to get a proper rule to check multiple for unique
array(
'Shift' => array(
'user_id' => '1',
'date' => '2011-12-01',
'shifts_type_id' => '1'
)
)
@tareko
tareko / gist:8688681
Created January 29, 2014 14:08
Unable to checkout and merge remote branch
$ git checkout ojs-stable-2_4
Branch ojs-stable-2_4 set up to track remote branch ojs-stable-2_4 from upstream.
Switched to a new branch 'ojs-stable-2_4'
$ git merge upstream/ojs-stable-2_4
Already up-to-date.
$ git push
ERROR: Permission to pkp/ojs.git denied to USER.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
@tareko
tareko / Error message
Created March 9, 2014 01:45
Can't connect to MySQL socket
$ ls -l /var/run/mysqld/mysqld.sock
srwxrwxrwx 1 mysql mysql 0 Mar 8 20:39 /var/run/mysqld/mysqld.sock
$ sudo rake db:migrate
rake aborted!
Can't connect to local MySQL server through socket 'mysql socket path (/var/run/mysqld/mysqld.sock)' (2)
/var/lib/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
/var/lib/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
/var/lib/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'