Skip to content

Instantly share code, notes, and snippets.

View sam2de's full-sized avatar

Sam Faragalla sam2de

View GitHub Profile
@sam2de
sam2de / SearchAlterDocuments.php
Created February 26, 2024 16:53
add entity type to solr
<?php
#web/modules/custom/sdgs_helper/src/EventSubscriber/SearchAlterDocuments.php
namespace Drupal\sdgs_helper\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\search_api_solr\Event\SearchApiSolrEvents;
use Drupal\search_api_solr\Event\PostCreateIndexDocumentEvent;
@sam2de
sam2de / .ddev-config.yaml
Last active March 5, 2022 02:14
ddev port conflict
name: q1
type: drupal9
docroot: web
php_version: "7.4"
webserver_type: nginx-fpm
router_http_port: "8080"
router_https_port: "8443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
for t in $(drush sqlq "show tables"); do echo $(drush sqlq "SELECT '$t' n, COUNT(*) r FROM $t") ; done
# Add MS code to path https://code.visualstudio.com/docs/setup/mac
cat << EOF >> ~/.zshrc
# Add Visual Studio Code (code)
export PATH="/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH"
EOF
==================
# Add Sublime text to path https://code.visualstudio.com/docs/setup/mac
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
@sam2de
sam2de / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console