Skip to content

Instantly share code, notes, and snippets.

View sukhjindersingh's full-sized avatar

Sukhjinder Singh sukhjindersingh

View GitHub Profile
@ummdorian
ummdorian / index.php
Created March 28, 2018 14:57
Drupal 8 Query Alter Group By (views)
<?php
function module_query_views_events_alter(Drupal\Core\Database\Query\AlterableInterface $query){
// If this the right query
if(
$query->getMetaData('view') != ''
&& $query->getMetaData('view')->getDisplay()->display['id'] == 'block_3'
){
@Mulkave
Mulkave / drupal-nginx-virtualhost.conf
Created July 29, 2013 09:08
drupal virtual host configuration for Nginx
server {
server_name [host];
root /var/www/[document_root]; ## <-- Your only path reference.
# Enable compression, this will help if you have for instance advagg module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
@robdecker
robdecker / script.js
Last active August 7, 2020 01:09
[Embed YouTube & Vimeo videos in a Colorbox popup] Requires http://www.jacklmoore.com/colorbox/ #js
(function ($) {
$("#content a[href*='vimeo.com']").each(function() {
$this = $(this);
var href = $this.attr('href');
var vimeoId = href.split('/').pop();
$this.colorbox({ html: function() {
var iframe = '<iframe width="853" height="480" src="http://player.vimeo.com/video/' + vimeoId + '?autoplay=1" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
var output = "<div style='line-height: 0px; overflow: hidden;'>" + iframe + '</div>';
return output;
}});