Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Michel Tomas superbiche

🎯
Focusing
View GitHub Profile
@superbiche
superbiche / cache-warmer.py
Last active Jun 21, 2020 — forked from hn-support/cache-warmer.py
A threaded cache warmer in python
View cache-warmer.py
#!/usr/bin/env python
"""
Warm the caches of your website by crawling each page defined in sitemap.xml (can use a local file or an URL).
To use, download this file and make it executable. Then run:
./cache-warmer.py --threads 4 --url http://example.com/sitemap.xml -v
"""
import argparse
import multiprocessing.pool as mpool
import os.path
import re
View keybase.md

Keybase proof

I hereby claim:

  • I am superbiche on github.
  • I am superbiche (https://keybase.io/superbiche) on keybase.
  • I have a public key whose fingerprint is E8B7 EB88 FC66 D8EC 742E 3EF9 E37D EC39 DC4D 305C

To claim this, I am signing this object:

@superbiche
superbiche / graph_models.md
Created Aug 15, 2019 — forked from rg3915/graph_models.md
Generate graphic model Django with PyGraphViz
View graph_models.md

How to generate graphic model Django with PyGraphViz?

sudo apt-get install graphviz libgraphviz-dev pkg-config
virtualenv -p python2.7 .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install pygraphviz
pip uninstall pyparsing
pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709
View oauth_disable_token_cleaning.patch
diff --git a/simple_oauth.module b/simple_oauth.module
index deba4e1..b4e7904 100644
--- a/simple_oauth.module
+++ b/simple_oauth.module
@@ -19,19 +19,20 @@ use Drupal\user\RoleInterface;
/**
* Implements hook_cron().
*/
+
function simple_oauth_cron() {
@superbiche
superbiche / glustertop.py
Created May 28, 2019 — forked from fpytloun/glustertop.py
Real time GlusterFS top-like monitoring
View glustertop.py
#!/usr/bin/env python
"""
Display gluster traffic
This tool uses gluster profiling feature, parsing cumulative statistics.
To understand correctly the results, you have to divide overall write statistics with number of replicas.
Also striped volumes needs to be taken in mind - overall statistics just print sum of all bricks
read/written bytes.
@superbiche
superbiche / README.md
Created Apr 2, 2019 — forked from WengerK/README.md
Programatically use Solr on Drupal 8
View README.md

🔍 Solr (6.1.0+) search Engine & Tika (1.13+) Extractor

We are using solr for search index.

Solr need to be configured for drupal. Follow the INSTALL.txt found in the search_api_solr module.

As a pre-requisite for running your own Solr server, you'll need Java 6 or higher.

Installation

View taxonomy-menu-alter-tree-3.patch
diff --git a/config/schema/taxonomy_menu.schema.yml b/config/schema/taxonomy_menu.schema.yml
index 91f73c0..a247492 100644
--- a/config/schema/taxonomy_menu.schema.yml
+++ b/config/schema/taxonomy_menu.schema.yml
@@ -20,6 +20,9 @@ taxonomy_menu.taxonomy_menu.*:
depth:
type: integer
label: 'Depth'
+ limit:
+ type: integer
View taxonomy-menu-alter-tree-1.patch
diff --git a/src/Entity/TaxonomyMenu.php b/src/Entity/TaxonomyMenu.php
index 27f2c23..800f585 100644
--- a/src/Entity/TaxonomyMenu.php
+++ b/src/Entity/TaxonomyMenu.php
@@ -201,6 +201,7 @@ class TaxonomyMenu extends ConfigEntityBase implements TaxonomyMenuInterface {
$links[$mlid] = $this->buildMenuDefinition($term, $base_plugin_definition);
}
+ \Drupal::moduleHandler()->alter('taxonomy_menu_tree', $links, $terms);
View schemata_fix_commerce_payment_method_issues.patch
diff --git a/schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php b/schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php
index d1a8553..a953bdf 100644
--- a/schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php
+++ b/schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php
@@ -46,7 +46,7 @@ class SchemataSchemaNormalizer extends JsonApiNormalizerBase {
'type' => 'string',
'title' => 'type',
'description' => t('Resource type'),
- 'enum' => [$resource_type->getTypeName()]
+ 'enum' => [$resource_type ? $resource_type->getTypeName() : $entity->getEntityTypeId()]
View jsonapi_extras-vesta-url-enhancer.patch
diff --git a/src/Plugin/jsonapi/FieldEnhancer/UrlLinkEnhancer.php b/src/Plugin/jsonapi/FieldEnhancer/UrlLinkEnhancer.php
new file mode 100644
index 0000000..b5b7d3d
--- /dev/null
+++ b/src/Plugin/jsonapi/FieldEnhancer/UrlLinkEnhancer.php
@@ -0,0 +1,101 @@
+<?php
+
+namespace Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer;
+
You can’t perform that action at this time.