Skip to content

Instantly share code, notes, and snippets.

View skwashd's full-sized avatar
👨‍💻
planning, coding, reviewing

Dave Hall skwashd

👨‍💻
planning, coding, reviewing
View GitHub Profile
@skwashd
skwashd / console.js
Created June 12, 2014 08:15
console.log() for IE
// Lifted from https://stackoverflow.com/a/22103222
if (typeof console === "undefined" || typeof console.log === "undefined") {
console.log = function(msg) {
alert(msg);
};
}
@skwashd
skwashd / SA-CORE-2014-005.patch
Created October 15, 2014 16:03
SA-CORE-2014-005
From 26a7752c34321fd9cb889308f507ca6bdb777f08 Mon Sep 17 00:00:00 2001
From: David Rothstein
Date: Wed, 15 Oct 2014 14:31:54 +0000
Subject: SA-CORE-2014-005 by Stefan Horst, greggles, larowlan, David_Rothstein, klausi: Fixed SQL injection vulnerability
---
diff --git a/includes/database/database.inc b/includes/database/database.inc
index f78098b..01b6385 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@skwashd
skwashd / find-submodules.sh
Created October 22, 2014 09:53
Find all modules with sub modules
cd /path/to/modules/contrib && for module in $(gfind -type d -maxdepth 1 | cut -d/ -f2); do gfind $module -name \*.info ! -name $module.info; done
@skwashd
skwashd / binaryCounter.ino
Last active June 2, 2016 02:02
Binary Counter for Arduino
/**
* Binary Counter for Arduino
*
* Designed as a project for students to introduce them to Arduinos and
* programming.
*
* Written by Dave Hall - http://davehall.com.au
*/
// Define our LED pins.
@skwashd
skwashd / snippet.sh
Created April 30, 2015 06:33
Find out what is generating the front page of a #drupal site
drush eval 'drush_print_r(menu_get_item(variable_get("site_frontpage")));'
@skwashd
skwashd / my.module
Created May 26, 2015 23:43
Changing the title of the contact form in Drupal
<?php
/**
* Implements hook_menu_alter().
*/
function my_menu_alter(&$items) {
$items['contact']['title'] = 'Contact Me';
}
@skwashd
skwashd / example.patch
Created June 18, 2015 03:17
Example failing patch
From 4800290372e085a4d26bf961f19d27eb6bef9805 Mon Sep 17 00:00:00 2001
From: A User <[email protected]>
Date: Sun, 14 Jun 2015 22:05:23 +1000
Subject: [PATCH] Add label for 'old' entity to the diff data
---
modules/deploy_services/deploy_services.services.inc | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules/deploy_services/deploy_services.services.inc b/modules/deploy_services/deploy_services.services.inc
@skwashd
skwashd / .gitignore
Last active August 29, 2015 14:23
My global .gitignore file
#
# Global .gitignore file.
#
# Created by Dave Hall (@skwashd) - http://davehall.com.au
#
# See https://help.github.com/articles/ignoring-files/#create-a-global-gitignore for installation instructions.
#
# Licensed under the terms of the WTFPL - http://www.wtfpl.net/txt/copying/
#
@skwashd
skwashd / composer.json
Created November 13, 2015 23:15
Example of composer-patches 2.x composer.json file
{
"require": {
"cweagans/composer-patches": "dev-master",
"drupal/drupal": "8.0.*@dev"
},
"config": {
"preferred-install": "source"
},
"repositories": [{
"type": "vcs",
@skwashd
skwashd / Dockerfile
Created November 16, 2015 01:14
Dependencies for Pycrypto on Iron Worker
FROM iron/python:2-dev
RUN apk update && apk upgrade
RUN apk add openssl
RUN apk add alpine-sdk
RUN apk add autoconf
RUN apk add python-dev