Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tom Shafer tshafer

🏠
Working from home
View GitHub Profile
View gist:306ed82964ee1f6e9d0dbfa324ccf340
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
import {
createDropdown,
addToolbarToDropdown
} from '@ckeditor/ckeditor5-ui/src/dropdown/utils';
export default class MergeFields extends Plugin {
static get pluginName() {
return 'mergeFields';
}
View gist:078ec6f3508ffef0afb478127adf5046
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ValidateEntryRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
View gist:3d0e9b743f0ba6437c1b17148628da56
{"listInfo":{"startingIndex":0,"size":1,"available":1},"emails":[{"id":666,"subject":"dmharris 20181012 test","openCount":0,"recipientCount":4,"clickCount":0,"deliveryDate":"20181012134511"}]}
{"listInfo":{"startingIndex":0,"size":21,"available":21},"emails":[{"id":1,"subject":"test email number 1","openCount":9,"recipientCount":100,"clickCount":3,"deliveryDate":"20180101124500"},{"id":2,"subject":"test email number 2","openCount":20,"recipientCount":100,"clickCount":13,"deliveryDate":"20180201144500"},{"id":3,"subject":"test email number 3","openCount":47,"recipientCount":100,"clickCount":20,"deliveryDate":"20180301144500"},{"id":4,"subject":"test email number 4","openCount":39,"recipientCount":100,"clickCount":10,"deliveryDate":"20180401144500"},{"id":5,"subject":"test email number 5","openCount":34,"recipientCount":100,"clickCount":7,"deliveryDate":"20180501144500"},{"id":6,"subject":"Email 6 dear staffers this is a really long subject that is annoying","openCount":34,"recipientCount":100,"clickCount":2
@tshafer
tshafer / Run docker container with Sentry
Created Jul 12, 2017 — forked from mnvx/Run docker container with Sentry
Simple script for runniing docker container with Sentry inside VirtualBox according with instruction https://hub.docker.com/_/sentry/
View Run docker container with Sentry
#!/bin/bash
echo
echo '-- STOP --'
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
echo
echo '-- START --'
View gist:e8f56ce747e2ddc5647de752a34b9d0e
if ( ! function_exists('lead_image')) {
/**
* * Display the post image
*/
function lead_image()
{
$categories = get_the_terms(get_the_ID(), 'category');
$dataCategory = [];
if ( ! empty($categories)) {
foreach ($categories as $category) {
View gist:d8609ee81cd50908badbfbcb8a61fce2
$customFields = json_decode($value, true);
if ( ! empty($customFields)) {
$attributes = [];
foreach ($customFields as $custom_field) {
$customFieldData = explode('::::', $custom_field);
$attributes[head($customFieldData)] = end($customFieldData);
}
return $this->attributes['custom_fields'] = json_encode($attributes);
View gist:10d03e65f757b0347af3b805f6c2d1cc
foreach ($this->teams($user) as $team) {
$permissions[$team->id] = array_dot(app(RoleRepository::class)->permissions($user->roleOn($team)));
}
Vue.directive('permission', function (el, binding) {
let idPermission = binding.value.split('_');
let team = idPermission[0];
let permission = idPermission[1];
View ad.js
//Sample JavaScript implementation
var w = window,
sf = w.$sf,
sfAPI = sf && sf.ext,
myPubCookieValue = "",
settingCookie = false;
//Register the status update listener
function register_content() {
View ad.js
<div id="container">
<style type="text/css">
body, html {
margin:0;
padding:0;
}
</style>
<script>
View ad.js
var w = window,
sf = w["$sf"],
sfAPI = sf && sf.ext,
// Set cookie name
myPubCookieName = "foo",
myPubCookieValue = "washingtonian-dropdown-ad-viewed",
fetchingCookie = false; // Flag
function register_content() {