Skip to content

Instantly share code, notes, and snippets.

View hailwood's full-sized avatar

Matthew Hailwood hailwood

View GitHub Profile
<?php ////
$list = Product::get()->filterAny(array('AllCountries' => 1, 'IncludedCountries.Code' => $country))
->exclude('ExcludedCountries.Code', $country)->map();
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()->toArray();
<?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
Director:
environment_type: 'dev'
Director:
rules:
'test//$Action/$ID' : 'TestPage_Controller'
'OrderModifierForm_Controller//$Action/$ID' : 'OrderModifierForm_Controller'
BlogEntry:
default_sort: 'Date DESC'
summary_fields:
- Title
- Date
field_labels:
- Title: 'Entry Title'
- Date: 'Date Posted'
<?php
for($i = 1; $i <= 10; $i++){
for($j = 1; $j <= (11-($i?:1)); $j++){
echo $i.chr(64+$j)."\n";
}
echo "--\n\n";
}
?>
/* $AMPERSAND_VERSION */
var domify = require('domify');
var dom = require('ampersand-dom');
var matches = require('matches-selector');
var View = require('ampersand-view');
//Replaceable with anything with label, message-container, message-text data-hooks and a <select>
var defaultTemplate = [
'<label class="select">',
'<span data-hook="label"></span>',
Requirements::customScript(<<<JS
(function($) {
$('.icp-auto').entwine({
onmatch: function(){
$('.icp-auto').iconpicker();
this._super();
},
onunmatch: function() {
this._super();
}
@hailwood
hailwood / ampersand-checkbox-view.js
Created October 28, 2015 23:51
Ampersand checkbox view with htmlLabel support.
var AmpersandCheckboxView = require('ampersand-checkbox-view');
module.exports = AmpersandCheckboxView.extend({
initialize: function(opts){
this._defaultInitialize(opts);
this.htmlLabel = !!opts.htmlLabel;
},
render: function(){