Skip to content

Instantly share code, notes, and snippets.

View lmeurs's full-sized avatar

Laurens Meurs lmeurs

  • wiedes
  • Rotterdam, the Netherlands
View GitHub Profile
@lmeurs
lmeurs / composer.json
Created April 24, 2019 10:07
Composer file for: PHP Code Sniffer + Drupal standards
{
"require": {
"squizlabs/php_codesniffer": "^2.5",
"drupal/coder": "^8.2"
}
}
@lmeurs
lmeurs / cloudSettings
Last active April 27, 2019 12:45
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-04-27T12:45:30.276Z","extensionVersion":"v3.2.9"}
@lmeurs
lmeurs / viewsviewareafilters_handler_area_view.inc
Last active December 2, 2015 07:05
Custom views_handler_area to allow contextual filters for view areas, see issue at https://www.drupal.org/node/2407687.
<?php
/**
* @file
* Definition of views_handler_area_view.
*/
/**
* Views area handlers. Insert a view inside of an area.
*
@lmeurs
lmeurs / commerce_checkout_redirect.module
Last active August 29, 2015 14:11
Overhauled version of Drupal's Commerce Checkout Redirect module
<?php
/**
* @file
* Force anonymous users to login before being able to checkout.
*/
/**
* Implements hook_menu().
*/
function commerce_checkout_redirect_menu() {
@lmeurs
lmeurs / jquery.touchormouse.js
Last active April 4, 2023 18:40
Touch Or Mouse: A jQuery plugin that detects whether an event has been invoked by a touchscreen or a mouse.
/*! Touch Or Mouse - v0.2 - 2014-10-10
* Shared at https://gist.github.com/lmeurs/e5db12f0b3ef43f9cd65
* Demonstrated at http://jsfiddle.net/lmeurs/uo4069nh
* Discussed at http://stackoverflow.com/a/26145343/328272
* Copyright (c) 2014 Laurens Meurs, wiedes.nl; Licensed MIT */
/**
* Touch Or Mouse: A jQuery plugin that detects whether an event has been
* invoked by a touchscreen or a mouse.
*
/**
* jQuery.browser.mobile (detectmobilebrowser.com)
*
* detectmobilebrowser.com says: "Regex updated: 9 September 2013"
*
* We added tablet support by adding `|android|ipad|playbook|silk` to the first
* regular expression. Also see detectmobilebrowsers.com/about.
*/
(function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-