Skip to content

Instantly share code, notes, and snippets.

View DuaelFr's full-sized avatar

Edouard Cunibil DuaelFr

View GitHub Profile
@quentint
quentint / lando-phpstorm-intellij-idea-phpunit.md
Last active April 27, 2023 21:18
Lando + PHPStorm/IntelliJ IDEA + PHPUnit

Lando + PHPStorm/IntelliJ IDEA + PHPUnit

Context

This gist is a follow-up to this Lando issue, updated for Docker Composer and Windows (but might also help macOS and Linux users).

Steps

Setup Docker

@rkuzsma
rkuzsma / gist:0ceefeb3739b96d16b04342cbc5fe54a
Created May 16, 2019 18:10
How to run an old Firefox browser in Docker Ubuntu with VNC
```
docker run -p 6080:80 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
```
Browse to http://127.0.0.1:6080/
In the VNC UI, run the LXTerminal. Paste these commands to install a given version of Firefox. Set `FF_VERS` to the release you want. See available releases at http://releases.mozilla.org/pub/firefox/releases
```
apt-get update && apt-get install wget
filter:
paths:
- 'module/*'
tools:
php_mess_detector:
config:
code_size_rules: { cyclomatic_complexity: true, npath_complexity: true, excessive_method_length: true, excessive_class_length: true, excessive_parameter_list: true, excessive_public_count: true, too_many_fields: true, too_many_methods: true, excessive_class_complexity: true }
design_rules: { number_of_class_children: true, depth_of_inheritance: true, coupling_between_objects: true }
unused_code_rules: { unused_local_variable: true, unused_private_method: true, unused_formal_parameter: true }
@pounard
pounard / advanced-forum-is-stupid.php
Last active August 29, 2015 14:15
Those lines may save your life whenever you use the advanced_forum module.
/**
* Implements hook_process().
*/
function MYTHEMEORMODULE_process(&$variables, $hook) {
// Seems legit.
// @see laborange2_theme_registry_alter().
if (false === strpos($hook, 'advanced_forum')) {
// This one is a stupid variable mis-use and typo from advanced_forum.
if (!empty($variables['theme_hook_suggestion']) && false !== strpos($variables['theme_hook_suggestion'], 'advanced_forum')) {
// Do not override the 'theme_hook_suggestion' other than advanced
@opi
opi / gist:c0cb89a3b7c934c5fe7a
Created February 6, 2015 14:26
Drupal paragraphs summary
<?php
/**
* @file
* Holds relevant functions for paragraph field formatters.
*/
/**
* Implements hook_field_formatter_info().
*/
@opi
opi / gist:6078227
Last active June 8, 2017 09:52
Simple social links extra_field for drupal.
<?php
// Social share links
$links = array();
$share_url = url('node/'.$node->nid, array('absolute' => TRUE));
$links['facebook'] = array(
'href' => 'https://www.facebook.com/sharer/sharer.php?u='.$share_url,
'title' => t("Facebook"),
'attributes' => array(
'data-popup-width' => 700,
@DuaelFr
DuaelFr / .gitconfig
Last active February 1, 2023 23:34
Useful git config
[alias]
a = add
aa = add -A
ac = "!f() { curl $@ | git apply --index; }; f"
ac3 = "!f() { curl $@ | git apply -3 --index; }; f"
amend = commit --amend -C HEAD
ap = add -p
app = apply --index
br = branch
cb = checkout -b
@davereid
davereid / custom_local.drush.inc
Created July 24, 2012 16:40
Helpful local Drush commands
<?php
/**
* Implements hook_drush_command().
*/
function custom_local_drush_command() {
$items['files-fix-permissions'] = array(
'description' => 'Fix file permissions',
'options' => array(
'owner' => "The name of the user to assign ownership of all files with chown(). Defaults to \$USER.",