Skip to content

Instantly share code, notes, and snippets.

View shelane's full-sized avatar

Shelane French shelane

View GitHub Profile
@shelane
shelane / DrupalCallback.php
Created July 19, 2023 19:10 — forked from purushotamrai/DrupalCallback.php
Implementing Custom Pagination without Drupal Entity Query - Drupal 8
<?php
namespace Drupal\custom_module\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Pager\PagerManagerInterface;
class ListNonDrupalItems extends ControllerBase {
@shelane
shelane / nodemaker_term_create.php
Created March 2, 2021 19:52 — forked from himerus/nodemaker_term_create.php
Create a taxonomy term programmatically in Drupal 8.
<?php
/**
* @file
* Contains various helper functions.
*/
use Drupal\taxonomy\Entity\Term;
/**
@shelane
shelane / MyService.php
Created October 10, 2020 03:53 — forked from JeffTomlinson/MyService.php
Drupal 8 Configuration Dependency Injection
<?php
namespace Drupal\my_module\Services;
use Drupal\Core\Config\ConfigFactory;
/**
* Class MyService.
*
* @package Drupal\my_module\Services
@shelane
shelane / drupal8-links.php
Created October 9, 2020 23:47 — forked from colorfield/drupal8-links.php
Drupal 8 links, or where is my l() function
@shelane
shelane / ask.sh
Created July 21, 2020 03:34
Bash General-Purpose Yes/No Prompt Function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# https://djm.me/ask
local prompt default reply
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@shelane
shelane / git_create_orphan.sh
Created April 30, 2020 02:58 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@shelane
shelane / gist:653f0de69f9dca4eeb440bfe86e3cf55
Created March 13, 2019 22:14
DRUPAL bootstrap dropdown override
/*
* Bootstrap override
* make dropdown menus do dropdown on hover,
* and allow parent link to be clickable
*/
// place this in your styles
ul.nav li.dropdown:hover > ul.dropdown-menu{
display: block !important;
}
@shelane
shelane / .gitignore
Last active November 6, 2018 19:40 — forked from octocat/.gitignore
Some common .gitignore configurations
# git config --global core.excludesfile ~/.gitignore_global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so