Skip to content

Instantly share code, notes, and snippets.

View gabesullice's full-sized avatar

Gabe Sullice gabesullice

View GitHub Profile
@gabesullice
gabesullice / ResponseSubscriber.php
Last active May 5, 2022 22:56
Dynamically Redirecting Drupal 8 Node Pages
<?php
/**
* This file should live at my_module/src/EventSubscriber/ResponseSubscriber.php
*/
namespace Drupal\my_module\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\Event;

Status

This extension was developed as part of the jsonapi module for Drupal.

Introduction

The JSON API specification is agnostic about how a server implements filtering strategies. In fact, the spec says:

Note: JSON API is agnostic about the strategies supported by a server. The filter query parameter can be used as the basis for any number of filtering strategies.

const shapeFactory = {
make: function () {
console.log(arguments)
}
}
class Monad {
constructor ({type = undefined, scale = undefined} = {}) {
this.type = type

Keybase proof

I hereby claim:

  • I am gabesullice on github.
  • I am gabesullice (https://keybase.io/gabesullice) on keybase.
  • I have a public key whose fingerprint is D7C7 1832 D46A 2A1C CB7A 50FB 7BBD 313F 2606 387C

To claim this, I am signing this object:

// parent
{% set defaults = {
'footer': '@fph-components/regions/footer/footer.twig'
} %}
{% set overrides = {
'footer-tertiary': '@fph-components/regions/footer/footer--tertiary.twig'
} %}
{%
include defaults['footer'] with {
@gabesullice
gabesullice / settings.environment.php
Created June 20, 2017 21:58
Example Drupal Environment Configuration
<?php
// You may uncomment this once you have a database installed.
$databases['default']['default'] = [
'database' => '<database_name>',
'username' => '<database_username>',
'password' => '<database_password>',
'host' => '<db.yourdomain.com>',
'port' => '3306',
'driver' => 'mysql',
@gabesullice
gabesullice / flags.sh
Last active August 31, 2017 19:55
Simple Shell Flag Parsing
#!/bin/bash
set -e
declare -A options
options["your"]=false
options["options"]=false
options["here"]=false
main () {
@gabesullice
gabesullice / error.sh
Created September 5, 2017 16:12
Make output
[0] gabe EW7833UAC_linux_v4.3.21_17997.20160531 $ sudo make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.12.4-1-ARCH/build M=/home/gabe/Downloads/edimax/EW7833UAC_linux_4.3.21_kernel_3.16-4.4/EW7833UAC_linux_v4.3.21_17997.20160531 modules
make[1]: Entering directory '/usr/lib/modules/4.12.4-1-ARCH/build'
CC [M] /home/gabe/Downloads/edimax/EW7833UAC_linux_4.3.21_kernel_3.16-4.4/EW7833UAC_linux_v4.3.21_17997.20160531/os_dep/linux/ioctl_linux.o
/home/gabe/Downloads/edimax/EW7833UAC_linux_4.3.21_kernel_3.16-4.4/EW7833UAC_linux_v4.3.21_17997.20160531/os_dep/linux/ioctl_linux.c: In function ‘rtw_ioctl_wext_private’:
/home/gabe/Downloads/edimax/EW7833UAC_linux_4.3.21_kernel_3.16-4.4/EW7833UAC_linux_v4.3.21_17997.20160531/os_dep/linux/ioctl_linux.c:14004:5: error: implicit declaration of function ‘is_compat_task’; did you mean ‘is_idle_task’? [-Werror=implicit-function-declaration]
if(is_compat_task())
^~~~~~~~~~~~~~
is_idle_task
@gabesullice
gabesullice / jsonapi_operations.experiment.patch
Created May 16, 2019 18:50
Experiment (ignore everything about the "registry")
diff --git a/jsonapi_operations.services.yml b/jsonapi_operations.services.yml
index bbb3da6..d6fd805 100644
--- a/jsonapi_operations.services.yml
+++ b/jsonapi_operations.services.yml
@@ -6,3 +6,8 @@ services:
- '@jsonapi.resource_type.repository'
- '@database'
- '@http_kernel'
+
+ jsonapi_operations.local_id_registry:
let count = undefined;
let startTime = undefined;
export class ErrorNotStarted extends Error {
constructor() {
super("The counter has not been started.");
}
}
export class ErrorAlreadyStarted extends Error {