Skip to content

Instantly share code, notes, and snippets.

View philwolstenholme's full-sized avatar

Phil Wolstenholme philwolstenholme

View GitHub Profile
@philwolstenholme
philwolstenholme / example_response.json
Last active February 26, 2018 14:18
Corrupted Drupal AJAX response JSON (potentially) as a result of the Ghost Inspector Chrome plugin
[{"command":"settings","settings":{"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"london_plan","theme_token":"EER5So6oi7xk_WA15TAY7yhCtIlfsjhC9tpZ_dx4v88"}},"merge":true},{"command":"insert","method":"append","selector":"div#ajax-status-messages-wrapper","data":"\u003Cdiv class=\u0022messages-container\u0022\u003E\n\u003Cdiv class=\u0022messages status\u0022 role=\u0022contentinfo\u0022 aria-label=\u0022Status message\u0022\u003E\n\u003Cdiv role=\u0022status\u0022\u003E\n\u003Ch2 class=\u0022element-invisible\u0022\u003EStatus message\u003C\/h2\u003E\nThank you, your comment has been submitted\u003C\/div\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n","settings":null},{"command":"invoke","selector":null,"method":"updateAJAXCommentCount","arguments":["Thank you, your comment has been submitted"]},{"command":"modal_dismiss"},{"command":"insert","method":"append","selector":"div#ajax-status-messages-wrapper","data":"\u003Cdiv class=\u0022messages-container\u0022\u003E\n\u003Cdiv class=\u0022messages st
<?php
/**
* Implements hook_views_post_render().
*/
function MODULE_NAME_views_post_render($view) {
if ($view->id() !== 'VIEW_ID' && $view->getDisplay()->getPluginId() !== 'page') {
return;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Countdown</title>
<meta name="author" content="">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="//code.jquery.com/jquery.js"></script>
/*
Credit to https://github.com/bsuresh, I'm just saving this as a gist for my own reference
*/
/* Content to extend beyond the boundaries of our container and span
to full width of viewport */
.u-breakout {
margin-left: calc(-50vw + 50%);
margin-right: calc(-50vw + 50%);
clear: both;
@philwolstenholme
philwolstenholme / SassMeister-input-HTML.html
Created January 21, 2016 16:39
Generated by SassMeister.com.
<div class="container">
<div class="box">Kinda works</div>
</div>
<div class="container">
<div class="box">Shame the gutter is applied with padding rather than a margin though</div>
</div>
@philwolstenholme
philwolstenholme / StupidJira.js
Last active October 28, 2015 15:04 — forked from mikebell/StupidJira.js
Adds an input to the Jira operations toolbar which contains a git command to create a new branch
// ==UserScript==
// @name StupidJira
// @namespace http://mikebell.io
// @version 0.1
// @description Add branch details
// @match https://jira.ctidigital.com/browse/*
// @grant none
//allow pasting
// ==/UserScript==
@philwolstenholme
philwolstenholme / gist:203c586fdfd99169c3c4
Created April 26, 2015 12:13
Add a theme-color meta tag to your Drupal site (within your theme's template.php)
/*
* Implements template_preprocess_html()
* Preprocess variables for the html template file.
*
*/
function YOUR_THEME_NAME_preprocess_html(&$variables) {
$android5_theme_color = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
@philwolstenholme
philwolstenholme / gist:bebd63911db7011a7a1b
Last active August 29, 2015 14:19
Extended Jira timestamps
// ==UserScript==
// @name Extended Jira timestamps
// @namespace https://wolstenhol.me
// @version 0.1
// @author Phil Wolstenholme
// @match https://jira.ctidigital.com/*
// @grant none
// @downloadURL https://gist.githubusercontent.com/philwolstenholme/bebd63911db7011a7a1b/raw/ce8bde9d87d97377789e4d123f66461eed52848b/gistfile1.js
// @updateURL https://gist.githubusercontent.com/philwolstenholme/bebd63911db7011a7a1b/raw/ce8bde9d87d97377789e4d123f66461eed52848b/gistfile1.js
// ==/UserScript==
@philwolstenholme
philwolstenholme / bookmarklet
Created April 24, 2015 09:35
Lorem ipsum bookmarklet
javascript:(function()%7Bvar%20lorem%20%3D%20'Lorem%20ipsum%20dolor%20sit%20amet%2C%20consectetur%20adipiscing%20elit%2C%20sed%20do%20eiusmod%20tempor%20incididunt%20ut%20labore%20et%20dolore%20magna%20aliqua.%20Ut%20enim%20ad%20minim%20veniam%2C%20quis%20nostrud%20exercitation%20ullamco%20laboris%20nisi%20ut%20aliquip%20ex%20ea%20commodo%20consequat.%20Duis%20aute%20irure%20dolor%20in%20reprehenderit%20in%20voluptate%20velit%20esse%20cillum%20dolore%20eu%20fugiat%20nulla%20pariatur.%20Excepteur%20sint%20occaecat%20cupidatat%20non%20proident%2C%20sunt%20in%20culpa%20qui%20officia%20deserunt%20mollit%20anim%20id%20est%20laborum'%3BjQuery(document.activeElement).val(lorem)%7D)()