Skip to content

Instantly share code, notes, and snippets.

View amaisano's full-sized avatar

Adamo Maisano amaisano

  • MBTA
  • Boston, MA
View GitHub Profile
@amaisano
amaisano / MBTA_CMS_API.md
Last active February 4, 2020 21:10
A snapshot of MBTA's CMS API Endpoints
@pcambra
pcambra / queue.php
Created October 18, 2018 09:41
Drupal 8: Process a queue programmatically
$queue_factory = \Drupal::service('queue');
$queue_manager = \Drupal::service('plugin.manager.queue_worker');
$queue_worker = $queue_manager->createInstance('queue_name');
$queue = $queue_factory->get('queue_name');
$item = $queue->claimItem();
$queue_worker->processItem($item->data);
@MatthieuScarset
MatthieuScarset / .lando.yml
Last active January 4, 2024 15:03
Correct settings for XDebug + VSCode + Lando (+3.0)
# Lando version is at least +3.0
name: drupal-nine
recipe: drupal9
services:
appserver:
webroot: web
xdebug: debug
config:
php: .vscode/php.ini
@ateucher
ateucher / setup-gh-cli-auth-2fa.md
Last active May 3, 2024 11:06
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email 'firstname.lastname@gov.bc.ca'
    
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*

HomeKit Service and Characteristic UUIDs

Thanks to HAP-NodeJS

Service UUID
Accessory Information 0000003E-0000-1000-8000-0026BB765291
Air Quality Sensor 0000008D-0000-1000-8000-0026BB765291
Battery Service 00000096-0000-1000-8000-0026BB765291
Bridging State 00000062-0000-1000-8000-0026BB765291
@tegansnyder
tegansnyder / disable mcafee endpoint protection.md
Last active December 26, 2023 03:18
Disable McAffee Endpoint Protection OSX

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas

alternatively

sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
@amcgowanca
amcgowanca / INFO.md
Created July 1, 2015 03:41
Drupal 7 & Preferred menu links

Drupal 7 and Preferred Menu Links

One would expect that a preferred menu link item would be that link item in a menu which is the default or primary menu link item for any particular path where more than one menu link exists in the same menu with the same link path. For example, when you create a new node instance which allows for menu link creation within the node edit form, it would be expected that when the node is fully loaded (therefore contains the property menu as an array which is loaded via the invocation of hook_node_prepare that is implemented by the menu module) the $node->menu represents the preferred menu link for this node. While we can significantly rely on this method for any node's menu link when retrieved via a node object ($node->menu), we cannot expect to be the same as what may be returned from menu_link_get_preferred('node/' . $node->nid). So which is the the correct preferred menu link?

With the expectation that $node->menu represents the preferred menu link for th

@juampynr
juampynr / mymodule.info
Last active June 9, 2023 21:53
Drupal 7 Views 3 custom field handler
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc