Skip to content

Instantly share code, notes, and snippets.

View marcaddeo's full-sized avatar

Marc Addeo marcaddeo

View GitHub Profile
diff --git a/src/ActionLink/ActionLinkTypeBase.php b/src/ActionLink/ActionLinkTypeBase.php
index a14e37e..bc2a154 100644
--- a/src/ActionLink/ActionLinkTypeBase.php
+++ b/src/ActionLink/ActionLinkTypeBase.php
@@ -11,6 +11,7 @@ use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\Session\SessionManagerInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
@marcaddeo
marcaddeo / password_policy-validation_message.patch
Last active November 3, 2018 17:39
Add error validation messages
diff --git a/password_policy.module b/password_policy.module
index 6b8d956..edd5c5b 100644
--- a/password_policy.module
+++ b/password_policy.module
@@ -10,6 +10,7 @@ use Drupal\password_policy\Entity\PasswordPolicy;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\user\UserInterface;
+use Drupal\Component\Render\FormattableMarkup;
debug: Trying to retrieve from file cache with key id
debug: Trying to retrieve from file cache with key id
info: Bootstraping...
silly: It's not particularly silly, is it?
debug: Emitting event pre-bootstrap
debug: Event pre-bootstrap has 0 listeners
debug: Config set: {"env":{"MANPATH":"/home/travis/.nvm/versions/node/v8.9.1/share/man:/home/travis/.kiex/elixirs/elixir-1.4.5/man:/home/travis/.rvm/rubies/ruby-2.4.1/share/man:/usr/local/man:/usr/local/cmake-3.9.2/man:/usr/local/clang-5.0.0/share/man:/usr/local/share/man:/usr/share/man:/home/travis/.rvm/man","SSH_AGENT_PID":"4029","XDG_SESSION_ID":"2","MYSQL_UNIX_PORT":"/var/run/mysqld/mysqld.sock","TRAVIS_FILTERED":"redirect_io","rvm_bin_path":"/home/travis/.rvm/bin","GEM_HOME":"/home/travis/.rvm/gems/ruby-2.4.1","HAS_JOSH_K_SEAL_OF_APPROVAL":"true","NVM_CD_FLAGS":"","PYENV_ROOT":"/opt/pyenv","TRAVIS_STACK_JOB_BOARD_REGISTER":"/.job-board-register.yml","SHELL":"/bin/bash","TERM":"screen-256c
@marcaddeo
marcaddeo / dont-save-filename-to-config.patch
Created July 10, 2018 15:21
Update the BackupDatabaseForm to not persist the filename to config, as we're using config_readonly
diff --git a/src/Form/BackupDatabaseForm.php b/src/Form/BackupDatabaseForm.php
index e9ba957..66851b1 100755
--- a/src/Form/BackupDatabaseForm.php
+++ b/src/Form/BackupDatabaseForm.php
@@ -70,11 +70,6 @@ class BackupDatabaseForm extends FormBase {
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state->getValues();
- // Save filename.
- \Drupal::configFactory()->getEditable('backup_db.settings')
@marcaddeo
marcaddeo / printQuery.php
Last active December 13, 2018 16:45
A function to print out a full SelectInterface query, substituting placeholders and values
<?php
function printQuery(\Drupal\Core\Database\Query\SelectInterface $query, $exit = TRUE) {
$database = \Drupal::service('database');
$queryString = $query->__toString();
$queryArgs = $query->arguments();
$queryString = preg_replace('~\{([^\}]+)\}~', '$1', $queryString);
// Sort the args so replacements don't mess eachother up.
krsort($queryArgs);
@marcaddeo
marcaddeo / background_process_fixes.patch
Last active July 3, 2018 18:45
Fixes to background_process
diff --git a/README.md b/README.md
index 09008b1..2b08d1b 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,3 @@
-<?php
-
-/**
- * @file
- * Module Installation Note.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Marc Addeo">
<%= if assigns[:title] do %>

Keybase proof

I hereby claim:

  • I am marcaddeo on github.
  • I am marcaddeo (https://keybase.io/marcaddeo) on keybase.
  • I have a public key whose fingerprint is 64F0 1535 6FE3 7ABE 3444 5611 AB5F C39B 9610 5359

To claim this, I am signing this object:

tasdadada
@marcaddeo
marcaddeo / hank.coffee
Created January 23, 2012 23:45
A simple IRC bot
{Hook} = require 'hook.io'
irc = require 'irc'
http = require 'http'
redis = require 'redis'
config =
name: 'Hank'
delimiter: '@'
password: 'password'
server: 'irc.rizon.net'