Skip to content

Instantly share code, notes, and snippets.

View davidjguru's full-sized avatar
🍅
Working within a pomodoro cycle

David Rodriguez davidjguru

🍅
Working within a pomodoro cycle
View GitHub Profile
@davidjguru
davidjguru / Drupal Horizontal Layout.txt
Created May 8, 2018 12:00
Drupal set horizontal layout from a render array of elements
// Context: Within a formElement, inside a FormWidget
$element += array(
'#type' => 'fieldset',
'#attributes' => array('class' => array('container-inline')),
);
@davidjguru
davidjguru / Info and links
Created May 10, 2018 19:25
[INFO] Custom Compound Fields in Drupal 8
# A global recipe to set up a new workstation. For the on-boarding of new workmates.
## Getting Google Chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get install libxss1 libgconf2-4 libappindicator1 libindicator7
sudo dpkg -i google-chrome-stable_current_amd64.deb
## Setting up a LAMP environment
sudo apt-get update
sudo apt-get install apache2 mysql-server php libapache2-mod-php php-mcrypt php-mysql
@davidjguru
davidjguru / basic_workflow_ignored_files
Created June 18, 2018 12:47
Cleaning Git: Deactivating follow-up on projects through . gitignore
git rm -r --cached .
git add -A
git commit -am 'Basic workflow to clean git with ignored files from a new gitignore'
@davidjguru
davidjguru / .gitignore
Created June 19, 2018 15:47 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@davidjguru
davidjguru / SQLite - Fast install Basic packages
Created June 26, 2018 10:33
SQLite - Fast install Basic packages in Ubuntu
sudo apt-get install sqlite3 sqlite3-doc libsqlite3-dev
## looking for a package within the system
rpm -aq | grep packagename
## looking for a package in the repo
yum search package
## uninstall packages
yum erase package
## Apache restart
@davidjguru
davidjguru / delete_content_entities.d8.php
Created September 25, 2018 08:17 — forked from Jaesin/delete_content_entities.d8.php
Delete all content entities in Drupal 8.
<?php
// Delete all nodes.
entity_delete_multiple('node', \Drupal::entityQuery('node')->execute());
// Delete all files.
entity_delete_multiple('file', \Drupal::entityQuery('file')->execute());
// Delete all taxonomy terms.
entity_delete_multiple('taxonomy_term', \Drupal::entityQuery('taxonomy_term')->execute());
@davidjguru
davidjguru / . bashrc - Basic Example
Created November 16, 2018 13:36
Basic Example of a .bashrc file within a system to work with Drupal
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
@davidjguru
davidjguru / File_by_Vim_As_Root
Created November 26, 2018 11:40
Writing in a file by vim as root
:w !sudo tee %