Skip to content

Instantly share code, notes, and snippets.

View seafarer's full-sized avatar
☎️
DM me, maybe

Colin OBrien seafarer

☎️
DM me, maybe
View GitHub Profile
@seafarer
seafarer / template.php
Created October 20, 2015 15:40 — forked from gildotdev/template.php
Drupal 7 hook method to remove cache busting query strings on css and js files. Related to this post https://drupal.org/node/242875
<?php
/**
* Implements hook_process_html
*/
function templatenamespace_process_html(&$vars) {
$search = array('scripts' => 'src=', 'styles' => 'href=', 'styles' => '@import\surl\(');
foreach ( $search as $var => $word ) {
if ( !empty($vars[$var]) ) {
add_action( 'wp_dashboard_setup', 'register_my_dashboard_widget' );
function register_my_dashboard_widget() {
wp_add_dashboard_widget(
'my_dashboard_widget',
'My Dashboard Widget',
<form id="contact" name="contact" method="post">
<fieldset>
<label for="name" id="name">Name<span class="required">*</span></label>
<input type="text" name="name" id="name" size="30" value="" required/>
<label for="email" id="email">Email<span class="required">*</span></label>
<input type="text" name="email" id="email" size="30" value="" required/>
<label for="phone" id="phone">Phone</label>
<input type="text" name="phone" id="phone" size="30" value="" />
# Requre a specific version in this file:
# gem 'zurb-foundation', '=4.3.1'
require 'zurb-foundation'
# Require any additional compass plugins here.
# IE 9 and below only support up to 4095 CSS selectors
# This class will split all selectors after that point
class CssSplitter
def self.split(infile, outdir = File.dirname(infile), max_selectors = 4095)