Skip to content

Instantly share code, notes, and snippets.

View Luukyb's full-sized avatar

Luc Bézier Luukyb

View GitHub Profile
Below is the template for Drupal Docksal README, complete the items with "<>".
# <Project Name>
This is the source code for the official website of <Project name> based on Drupal <version>.
## Requirements
* [Git](https://git-scm.com/)
* [Composer](https://getcomposer.org/download/)
@Luukyb
Luukyb / routes.php
Created April 24, 2017 13:23
Set Laravel's user password, for development. Place the snippet in your app/routes.php file, on the homepage's route.
$user = User::find(27);
$user->password = Hash::make('test');
$user->save();
@Luukyb
Luukyb / settings.local.php
Last active April 13, 2018 08:25
D7 example of settings.local.php for local development.
<?php
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal',
'username' => 'drupal',
'password' => 'drupal',
@Luukyb
Luukyb / settings.local.php
Last active July 22, 2016 07:06
Docker D8 example of settings.local.php for local
<?php
$databases['default']['default'] = array (
'database' => 'drupal',
'username' => 'drupal',
'password' => 'drupal',
'prefix' => '',
'host' => 'db',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
@Luukyb
Luukyb / update.sh
Created April 18, 2016 09:55
Drupal build update script
#!/bin/bash
echo "Executing build for upgrade"
echo ""
echo "Registry rebuild"
drush rr
echo ""
# You can run this script with the argument dev.
dev_setup=false
@Luukyb
Luukyb / gist:cedbe89e8c66173341b8
Created December 11, 2015 06:07
Drupal-vm - stuff I change.
# Make sure it matches your /etc/hosts files.
vagrant_hostname: drupalvm-8.dev
vagrant_machine_name: drupalvm-8
vagrant_ip: 192.168.76.98
# Map your local path.
vagrant_synced_folders:
- local_path: ~/VM/drupal-vm-8
destination: /var/www
@Luukyb
Luukyb / hide-d8-fields.php
Created October 9, 2015 12:49
Tiny Drupal 8 module to hide a few fields for non admin.
<?php
/**
* @file
* Small module to hides a few fields for non admin.
*/
use Drupal\Core\Access\AccessResult;
/**
@Luukyb
Luukyb / gist:dfa4322bbf00b44ef128
Created May 4, 2015 09:22
Create lighter sql dump files with drush using this drushrc.php file
<?php
/**
* @file
* Example of a drushrc.php file with cache tables setup.
*
* This setup will allow you to create smaller sql dump files by excluding the
* cache tables.
* drushrc.php can be placed in ~/.drush/ or inside your sites/default.
* Then you can use something like:
@Luukyb
Luukyb / gist:efd2bb9b7932081b68a3
Created April 28, 2015 00:39
PhpMyAdmin create_tables.sql no double underscore
-- --------------------------------------------------------
-- SQL Commands to set up the pmadb as described in the documentation.
--
-- This file is meant for use with MySQL 5 and above!
--
-- This script expects the user pma to already be existing. If we would put a
-- line here to create him too many users might just use this script and end
-- up with having the same password for the controluser.
--
-- This user "pma" must be defined in config.inc.php (controluser/controlpass)
@Luukyb
Luukyb / Vagrantfile
Created September 6, 2014 03:45
Minimal Vagrantfile for Drupal. Box + IP + Memory + File Permission
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080