Skip to content

Instantly share code, notes, and snippets.

View fabioneves's full-sized avatar

Fábio Neves fabioneves

View GitHub Profile
@fabioneves
fabioneves / skip-permission-check-on-view.patch
Created March 23, 2020 13:43
Drupal 8 - skip permission check on 'view'
diff --git a/modules/gnode/gnode.module b/modules/gnode/gnode.module
index e1daeca..df0d978 100644
--- a/modules/gnode/gnode.module
+++ b/modules/gnode/gnode.module
@@ -146,6 +146,12 @@ function gnode_node_access(NodeInterface $node, $op, AccountInterface $account)
* @see gnode_node_access_records()
*/
function gnode_node_grants(AccountInterface $account, $op) {
+ // Skip group permission check when viewing nodes.
+ // This dramatically improves performance, if you don't want to limit viewing permissions.
@fabioneves
fabioneves / bench.sh
Created October 19, 2018 17:19
Little script to test download of different locations with various statistics
#!/usr/bin/env bash
#
# Description: Auto test download from different locations to measure speed
#
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;94m'
@fabioneves
fabioneves / remove_oauthconnector_patches.patch
Created October 2, 2013 14:06
patch to remove patches from oauthconnect of commerce kickstart
Index: drupal-org.make
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- drupal-org.make (date 1380722655000)
+++ drupal-org.make (revision )
@@ -88,11 +88,8 @@
projects[oauth][patch][] = "http://drupal.org/files/980340-d7.patch"
projects[connector][version] = 1.x-dev
@fabioneves
fabioneves / nginx-box.sh
Last active August 29, 2015 14:19
nginx from scratch
#!/bin/bash
# config
NGINX_USER=nginx
NGINX_VERSION=1.9.0
NGINX_PAGESPEED=1.9.32.3
NGINX_UPLOAD_PROGRESS=0.9.1
PHP_TIMEZONE="Europe\/Lisbon"
PHP_POST_MAX_SIZE=2048M
PHP_UPLOAD_FILESIZE=2048M