Skip to content

Instantly share code, notes, and snippets.

View hailwood's full-sized avatar

Matthew Hailwood hailwood

View GitHub Profile
<?php
/**
* @description: This class helps you to manage countries within the context of e-commerce.
* For example: To what countries can be sold.
* /dev/build/?resetecommercecountries=1 will reset the list of countries...
*
*
* @authors : Nicolaas [at] Sunny Side Up .co.nz
* @package : ecommerce
<?php
$list = Product::get()->filterAny(array('AllCountries' => 1, 'IncludedCountries.Code' => $country))
->exclude('ExcludedCountries.Code', $country)
->map()->toArray();
SELECT DISTINCT
`SiteTree_Live`.`ClassName`,
`SiteTree_Live`.`Created`,
`SiteTree_Live`.`LastEdited`,
`SiteTree_Live`.`URLSegment`,
`SiteTree_Live`.`Title`,
`SiteTree_Live`.`MenuTitle`,
`SiteTree_Live`.`Content`,
`SiteTree_Live`.`MetaDescription`,
`SiteTree_Live`.`ExtraMeta`,
<?php ////
$list = Product::get()->filterAny(array('AllCountries' => 1, 'IncludedCountries.Code' => $country))
->exclude('ExcludedCountries.Code', $country)->map();
<?php
class GalleryImage extends DataObject {
private static $db = array(
'Title' => 'VarChar',
'ObjectDescription' => 'Text',
'SortOrder' => 'Int'
);
public static $default_sort = 'SortOrder';
# Install beanstalkd
class beanstalkd::install {
exec { 'install-beanstalkd':
path => '/bin:/sbin:/usr/bin:/usr/sbin',
command => 'apt-get install beanstalkd -y',
cwd => '/home/vagrant'
}
exec { 'install-console':
exec { 'install-puppet-apache':
path => '/bin:/sbin:/usr/bin:/usr/sbin',
command => 'puppet module install puppetlabs-apache',
cwd => '/home/vagrant'
}
class { 'composer::install': }
class { 'beanstalkd::install': }
var theme = 'default';
var elixir = require('laravel-elixir');
var path = new require('./Path')('resources/themes/'+theme+'/assets/', 'public/themes/'+theme+'/');
var sources = require('./'+path.input('../sources.js'));
/*
|----------------------------------------------------------------
| Have a Drink!
|----------------------------------------------------------------
<?php
class CarouselImage extends DataObject {
public static $db=array(
'Title'=>'Varchar',
'SortOrder'=>'Int'
);
public static $default_sort='SortOrder';
Debugging Information: all methods available in 'BlogHolder_Controller'
Debugging Information: all fields available in 'BlogHolder_Controller'
$ClassName
$Created
$LastEdited
$URLSegment
$Title
$ShowInMenus
$ShowInSearch
$Sort