Skip to content

Instantly share code, notes, and snippets.

View shaal's full-sized avatar

Ofer Shaal shaal

View GitHub Profile
@shaal
shaal / sassrosenberg.theme
Created March 2, 2018 18:15
Drupal8 preprocess menu - Hide "About" Menu Item (from Main Menu), if current node title is "Who are we?"
/**
* Implements hook_preprocess_menu() for menu.html.twig.
*/
use Drupal\node\Entity\Node;
function sassrosenberg_preprocess_menu(&$variables, $hook)
{
if ($hook == 'menu__main') {
<?php
namespace Drupal\commerce_taxcloud\Plugin\Commerce\TaxType;
use CommerceGuys\Addressing\AddressInterface;
use Drupal\commerce_order\Adjustment;
use Drupal\commerce_order\Entity\OrderInterface;
use Drupal\commerce_order\Entity\OrderItemInterface;
use Drupal\commerce_price\RounderInterface;
use Drupal\commerce_tax\Annotation\CommerceTaxType;
@shaal
shaal / colliding.js
Created August 7, 2017 14:38 — forked from jtsternberg/colliding.js
Detect if two elements are colliding/overlapping
/**
* Detects if two elements are colliding
*
* Credit goes to BC on Stack Overflow, cleaned up a little bit
*
* @link http://stackoverflow.com/questions/5419134/how-to-detect-if-two-divs-touch-with-jquery
* @param $div1
* @param $div2
* @returns {boolean}
*/
@shaal
shaal / designer.html
Created October 1, 2015 22:18
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;