This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://localhost:4200/assets/settings/collections.json | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["data"]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bash script to generate a sitemap.xml from external json data | |
# Author: Sam Deering | |
# POSIX variable reset in case getopts has been used previously | |
OPTIND=1 | |
# Initialize our own variables: | |
URL='http://localhost:4200/items.json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\slq_blocks\Plugin\Condition; | |
use Drupal\Core\Condition\ConditionPluginBase; | |
use Drupal\Core\Form\FormStateInterface; | |
/** | |
* Provides a 'Site Theme' condition. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* DB post-updates for blocks. | |
*/ | |
use Drupal\block_content\Entity\BlockContent; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Send Google analytics tracking event. | |
* | |
* @param mixed $action | |
* Event action. | |
*/ | |
public function sendGoogleTrackingEvent($action) { | |
if (!$this->isProduction()) return; | |
$googleAnalyticsUA = 'UA-XXXXXXXX-XX'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script connects to Sorare API to get perform GraphQL queries using PHP | |
// Playground: https://api.sorare.com/federation/graphql/playground | |
/* | |
Steps: | |
1. Get user salt from Sorare | |
2. Hash password with salt | |
3. Get JWT token with email, password hash & aud from Sorare | |
4. Perform GraphQL query | |
*/ |
OlderNewer