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 | |
*/ |
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
<?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
<?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
#!/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
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
{ | |
"minimum_web_client_version": "master-1094" | |
} |
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
/** | |
* CSRF Token Security. | |
*/ | |
(function() { | |
angular.module("app").config(['$httpProvider', function ($httpProvider) { | |
//check for token in meta tag | |
var csrf_token = $('meta[name=csrf-token]').attr('content'); |
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
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
RewriteEngine On | |
# Redirect root requests | |
RewriteCond %{REQUEST_URI} ^/$ | |
RewriteRule !^/ /back-end/public%{REQUEST_URI} [L] |
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
function _functionName(url) { | |
return Q.fcall(function () { | |
var deferred = Q.defer(); | |
var options = { | |
url: url, | |
headers: { | |
'User-Agent': 'my-app' | |
}, |
NewerOlder