Skip to content

Instantly share code, notes, and snippets.

cweagans /
Last active Mar 12, 2020
Cache the output of any CLI tool

Caches the output of any other CLI tool in a simple filesystem-backed cache.


Put the file in your $PATH somewhere. I called mine cache instead of, so that's what's reflected in the examples below.


View genesis_public_key
View gist:d9ccad42e11a52ef6847d347008ddceb
$dispatcher = new EventDispatcher();
$dispatcher->addListener('', [any PHP Callable]);
$dispatcher->dispatch(''); // the callable you specified above gets called.
View main.go
package main
import (

Keybase proof

I hereby claim:

  • I am cweagans on github.
  • I am cweagans ( on keybase.
  • I have a public key ASCpnZvox_Sn5AeHEZr6iswFpOCKb3HfXv0cmKoQFPrxMwo

To claim this, I am signing this object:

cweagans /
Created Nov 24, 2015 Composer followups
  • 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 @@
+use Drupal\Core\Form\FormStateInterface;
function pc_editorial_entity_type_alter(array &$entity_types) {

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/ b/
index 4040cd8..8b9a833 100644
--- a/
+++ b/
@@ -1,3 +1,4 @@
- class: Drupal\aws_sqs\Queue\QueueAwsSqsFactory
\ No newline at end of file
+ class: Drupal\aws_sqs\Queue\AwsSqsQueueFactory
View gist:9df375cb217b1fe79367
namespace My\Something {
class MyClass {
public static function my_function() {
echo "shutdown function called";