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 / 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 / .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 / IntegerDropdownWidget.php
Created May 8, 2018 12:06 — forked from crittermike/IntegerDropdownWidget.php
Drupal 8 form widget example: creates a select dropdown for integer fields. Place in src/Plugin/Field/FieldWidget
<?php
/**
* @file
* Defines a dropdown widget for integer fields.
*/
namespace Drupal\nba_content_core\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldFilteredMarkup;
use Drupal\Core\Field\FieldItemListInterface;
@davidjguru
davidjguru / drupal7-multistep-form-example.php
Created April 15, 2018 18:43 — forked from drmalex07/drupal7-multistep-form-example.php
An example with multistep forms in drupal7. #drupal #drupal7 #multistep-form
<?php
function helloworld_multistep_example_form($form, &$form_state)
{
// We add 2 keys to form_state ("step" and "state") to keep track
// of state in a multistep form.
$step = isset($form_state['step'])? ($form_state['step']) : (1);
$form['heading'] = array(
'#type' => 'markup',
@davidjguru
davidjguru / README-Template.md
Created February 18, 2018 11:50 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@davidjguru
davidjguru / tmux-cheatsheet.markdown
Created November 19, 2017 10:38 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname