Skip to content

Instantly share code, notes, and snippets.

@kylenoland
kylenoland / usage.php
Created October 5, 2011 04:06
Basic Haystack Usage
class Search extends CI_Controller
{
$this->load->library('Haystack');
// Create a new index
$this->haystack->create_index('cars');
// Set the index to work with for the next one or more IndexTank API calls
$this->haystack->set_index('cars');
<?php
private function getDrapeWidths(DrapeItem $drapeItem, DrapeUnit $drapeUnit, DrapeCutDefault $drapeCutDefault)
{
// Pinch Pleat DrapeItem
if($drapeItem->isPinchPleat())
{
// Pinch Pleat Pair DrapeItem
if($drapeItem->isPairStack())
{
@kylenoland
kylenoland / BaseRepository.php
Created October 28, 2014 14:35
Laravel Base Repository
<?php
abstract class BaseRepository implements BaseRepositoryInterface
{
/**
* The repository model
*
* @var \Illuminate\Database\Eloquent\Model
*/
protected $model;