Skip to content

Instantly share code, notes, and snippets.

<?php
add_action( 'customize_register', 'test_customize_register' );
function test_customize_register($wp_customize) {
$wp_customize->add_section(
'test_section',
array(
'title' => __( 'Test section', 'woocommerce' ),
'priority' => 10,
func verifySignature(payload []byte, secret, receivedSignature string) (bool, error) {
signature, err := computeSignature(payload, secret)
if err != nil {
return false, err
}
return signature == receivedSignature, nil
}
func computeSignature(payload []byte, secret string) (string, error) {
@albarin
albarin / postman-update
Last active May 6, 2019 09:21
Call to update Postman collection
curl -X PUT \
https://api.getpostman.com/collections/${POSTMAN_COLLECTION_UID} \
-H "Content-Type: application/json" \
-H "X-Api-Key: ${POSTMAN_API_KEY}" \
-d @postman-collection.json
@albarin
albarin / authorization.yaml
Created May 6, 2019 09:15
Authorization header
bearer_auth:
name: Authorization
type: apiKey
in: header
description: To authenticate to any Typeform API, you'll need to pass a public API access token to the `Authorization` header in the form of `Bearer <accessToken>`.
@albarin
albarin / filter.js
Created April 1, 2019 13:35
Script to filter OpenAPI spec
const pickBy = require('lodash.pickby')
const validate = require('./schema-validator.js')
const DEFAULT_FILTERS = [
{
key: 'x-visibility',
value: 'EXTERNAL'
},
{
key: 'x-status',
{
"require": {
"[username]/[repository-name]": "dev-master"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/[username]/[repository-name]"
}
],