Skip to content

Instantly share code, notes, and snippets.

View rteijeiro's full-sized avatar
🏄‍♂️
I love the smell of Drupal in the morning!

Ruben Teijeiro rteijeiro

🏄‍♂️
I love the smell of Drupal in the morning!
View GitHub Profile
@rteijeiro
rteijeiro / drupal_permissions.sh
Last active November 29, 2016 21:31
Set the correct files and folders permissions for Drupal
find . -type d -exec chmod 750 '{}' \;
find . -type f -exec chmod 640 '{}' \;
find . -type d -name files -exec chmod 770 '{}' \;
# GET Node in hal+json format
curl -v -H "Accept:application/hal+json" --request GET http://127.0.0.1:8080/drupal/node/1?_format=hal_json
# GET Node in json format
curl -v -H "Accept:application/json" --request GET http://127.0.0.1:8080/drupal/node/1?_format=json
# POST Node in hal+json format
curl --include --request POST --user user:pass --header 'Content-type: application/hal+json' http://127.0.0.1:8080/drupal/entity/node --data-binary '{"_links":{"type":{"href":"http://127.0.0.1:8080/drupal/rest/type/node/article"}}, "title":[{"value":"Node created using curl at Drupalaton 2015"}], "body": [{"value":"This is the body of the node created using curl at Drupalaton 2015. Are you having fun?"}]}'
# Update Node using PATCH
curl --include --request PATCH --user user:pass --header 'Content-type: application/hal+json' http://127.0.0.1:8080/drupal/node/2 --data-binary '{"_links":{"type":{"href":"http://127.0.0.1:8080/drupal/rest/type/node/article"}}, "title":[{"value":"Welcome to Drupalaton 2015"}], "body": [{"valu
@rteijeiro
rteijeiro / .vimrc
Last active June 21, 2016 19:30
Vim config for Drupal project development
" Allow Vim-only settings even if they break vi keybindings.
set nocompatible
" Load plugins with Pathogen
execute pathogen#infect()
execute pathogen#helptags()
" Enable filetype detection.
filetype off
filetype plugin indent on