Skip to content

Instantly share code, notes, and snippets.

View use's full-sized avatar

Will Hall use

  • Eastern Washington University
  • WA, USA
View GitHub Profile
@use
use / UpdateLogger
Last active February 23, 2024 19:17
// bark's prototype insert example 240220
List fclog = new List(); // the log, for the insert
SObjectType triggerType = trigger.new.getSObjectType(); // the object name
List idx = [SELECT FieldName__c, Default__c FROM FieldChangeIndex__c WHERE Object__c =
:triggerType.getDescribe().getLabel() ]; // for the WHERE clause.
if (idx.isEmpty()) {
return;
}
for ( sObject trigRecs : Trigger.new ) { // the records that changed
@use
use / init.txt
Created June 5, 2017 02:31
Testing init.txt for Nicol Bolas, God-Pharoh on xmage
battlefield:Human:Swamp:6
battlefield:Human:Mountain:6
battlefield:Human:Island:6
battlefield:Computer:Grizzly Bears:1
battlefield:Computer:Fugitive Wizard:2
library:Human:Mountain:50
library:Computer:Lightning Bolt:1
library:Computer:Mountain:20
library:Computer:Lightning Bolt:1
library:Computer:Mountain:20
@use
use / init.txt
Created June 4, 2017 17:32
Testing init.txt for Samut, the Tested on xmage
battlefield:Human:Forest:6
battlefield:Human:Mountain:6
battlefield:Computer:Grizzly Bears:1
battlefield:Computer:Fugitive Wizard:2
library:Human:Xenagos, God of Revels:1
library:Human:Emrakul, the Aeons Torn:1
library:Human:Siege Rhino:1
library:Human:Nahiri, the Harbinger:1
library:Human:Lightning Bolt:1
library:Human:Mountain:55
@use
use / ExampleSearchExtension.php
Created November 9, 2016 21:24
Example of how to create a custom search feature for the Bolt CMS, by making a local extension
<?php
namespace Bolt\Extension\DesignSpike\ExampleSearch;
use Bolt\Extension\SimpleExtension;
use Bolt\Routing\ControllerCollection;
use Doctrine\DBAL\Query\QueryBuilder;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@use
use / init.txt
Created January 24, 2016 01:23
For testing Ceaseless Searblades
battlefield:Human:Wandering Fumarole:1
battlefield:Human:Mountain:10
battlefield:Human:Island:6
library:Human:Mountain:25
library:Human:Ceaseless Searblades:25
library:Human:Mountain:25
library:Computer:Plains:100
graveyard:Computer:Plains:1
hand:Human:Ceaseless Searblades:1
hand:Human:Flamekin Harbinger:1
@use
use / menu_schema.yml
Created October 19, 2015 23:47
Schema for bolt/bolt's menu.yml file using romaricdrigon/MetaYaml
root:
_type: prototype
_prototype:
_type: partial
_partial: menu
partials:
menu:
_type: prototype
_prototype:
@use
use / contenttypes_schema.yml
Created October 19, 2015 23:44
Schema for bolt/bolt's contenttypes.yml file using romaricdrigon/MetaYaml
root:
_type: prototype
_prototype:
_type: array
_children:
default_status:
_type: enum
_values: [publish, held, draft, timed]
description:
_type: text
@use
use / contenttypes.yml
Created May 1, 2015 22:14
sorting example for bolt contenttypes
homepage:
name: Homepage
slug: homepage
singular_name: Homepage feature
singular_slug: homepagefeature
fields:
title:
type: text
class: large
required: true
<?php
require_once __DIR__ . '/vendor/autoload.php';
$configuration = new Bolt\Configuration\Composer(__DIR__);
$configuration->setPath('cache', 'cache');
$configuration->setPath('config', 'app/config');
$configuration->setPath('database', 'app/database');
$configuration->setPath('files', 'content/files');
$configuration->setPath('web', 'content');
$app = new Bolt\Application(array('resources'=>$configuration));
@use
use / thumbnail_calculate.py
Last active August 29, 2015 14:08
Find candidate thumbnail widths (x) and gap widths (y) with min/max constraints and fixed total width
def thumbnail_width_candidates(mingap, maxgap, minwidth, maxwidth, numitems, totalwidth):
return [
(x, y)
for y in range(mingap, maxgap)
for x in range(minwidth, maxwidth)
if
x%1==0 and
y%1==0 and
x*numitems + y*(numitems-1) == totalwidth
]