Skip to content

Instantly share code, notes, and snippets.

@LionsAd
LionsAd / smartcache-plus-poc.diff
Created February 18, 2015 13:20
SmartCache++
diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php
index 69e99a0..8bdf86a 100644
--- a/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -184,6 +184,11 @@ protected function doRender(&$elements, $is_root_call = FALSE) {
$this->bubbleStack();
return $elements['#markup'];
}
+
+ // Store the cache ID for later comparison.
<?php
/**
* Minifies and removes unneeded cache tags.
*
* @param array $cache_tags
* List of cache tags.
*
* @return array
* Shortened and cleaned up cache tag list.
<?php
class BigPipeResponse extends StreamedResponse {
public function __construct(Response $response) {
$this->mainResponse = $response;
$this->setStatusCode($response->statusCode());
$this->headers->set($response->headers->all());
$this->mainBody = $response->getContent();
}
if (!"ggplot2" %in% rownames(installed.packages())) {
install.packages("ggplot2")
}
library("ggplot2")
args <- commandArgs(trailingOnly = TRUE)
before_file <- args[1]
after_file <- args[2]
@tclavier
tclavier / find-oldest-line
Created July 24, 2017 07:27
Find oldest line in git repo
#!/bin/bash
for file in $(find . -type f);
do
git blame --date=format:%Y%m%d $file
done | sed -e 's/.*\s\([0-9]\{8\}\)\s.*/\1/' | sort -r | tail
@balsama
balsama / ama-manual-cloud-deploy.md
Last active June 11, 2020 03:59
Instructions to manually deploy Migrate Assistant to an Acquia Cloud environment

Manually deploy a newly created migrate project to Acquia Cloud

Prerequisites

  1. Admin access to an Acquia Cloud hosting environment.
  2. A Drupal 7 site running locally
  3. SSH keys on Cloud for your local machine

Instructions

  1. Generate a new migrate project. Use the migrate-quickstart command to generate a new Drupal 9 project per the instructions in the Quick Start section of AMA’s README. You should also run the commands that are echoed at the end of following those instructions.
import pandas as pd
import pytz
from datetime import datetime
from pytz.exceptions import AmbiguousTimeError
from tqdm import tqdm
# Read the CSV file - Replace fluviusdata with filename
df = pd.read_csv('fluviusdata.csv', delimiter=';')
# Replace commas with periods in the 'Volume' column