Skip to content

Instantly share code, notes, and snippets.

View patrickisgreat's full-sized avatar

Patrick Bennett patrickisgreat

View GitHub Profile
function addConditionalPlugins(plugins) {
const config = AppConfig.get();
if (config.responseCacheEnabled) {
plugins.push(
responseCachePlugin({
sessionId: async (requestContext) =>
requestContext.request.http?.headers.get("sc-user") ?? null,
})
);
@charset "utf-8";
/*************************************************
ABOVE THE REST LUXURY CABINS
Custom CSS for Design System | Michael Crowe
*************************************************/
/* TOKENS
==============================================
Color scale */
:root {
<?php
use ExactTarget\ET_Get;
use ExactTarget\ET_Client;
use ExactTarget\ET_Subscriber;
use Illuminate\Http\Request;
class TestController extends Controller
{
/**
<html>
<head>
<title>For Randy</title>
<style type="text/css">
.column {
float: left;
width: 23%;
background: #ccc;
margin: 10px 1%;
@patrickisgreat
patrickisgreat / forRandy.js
Created October 28, 2016 23:41
Resizing stuff to make it more responsiverizedly for RGarcia
//▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼ SCREEN-SIZE LOGIC ▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲//
$(document).ready(function() {
$window = $(window);
function makeColumnHeightsMatch(container) {
let elementHeights = $(container).map(function() {
return $(this).height();
}).get();
@patrickisgreat
patrickisgreat / PermissionRegistrar.php
Created October 24, 2016 18:27
just to show modern PHP structure
<?php
namespace App\Http\Middleware;
use Closure;
use Exception;
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Contracts\Cache\Repository;
use Log;
use App\Contracts\Permission;
@patrickisgreat
patrickisgreat / CategoryController.php
Created August 10, 2016 15:29
Example Implementation of Baum/Node in Laravel Spark App
<?php
namespace App\Http\Controllers\API;
use App\Repositories\CategoryRepository;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Permission;
use App\Category;
use Debugbar;
@patrickisgreat
patrickisgreat / LaravelExample.php
Created August 3, 2015 16:14
Quick and Dirty Laravel Many to Many example
//So you have your pivot table all set up.... So in a "Role," model (ha!) you would set up a many to many relationship like so:
<?php
public function users()
{
return $this->belongsToMany('\App\User');
}
//and in your User model you would do something like:
public function roles()
{
@patrickisgreat
patrickisgreat / createDE.php
Created April 22, 2015 20:54
handle method creates 4 DEs in Exact Target via Fuel-SDK
/**
* Execute the command.
*
* @return void
*/
public function handle()
{
//boostrap SDK
$slncClient = new ET_Client('slnc');
$postDE = new ET_DataExtension();