Skip to content

Instantly share code, notes, and snippets.

View jedateach's full-sized avatar
🤓

Jeremy Shipman jedateach

🤓
View GitHub Profile
@jedateach
jedateach / howliquidfireanimationworks.md
Last active August 26, 2015 23:31
How Liquid-Fire Fade Slide Fade Animation works

How Liquid Fire FSF Animation Works

Each helper produces two wrapping div elements to aid in the animation:

  • liquid-container
  • liquid-child

The liquid-container introduces relative positioning for the children, and also handles the resizing height/width with slide animation. The liquid-child contains the actual content, and is the element that will be faded / unfaded. The 'old-child' will be completely replaced with a 'new-child' after the animation has completed.

@jedateach
jedateach / blah.php
Created April 23, 2014 22:57
Silverstripe non-associative array config
<?php
public function getRequiredFields() {
$fields = self::config()->required_fields;
//hack to allow overriding arrays in ss config
if(self::$required_fields != $fields){
foreach(self::$required_fields as $requirement){
if(($key = array_search($requirement, $fields)) !== false) {
unset($fields[$key]);
}
@jedateach
jedateach / _ss_environment.php
Created May 16, 2014 21:45
Localhost ss environment file
<?php
//set up reporting level, depending on ss version
if(strrpos($_SERVER['SCRIPT_NAME'], 'sapphire') !== false){
error_reporting(E_ERROR | E_WARNING | E_PARSE);
}else{
error_reporting(E_ALL);
}
define('SS_GEM_PATH', '/usr/bin/');
@jedateach
jedateach / OverviewLink.php
Last active August 29, 2015 14:06
Shortcodable Dev
@jedateach
jedateach / OrderProcessor.php
Created February 3, 2015 04:53
Previously sOtripped out StatusLog functionality
<?php
class OrderProcessor {
/**
* Send a message to the client containing the latest
* note of {@link OrderStatusLog} and the current status.
*
* Used in {@link OrderReport}.
*
@jedateach
jedateach / process.php
Last active August 29, 2015 14:18
New BulkLoading Process
<?php
/**
* process:
* raw data is extracted using BulkLoaderSource as iterable rows
* row data is mapped into a standardised form
* standard form is transformed into a placeholder dataobject
*/
//raw data
@jedateach
jedateach / paymentexample.php
Created April 2, 2012 21:03
New payment API example
<?php
//buyable has one or many payments
//should this be absolutely required?
$buyable;
//creating a new payment
//this will inject the appropriate gateway automatically, if one exists
$payment = new PaypalPayment(); //or
$payment = Payment::create('PaypalPayment');
<?php
//
$payment->returnTo($controller,$action,$id);
$payment->process();
class PaymentGatewayController extends Controller{
@jedateach
jedateach / gist:2289055
Created April 3, 2012 03:25
Planning new ShoppingCart system
<?php
/*
* goal: build SQL filter, based on parameter array
*/
//a hypothetical filter(parameters) for a new order item.
//This data would typically come from request parameters.
$filter = array(
'Size' => 20,
@jedateach
jedateach / MatchObjectFilter.php
Created April 15, 2012 23:50
Planning the ShoppingCart custom products system
<?php
/**
* Helper class to create a filter for matching a dataobject,
* using field values or relationship ids and only those ids.
*
* Combining fields defines a way to uniquely identify an object.
*
* Useful for finding if a dataobject with given field values exists.
* Protects against SQL injection, and searching on unauthroised fields.