Skip to content

Instantly share code, notes, and snippets.

View sageworksstudio's full-sized avatar

Chris Brown sageworksstudio

View GitHub Profile
@sageworksstudio
sageworksstudio / SS-modelAdmin.php
Created April 19, 2019 17:29 — forked from dljoseph/SS-modelAdmin.php
SilverStripe 3.1.x add date range filters to modeladmin
<?php
class MyDataObjectAdmin extends ModelAdmin {
private static $managed_models = array('MyDataObject'); // Can manage multiple models
private static $url_segment = 'my-data-object'; // Linked as /admin/my-data-object/
private static $menu_title = 'My DataObjects';
public function getSearchContext() {
@sageworksstudio
sageworksstudio / Stripe Example
Last active August 29, 2015 14:17 — forked from boucher/gist:1750375
Stripe PHP example
<?php
require('./lib/Stripe.php');
if ($_POST) {
// Set your secret key: remember to change this to your live secret key in production
Stripe::setApiKey("SECRET_KEY");
$error = '';
$success = '';
// Create the charge on Stripe's servers - this will charge the user's card