Skip to content

Instantly share code, notes, and snippets.

Cameron Eagans cweagans

Block or report user

Report or block cweagans

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View genesis_public_key
0405564c3be1133fa898dee6026cc0311bb38afa486a5cf5bf59724d2f39d63592313c35d56f4931628fb273334888de5ee907a5d6fd1be13ca966f5d57b8a307f
View gist:d9ccad42e11a52ef6847d347008ddceb
<?php
$dispatcher = new EventDispatcher();
$dispatcher->addListener('event.name', [any PHP Callable]);
$dispatcher->dispatch('event.name'); // the callable you specified above gets called.
View main.go
package main
import (
"bufio"
"fmt"
"log"
"net"
"os"
)
View keybase.md

Keybase proof

I hereby claim:

  • I am cweagans on github.
  • I am cweagans (https://keybase.io/cweagans) on keybase.
  • I have a public key ASCpnZvox_Sn5AeHEZr6iswFpOCKb3HfXv0cmKoQFPrxMwo

To claim this, I am signing this object:

@cweagans
cweagans / notes.md
Created Nov 24, 2015
Drupal.org Composer followups
View notes.md
  • Decide on subdir or subdomain for metadata
  • composer.json parsing -> project dependency
  • Decide on metadata structure (for caches)
  • Figure out how caching composer metadata works
  • Create project_composer project on d.o
  • Check HTTP auth support in Composer
  • Get decision on contrib semver
  • Define composer.json -> metadata merge rules
  • Translate submodule dependencies to package dependencies in composer metadata
  • Open issue on Packagist for federated metadata
View -
diff --git a/docroot/modules/custom/pc_editorial/pc_editorial.module b/docroot/modules/custom/pc_editorial/pc_editorial.module
index 30de354..0edaeb0 100644
--- a/docroot/modules/custom/pc_editorial/pc_editorial.module
+++ b/docroot/modules/custom/pc_editorial/pc_editorial.module
@@ -1,5 +1,7 @@
<?php
+use Drupal\Core\Form\FormStateInterface;
+
function pc_editorial_entity_type_alter(array &$entity_types) {
View college-of-idaho-boone-fund-marketing.md

The annoying thing is not that they're calling and asking for money. It's that the frequency with which they do so is abusive, and that they're marketing the most to the wrong group of people (i.e. people that just graduated, who are statistically likely to be digging themselves out of a gigantic student loan). Alienating your donor pool before they're even able or willing to donate is not a good long-term strategy for - you know - getting donations.

The actual communications themselves are not really conducive to getting donations, either. Instead of reaching out with the equivalent of "Hi, money plz. kthxbai.", send a monthly email newsletter with what the Boone fund is actually doing with that money, along with any future initiatives that they want to pursue, and information about their fundraising goals and progress toward those goals. Then - as a FOOTNOTE - ask for money to help further these goals. It shouldn't be a header. It shouldn't be the subject of the email. It shouldn't be the opening line on t

View -
diff --git a/aws_sqs.services.yml b/aws_sqs.services.yml
index 4040cd8..8b9a833 100644
--- a/aws_sqs.services.yml
+++ b/aws_sqs.services.yml
@@ -1,3 +1,4 @@
services:
queue.awssqs:
- class: Drupal\aws_sqs\Queue\QueueAwsSqsFactory
\ No newline at end of file
+ class: Drupal\aws_sqs\Queue\AwsSqsQueueFactory
View gist:9df375cb217b1fe79367
<?php
namespace My\Something {
class MyClass {
public static function my_function() {
echo "shutdown function called";
}
}
}
@cweagans
cweagans / PHPUnit_Extensions_PhptTestCase.patch
Last active Jan 20, 2017
Changes undesirable behavior in PHPUnit_Extensions_PhptTestCase for cweagans/mcrypt-polyfill tests.
View PHPUnit_Extensions_PhptTestCase.patch
diff --git a/src/Extensions/PhptTestCase.php b/src/Extensions/PhptTestCase.php
index 162c6d80..cb1cfe02 100644
--- a/src/Extensions/PhptTestCase.php
+++ b/src/Extensions/PhptTestCase.php
@@ -109,6 +109,10 @@ private function assertPhptExpectation(array $sections, $output)
$assertion = $sectionAssertion;
$expected = $sectionName == 'EXPECTREGEX' ? "/{$sectionContent}/" : $sectionContent;
+ // HACK: Get rid of filenames in expected output.
+ $expected = str_replace('%s%e' . basename($this->filename, 't'), '-', $expected);
You can’t perform that action at this time.