Skip to content

Instantly share code, notes, and snippets.

View dantleech's full-sized avatar
💭
Nothing

dantleech dantleech

💭
Nothing
View GitHub Profile

ok, so we have thought this over a little bit and propose the following:

  • Storage: The HTTP cache will store the HTML in one file and the "meta" in another. The "meta" file would contain our "ban" keys (as a serialized PHP array) for the cached HTML document.
  • Invalidation: The application sends a BAN request with a specified HTTP header which contains the ban keys. The response is stored by the cache.
  • Checking the cache: On an incoming request we retrieve the HTML and meta files, we check the ban dictionary for the ban keys from the meta file. If the key exists and the request is older than the ban, we forward to the real (application) HttpKernel.
  • Ban dictionary: I think it should be sufficient to simply create empty files for each key in the cache directoy. Is there a good reason to use something like Stash for this?
  • Cleaning the ban list: We don't, at least not in realtime. Even if we end up with all possible ban keys in the list I guess it shouldn't add significant overhead.
@dantleech
dantleech / poc resource configuration.yml
Created January 29, 2015 17:09
This configuration shows a resource repository configuration allowing multiple sites with cascading resources for routes, themes and blocks
cmf_routing:
dynamic:
persistence:
resource:
enabled: true
repository_name: 'routes_proxy'
map_phpcr: true
cmf_resource:
repository:
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
<class name="Symfony\Cmf\Component\Resource\Repository\Resource\PhpcrOdmResource" xmlns:h="https://github.com/willdurand/Hateoas">
<h:relation rel="self">
<h:href route="_cmf_resource">
<h:parameter name="repositoryName" value="testrepo" />
<h:parameter name="path" value="expr(object.getPath())" />
</h:href>
</h:relation>
<virtual-property serialized-name="children" max-depth="0" method="listChildren"/>
public static function sortObjects($values, $methodNames, $dir = 'asc')
{
if ($values instanceof PersistentCollection) {
$values = $values->toArray();
}
if (!is_array($methodNames)) {
$methodNames = array($methodNames);
}
usort($values,function ($a,$b) use ($methodNames) {
foreach ($methodNames as $i => $methodName) {
Given I am editing a page of type "smart_content_page"
And I wait for a data grid to appear
And I click the first smart content filter icon
And I wait for an overlay to appear
And I click the "Quelle wählen" button
And I wait for the following events:
"""
husky.overlay.smart-content.smart_content.slide-right
husky.column-navigation.smart-contentsmart_content.loaded
"""
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
view_button_press_cb(WebKitWebView *web, GdkEventButton *e, GList *gl)
{
gboolean ret = false;
WebKitHitTestResultContext context;
if (entry_snooping())
return true;
WebKitHitTestResult *result = webkit_web_view_get_hit_test_result(web, e);
g_object_get(result, "context", &context, NULL);
@dantleech
dantleech / gist:5c9ddb20234fd5e338c8
Created November 9, 2014 21:02
Github data in jackalopeFS
PHPCRSH > ls -L2
+-------------------------+-----------------+-----------------------------------------------------------------------------+
| pr-50/ | nt:unstructured | |
| _links/ | nt:unstructured | |
| | review_comment | nt:unstructured | |
| | issue | nt:unstructured | |
| | statuses | nt:unstructured | |
| | html | nt:unstructured | |
| | comments | nt:unstructured | |
| | review_co
@dantleech
dantleech / testconsole
Last active August 29, 2015 14:08
Script for executing a console in the testing environment in SuluCMF components
#!/usr/bin/env php
<?php
// Installation instructions
// 1. Download this script
// 2. chmod a+x thisscript.php
// 3. mv thisscript.php /usr/local/bin/testconsole
// 4. profit
$cwd = getcwd();
webspaces:
sulu_io:
pages:
-
locale: de
template: default
data:
url: /artikles
title: Artikles
description: German articles page