Skip to content

Instantly share code, notes, and snippets.

View kamalgill's full-sized avatar

Kamal Gill kamalgill

View GitHub Profile
@kamalgill
kamalgill / index.js
Created October 10, 2022 04:35 — forked from allenheltondev/index.js
Parameterize Step Function Workflow Definition
const fs = require('fs');
const YAML = require('json-to-pretty-yaml');
const definition = JSON.parse(fs.readFileSync('definition.asl.json'));
const substitutions = [];
parameterizeStates(definition.States, substitutions);
console.log(substitutions)
@kamalgill
kamalgill / cors-xml-schema.rng.xml
Last active September 20, 2018 18:15
AWS S3 CORS XML RelaxNG schema
<element name="CORSConfiguration" xmlns="http://relaxng.org/ns/structure/1.0">
<oneOrMore>
<element name="CORSRule">
<interleave>
<oneOrMore>
<element name="AllowedOrigin"><text /></element>
</oneOrMore>
<oneOrMore>
<element name="AllowedMethod">
<choice>
@kamalgill
kamalgill / cors.py
Created March 18, 2016 22:30 — forked from mmerickel/cors.py
cors in pyramid
from pyramid.security import NO_PERMISSION_REQUIRED
def includeme(config):
config.add_directive(
'add_cors_preflight_handler', add_cors_preflight_handler)
config.add_route_predicate('cors_preflight', CorsPreflightPredicate)
config.add_subscriber(add_cors_to_response, 'pyramid.events.NewResponse')
class CorsPreflightPredicate(object):