Skip to content

Instantly share code, notes, and snippets.

@malcomio
malcomio / dabblet.css
Created January 22, 2014 11:13
Table hover borders
/**
* Table hover borders
*/
table {
border-collapse: collapse;
}
tr {
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
@malcomio
malcomio / gist:cace0105f8389936b4858012b5df1040
Last active April 18, 2023 16:18
A Framework For Progressively Decoupled Drupal
Decoupling content and presentation is all very well in theory, but is there a better way than going fully headless?
What do you do if you want Drupal to provide server-side rendered content pages, but you want to couple it with the rich interactivity of a modern JavaScript application?
What if you don't want the complexity of a headless CMS and a fully decoupled presentation layer?
This talk will provide an introduction to the Single Page Application Landing Page module - a framework for managing content and configuration for JavaScript applications that sit on Drupal pages.
More information at:
@malcomio
malcomio / my.cnf
Created May 3, 2016 09:04
MySQL settings for DrupalVM with increased memory etc
[client]
#password = your_password
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld]
port = 3306
bind-address = 0.0.0.0
datadir = /var/lib/mysql
socket = /var/run/mysqld/mysqld.sock
Welcome to Pa11y
> PhantomJS browser created
> Testing the page "https://capgemini.github.io/cloud/Managing-Cloud-Infrastructure-in-Amazon-Web-Service-using-VoiceOps/"
Results for https://capgemini.github.io/cloud/Managing-Cloud-Infrastructure-in-Amazon-Web-Service-using-VoiceOps/:
• Notice: Check that the title element describes the document.
├── WCAG2AA.Principle2.Guideline2_4.2_4_2.H25.2
@malcomio
malcomio / _pa11y errors for capgemini.github.io
Last active August 30, 2017 12:15
Pa11y results for capgemini.github.io - errors only
pa11y https://capgemini.github.io --ignore "warning;notice"
pa11y https://capgemini.github.io/categories --ignore "warning;notice"
pa11y https://capgemini.github.io/cloud/Managing-Cloud-Infrastructure-in-Amazon-Web-Service-using-VoiceOps/ --ignore "warning;notice"
<?php
// your connection
mysql_connect("localhost","root","root");
mysql_select_db("d6");
// convert
$result = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($result)) {
foreach ($row as $key => $table) {
@malcomio
malcomio / gist:8556964
Created January 22, 2014 11:05
Example of Drupal's hook_css_alter and hook_js_alter to remove unwanted core and contrib styles and scripts.
/**
* Implements hook_js_alter().
*
* Remove unwanted module JS.
*/
function mytheme_js_alter(&$javascript) {
$removal_list = array(
'google_cse' => array(
'/google_cse.js',
@malcomio
malcomio / dabblet.css
Created December 31, 2013 15:26
Advent calendar doors.
/**
* Advent calendar doors.
*/
body {
background: #000;
}
.views-row {
margin: 1em;
float: left;
@malcomio
malcomio / gist:6386306
Last active December 21, 2015 23:59
Drupal 7 View to display top artist images from a last.fm audioscrobbler feed. Depends on the following modules: Views Views XML Backend
$view = new view();
$view->name = 'last_fm_artists';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'xml';
$view->human_name = 'Last.fm artists';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@malcomio
malcomio / codepen.module
Created November 24, 2015 20:32
Add Codepen embed JS to Drupal
drupal_add_js('//assets.codepen.io/assets/embed/ei.js', array(
'type' => 'external',
'scope' => 'footer',
));