Skip to content

Instantly share code, notes, and snippets.

pbuyle / AsyncStreamHelpers.scala
Last active September 2, 2021 13:54
Untested Scala code to group com.twitter.concurrent.AsyncStream elements toghether. I wrote it thinking I needed it but was wrong. Manbe I will eventually need it. Maybe not. Maybe I will not remember this gist when I do. Maybe I got it all wrong.
View AsyncStreamHelpers.scala
import com.twitter.concurrent.AsyncStream
object AsyncStreamHelpers {
implicit class RichAsyncStream[T](val stream: AsyncStream[T]) {
* Partitions this stream into sequences of adjacent elements grouped according to some discriminator function.
* This method will evaluation of this stream until its first element not belonging to the first group (ie. if the
* first element of the returned stream is a size of `n` then `n + 1` first element of this stream will be
* evaluated). Accessing each subsequent element of the resulting stream will evaluate another group of elements
View gist:7f140f6a55b9232cc7b5d373a170e473
Verifying my Blockstack ID is secured with the address 1NgvMCTCjVWieFSw47dNskw7HePTe7PNiY
pbuyle /
Created October 16, 2017 13:36

Keybase proof

I hereby claim:

  • I am pbuyle on github.
  • I am pbuyle ( on keybase.
  • I have a public key ASB9qdFh6waGTWDNPznaOoUIM--VNmb7fIDmlUEkGaEfIAo

To claim this, I am signing this object:

pbuyle / MODULE.module.php
Last active April 5, 2017 18:40
Integration of Pantheon with the Cache Expiration (expire) module on Drupal
View MODULE.module.php
* Implements hook_init().
function MODULE_init() {
// Add Surrogate-Key headers based on path segments.
// E.g. if the current path is product/some-category/product-name
// we should end up with the following Surrogate-Keys:
// product product/some-category product/some-category/product-name
pbuyle / composer.json
Last active June 30, 2018 17:03
[Drupal] Redirects in settings.php with nikic/fast-route
View composer.json
"require": {
"nikic/fast-route": "^1.0"
pbuyle / RoboFile.php
Last active March 21, 2018 16:51
Deploy to Pantheon with Robo
View RoboFile.php
* This is project's console commands configuration for Robo task runner.
* @see
class RoboFile extends \Robo\Tasks {
use terminusLoadTasks;
pbuyle / affirmation
Created April 23, 2015 15:11
MuleSoft Contributor Agreement Acceptance by Pierre Buyle
View affirmation
I, Pierre Buyle, have read and do accept the MuleSoft Contributor Agreement
Accepted on Thu Apr 23 2015 11:11:29 GMT-0400 (EDT)
pbuyle / MODULE.install.php
Last active November 9, 2022 18:19
Drupal - Migrate existing field content from language "undefined" to entity language in a single hook_update_N() implementation.
View MODULE.install.php
* Migrate existing field content from language "undefined" to entity language.
function MODULE_update_N(&$sandbox) {
// Number of entities to be processed for each step.
$messages = array();
if (!isset($sandbox['fields'])) {
// Initialize the array of field to process.
pbuyle / monitor.php
Last active August 29, 2015 14:04
Simple Drupal monitor script (avoid full bootstrap, check DB and cache availability)
View monitor.php
header( "Cache-Control: no-cache, max-age=0, must-revalidate");
define('DRUPAL_ROOT', __DIR__);
require_once 'includes/';
pbuyle / FeatureContext.php
Last active January 25, 2024 23:25
Behat step-definition to verify visibility (not just presence) of Drupal form elements.
View FeatureContext.php
use Behat\Behat\Context\ClosuredContextInterface,
use Behat\Gherkin\Node\PyStringNode,