Skip to content

Instantly share code, notes, and snippets.

View dsasser's full-sized avatar

Daniel Sasser dsasser

  • Agile Six Applications, Inc.
View GitHub Profile
@dsasser
dsasser / vets-website.debugging.md
Created October 24, 2022 21:23
How to setup node debugging in vscode for vets-website

How to setup node debugging in vscode for vets-website

  1. Set a breakpoint somewhere
  2. setup auto attach: always so any node command will allow debugging automatically
  3. Open a Javascript Terminal in vscode
  4. Run the yarn watch command (or whatever script you are running)
  5. Open the browser links FROM INSIDE the javascript terminal, or: use the Debug: Open Link command, and enter the destination url there.
  6. Enjoy the debugging
<?php
namespace Drupal\module\Plugin\Preprocess;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Render\Element;
use Drupal\preprocess\PreprocessPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
@dsasser
dsasser / create_file.php
Last active June 15, 2016 19:12 — forked from facine/__INDEX.txt
Drupal 8 - Examples
<?php
// Programmatically create files.
use Drupal\file\Entity\File;
$file = File::create([
'uid' => 1,
'filename' => 'logo.svg',
'uri' => 'public://page/logo.svg',
'status' => 1,
]);
<?php
/**
* Fun little set of text generation functions originally created for some custom data volume generation.
*/
/**
* Generate an simple text address.
*
* - 43 Fable Lane, San Francisco, CA 39508
* - 219 Marketing Canyon, New York, NY 11672
export PATH=/usr/local/bin:$PATH
export AH_SITE_NAME=sf2
#aliases
alias php53="/Users/dsasser/switch-php-versions.sh 3"
alias php55="/Users/dsasser/switch-php-versions.sh 5"
alias php52="/Users/dsasser/switch-php-versions.sh 2"
# Environment Vars
export DRUSH_NO_MIN_PHP=1
#!/bin/bash
#switch to using a different version of php
#rm /usr/local/php5
PHP53="php5-5.3.28-20140112-174528"
PHP55="php5-5.5.14-20140628-105310"
ROOT_PATH="/usr/local"
switch () {