Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tarek Djebali tarekdj

🏠
Working from home
View GitHub Profile
@tarekdj
tarekdj / fix-permissions.sh
Last active Nov 20, 2020
sudo bash fix-permissions.sh --drupal_path=your/drupal/path
View fix-permissions.sh
#!/bin/bash
# Help menu
print_help() {
cat <<-HELP
This script is used to fix permissions of a Drupal installation
you need to provide the following arguments:
1) Path to your Drupal installation.
2) Username of the user that you want to give files/directories ownership.
@tarekdj
tarekdj / plugins.txt
Created Oct 28, 2019
Some helpful vagrant plugins
View plugins.txt
$ vagrant plugin install vagrant-proxyconf --plugin-clean-sources --plugin-source http://rubygems.org
$ vagrant plugin install vagrant-exec --plugin-clean-sources --plugin-source http://rubygems.org
$ vagrant plugin install vagrant-env --plugin-clean-sources --plugin-source http://rubygems.org
View gh-giphy.js
function setKeywordText(text) {
var el = document.getElementById("new_comment_field");
el.value = text;
var evt = document.createEvent("Events");
evt.initEvent("change", true, true);
el.dispatchEvent(evt);
}
setKeywordText("add your content here...");
@tarekdj
tarekdj / docker-compose.override.yaml
Last active Dec 14, 2018
DDEV nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
View docker-compose.override.yaml
version: '3.6'
#ddev-generated
services:
db:
container_name: ddev-${DDEV_SITENAME}-db
image: $DDEV_DBIMAGE
stop_grace_period: 60s
volumes:
- type: "volume"
source: mariadb-database
@tarekdj
tarekdj / MY_MODULE.module
Last active Nov 15, 2016
Issue #2563761: Call to undefined function bootstrap_form_process()
View MY_MODULE.module
<?php
/**
* Implements hook_init().
*/
function MY_MODULE_init() {
module_invoke('bootstrap', 'element_info');
module_invoke('bootstrap', 'element_info_alter');
}
@tarekdj
tarekdj / node-and-npm-in-30-seconds.sh
Created Jul 19, 2016 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
View node-and-npm-in-30-seconds.sh
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@tarekdj
tarekdj / ubuntu-compass-ruby
Created Jan 5, 2016 — forked from stephanetimmermans/ubuntu-compass-ruby
Install Compass+Ruby on Ubuntu 14.04
View ubuntu-compass-ruby
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
View gist:8218514
{ "rules_when_creating_node_create_user" : {
"LABEL" : "when creating node create user",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "custom_rules", "devel", "rules", "content_access_rules" ],
"ON" : { "node_insert" : [] },
"DO" : [
{ "add_password" : {
"USING" : { "length" : "8" },
"PROVIDE" : { "password_added" : { "password_added" : "Generated password" } }