Skip to content

Instantly share code, notes, and snippets.

View tarekdj's full-sized avatar
🏠
Working from home

Tarek Djebali tarekdj

🏠
Working from home
View GitHub Profile
@tarekdj
tarekdj / gist:8218514
Created January 2, 2014 12:23
Rule export
{ "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" } }
@tarekdj
tarekdj / ubuntu-compass-ruby
Created January 5, 2016 19:47 — forked from stephanetimmermans/ubuntu-compass-ruby
Install Compass+Ruby on Ubuntu 14.04
#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
@tarekdj
tarekdj / MY_MODULE.module
Last active November 15, 2016 19:19
Issue #2563761: Call to undefined function bootstrap_form_process()
<?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 July 19, 2016 10:27 — 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.
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 / docker-compose.override.yaml
Last active December 14, 2018 14:45
DDEV nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
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
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 / plugins.txt
Created October 28, 2019 13:35
Some helpful vagrant plugins
$ 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
@tarekdj
tarekdj / fix-permissions.sh
Last active November 20, 2020 20:09
sudo bash fix-permissions.sh --drupal_path=your/drupal/path
#!/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.