Skip to content

Instantly share code, notes, and snippets.

View aronbeal's full-sized avatar

Aron Beal aronbeal

  • Beal Consulting
  • Vancouver, BC
View GitHub Profile
@aronbeal
aronbeal / fix_permissions.sh
Created July 12, 2013 17:53
Drupal site securing script
#!/bin/bash
if [ $(id -u) != 0 ]; then
printf "This script must be run as root.\n"
exit 1
fi
#TODO: change these variables to be the apache user and a group consisting of all users who
# need write access
drupal_path=${1%/}
@aronbeal
aronbeal / phing.py
Last active December 21, 2015 11:19
Modifications to phing.py in Sublime Text Phing Plugin by nLight to get it to work in ST3
#encoding:utf-8
import re
import sublime, sublime_plugin
import xml.etree.ElementTree as ET
class PhingCommand(sublime_plugin.WindowCommand):
def run(self):
if(len(self.window.folders()) == 0):
print("No folders found.")
<?php
namespace NNLM\Drush\Utility;
/**
*
*/
class LinkTree {
// The root of the node tree we will build
private $root = NULL;
#!/usr/bin/python
#Script by Rishab Arora (spacetime), modified by Aron Beal
from urllib import urlopen
import smtplib
import logging
import socket
sender = '[your email address]'
recipients = ['[your email address again]']
subject = 'Nexus 6 back in stock!'
@aronbeal
aronbeal / salt_url
Created November 19, 2014 19:50
Adds an hourly 'salt' to a url query string. For help with Google Feed cache busting.
var salt_url = function(url) {
var salt_string = (new Date()).getHours(); //force hourly change for update
var a = document.createElement('a');
a.href = url;
//add in salt as a query parameter
var modified_query_string = a.search;
if (modified_query_string !== '') {
modified_query_string += '&slt=' + salt_string;
} else {
modified_query_string = '?slt=' + salt_string;
@aronbeal
aronbeal / Gruntfile.js
Created November 21, 2014 18:59
Gruntfile for large builds
/**
* Generic form of Gruntfile - moves task and configuration
* definition to the grunt_tasks and grunt_tasks/options
* folders, respectively for organization.
*/
module.exports = function(grunt) {
'use strict';
var path = require('path');
var timestamp = require('monotonic-timestamp');
@aronbeal
aronbeal / http-vhosts-with-ssl.conf
Last active January 24, 2019 11:19
SSL Dynamic VirtualHost Configuration
<Virtualhost *:80>
Options +Indexes +FollowSymLinks
UseCanonicalName Off
VirtualDocumentRoot [User home directory]/Sites/%1
php_value include_path ".:[User home directory]/Sites"
AddType application/x-httpd-php .html
ServerName dev
ServerAlias *.dev
ErrorLog "[User home directory]/Sites/logs/error_log"
CustomLog "[User home directory]/Sites/logs/access_log" common
@aronbeal
aronbeal / CKEditor:-filtered-data-user-messaging.markdown
Created February 18, 2015 20:05
CKEditor: filtered data user messaging

CKEditor: filtered data user messaging

An example of messaging a user in CKEditor when data is filtered.

A Pen by Aron Beal on CodePen.

License.

│ Fields in node not in entity: Array
│ (
│ [1] => cid
│ [5] => data
│ [43] => field_download_images
│ [137] => last_comment_name
│ [138] => last_comment_timestamp
│ [139] => last_comment_uid
│ [141] => name
│ [143] => picture
@aronbeal
aronbeal / behat.yml
Created May 26, 2016 23:51
Example large behat config file
# Top level is a 'profile'. We have been correlating our profiles with drupal
# content types. Time will tell if this is a best practice or not
default:
suites:
default:
contexts:
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\DrupalExtension\Context\DrushContext