Skip to content

Instantly share code, notes, and snippets.

Avatar

Aaron Carlino unclecheese

  • Uncle Cheese Productions
  • Wellington, New Zealand
View GitHub Profile
View FluentQueryPlugin.php
<?php
namespace MyProject;
use SilverStripe\GraphQL\Schema\Field\Query;
use SilverStripe\GraphQL\Schema\Interfaces\QueryPlugin;
use SilverStripe\GraphQL\Schema\Interfaces\SchemaUpdater;
use SilverStripe\GraphQL\Schema\Schema;
@unclecheese
unclecheese / cow-compare.php
Created Sep 23, 2019
Generates Github compare links between two given tags of a silverstripe module
View cow-compare.php
#!/usr/bin/env php
<?php
$path = isset($argv[1]) ? $argv[1] : './';
$isMinor = isset($argv[2]) && $argv[2] === '-m';
$path = rtrim($path, '/') . '/';
$lockFile = $path . 'composer.lock';
if (!file_exists($lockFile)) {
View NavigatorInjection.php
<?php
namespace SilverStripe\Bambusa\Extensions;
use JonoM\BetterNavigator\Extension\BetterNavigatorExtension;
use SilverStripe\ORM\Extension;
use SilverStripe\ORM\FieldType\DBHTMLText;
View UnionList.php
<?php
namespace SilverStripe\Snapshots;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\ORM\Connect\Query;
use SilverStripe\ORM\Limitable;
use SilverStripe\ORM\Queries\SQLSelect;
View Read.php
<?php
namespace SilverStripe\GraphQL\Scaffolding\Scaffolders\CRUD;
use Exception;
use GraphQL\Type\Definition\InputObjectType;
use GraphQL\Type\Definition\ResolveInfo;
use SilverStripe\Core\ClassInfo;
use SilverStripe\GraphQL\Manager;
use SilverStripe\GraphQL\OperationResolver;
View 00_GridFieldRegistry.php
<?php
class GridFieldRegistry
{
public function add($identifier, GridField $gridField)
{
if ($identifierIsNotUnique) { throw... }
$this->registry[] = new GridFieldRegistration(
$identifier,
View Page_Controller.php
<?php
class Page_Controller extends ContentController
{
public function init()
{
parent::init();
Requirements::javascript('framework/thirdparty/jquery/jquery.js');
Requirements::javascript('themes/simple/javascript/script.js');
}
View YourPage.php
<?php
class YourPage extends Page
{
private static $has_one = [
'Slideshow1' => 'Image',
'Slideshow2' => 'Image',
// etc..
];
View 1_GraphQLScaffolder.php
<?php
class GraphQLScaffolder
{
const READ
const UPDATE
const DELETE
const CREATE
/**
@unclecheese
unclecheese / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console