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
#!/usr/bin/env python | |
from ansible.inventory.ini import InventoryParser | |
import json | |
import os | |
file_path = os.path.dirname(os.path.realpath(__file__)) | |
static_file = os.path.join(file_path, "hosts") |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
# forward gulp hosted client from vagrant to host. | |
config.vm.network "forwarded_port", guest: 8080, host: 8080 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script data-require="[email protected]" data-semver="3.1.1" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" /> | |
<script src="http://libs.cartocdn.com/cartodb.js/v3/3.15/cartodb.js"></script> | |
</head> | |
<body> |
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
// based on https://gist.github.com/Prophet32j/05a2ceda3743b9fd93e98e56a9227309 | |
const fs = require('fs'); | |
const uuid = require('uuid-v4'); | |
const buildMargeInput = (testResults) => { | |
let elapsed = buildElapsedTime(testResults.testResults); | |
let testSuites = testResults.testResults.map(createSuite); | |
var input = {}; | |
input.stats = { | |
suites: testResults.numTotalTestSuites, |
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
// static/js/admin/admin-tag-blocks-widget-adapter.js | |
// inspired by: | |
// see: https://stackoverflow.com/questions/70359932/wagtail-how-to-get-tags-to-work-with-telepath-tags-in-streamfield | |
// copied and adapted from | |
// see: https://github.com/wagtail/wagtail/blob/v4.0.1/client/src/entrypoints/admin/telepath/widgets.js | |
class BoundTagItWidget { | |
constructor(element, name, idForLabel, initialState, parentCapabilities) { | |
var selector = ':input[name="' + name + '"]'; | |
this.input = element.find(selector).addBack(selector); // find, including element itself |
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
class OauthEndSessionView(views.APIView): | |
"""Impements an endpoint to end the session | |
https://openid.net/specs/openid-connect-rpinitiated-1_0.html | |
* Works on both GET and POST | |
OpenID Providers MUST support the use of the HTTP GET and POST methods defined in RFC 7231 [RFC7231] at the Logout | |
Endpoint. RPs MAY use the HTTP GET or POST methods to send the logout request to the OP. If using the HTTP GET | |
method, the request parameters are serialized using URI Query String Serialization. If using the HTTP POST method, | |
the request parameters are serialized using Form Serialization. | |
* Runs the normal django logout | |
* The spec doesn't state what http response codes to use, so we'll use 204 no 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
import json | |
from graphene_django.utils.testing import GraphQLTestCase | |
class GraphQLIntrospectionTestCase(GraphQLTestCase): | |
graphql = """ | |
query IntrospectionQuery { | |
__schema { | |
queryType { name } |
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
{% extends "wagtailadmin/login.html" %} | |
{% block branding_login %}CMS{% endblock %} | |
{% block login_form %} | |
{% if user.is_authenticated %} | |
<p>Current user: {{ user.email }}</p> | |
<form action="{% url 'oidc_logout' %}" method="post"> | |
{% csrf_token %} | |
<input type="submit" value="logout" /> | |
</form> | |
{% else %} |