Skip to content

Instantly share code, notes, and snippets.

View bdaley's full-sized avatar

Brian Daley bdaley

View GitHub Profile
@bdaley
bdaley / Google-Analytics-Enhanced.html
Created December 10, 2012 19:46
Google Analytics w/ Enhanced Link Attribution
<script type="text/javascript">
var _gaq = _gaq || [];
var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
_gaq.push(['_setAccount', 'UA-XXXXXX-Y']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

Must Have Modules

  • Chaos Tools - Needed for every Drupal module on the planet. Ever. Throughout time.
  • Magic - Some D8 functionality, including scripts in the footer.
  • Module Filter - Filter tool for your modules page.
  • Devel - Helpful development tools
  • Administration Menu - Install this and disable that worthless Toolbar.
  • CKeditor - WYSIWYG editor.
  • IMCE - Manages images and works directly with CKeditor.
  • Speedy - JS and CSS compression.
@bdaley
bdaley / wp_bookmarklet.js
Created January 7, 2015 19:15
WordPress Shortlink Bookmarklet
javascript:(function($){window.prompt('Please copy the short link and press ok',$('link[rel="shortlink"]').attr('href'));})(jQuery);
@bdaley
bdaley / bash-cheatsheet.sh
Created October 20, 2015 02:04 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@bdaley
bdaley / SassMeister-input-HTML.html
Created November 12, 2015 20:20
Generated by SassMeister.com.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SASS Media Queries</title>
<meta name="description" content="A short exercise to demo media queries in SASS">
</head>
<body>
<main>
@bdaley
bdaley / current-theme.php
Last active October 4, 2017 02:56
WordPress: Show Current Theme Template
<?php if(current_user_can( 'manage_options' )): ?>
<!-- A little help for admin users + devs :) -->
<div style="position:fixed;width:100vw;color:#fff;background-color:rgba(0,0,0,.8);z-index:1000;bottom:0;padding:1em;">Theme Template: <?php global $template; echo basename($template); ?></div>
<?php endif; ?>
@bdaley
bdaley / wc-regenerate-and-notify.php
Last active July 28, 2021 00:02
Adds an action to the order page that allows you to regenerate download permissions AND extends the expiration date for WooCommerce downloads.
<?php
add_filter('woocommerce_order_actions', 'wc_regenerate_and_notify_custom_order_action');
function wc_regenerate_and_notify_custom_order_action( $actions ) {
// Remove the woocommerce option to regenerate to avoid confusion
unset($actions['regenerate_download_permissions']);
// Add our new action (executed below)
$actions['wc_regenerate_and_notify'] = __('Regenerate permissions & send link to customer', 'wc-regenerate-and-notify');
return $actions;
@bdaley
bdaley / woocommerce-settings-tab-demo.php
Created January 20, 2018 00:48 — forked from BFTrick/woocommerce-settings-tab-demo.php
A plugin demonstrating how to add a WooCommerce settings tab.
<?php
/**
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@bdaley
bdaley / url-maker-for-blackboard.user.js
Last active December 17, 2018 19:18
Makes student assignment links clickable in Blackboard
// ==UserScript==
// @name URL Maker for Blackboard
// @namespace https://lms.uconn.edu/webapps/assignment/
// @version 0.2
// @description Makes links clickable
// @author Brian Daley <brian@uconn.edu>
// @match https://lms.uconn.edu/webapps/assignment/*
// @grant none
// @downloadUrl https://gist.github.com/bdaley/b0c1a3c36111b4e620c71981ebb83b7b/raw/url-maker-for-blackboard.user.js
// @updateUrl https://gist.github.com/bdaley/b0c1a3c36111b4e620c71981ebb83b7b/raw/url-maker-for-blackboard.user.js
@bdaley
bdaley / Dockerfile
Created May 15, 2019 17:39
Simple Docker Setup for PHP
FROM php:7.3.5-cli-stretch
RUN docker-php-ext-install mysqli