Skip to content

Instantly share code, notes, and snippets.

View jakubknejzlik's full-sized avatar

Jakub Knejzlík jakubknejzlik

View GitHub Profile
@jakubknejzlik
jakubknejzlik / appsync-sfn-datasource.ts
Last active August 25, 2023 11:14
CDK AppSync SFN DataSource
import { Construct } from "constructs";
import {
BaseResolverProps,
GraphqlApi,
HttpDataSource,
HttpDataSourceProps,
MappingTemplate,
} from "aws-cdk-lib/aws-appsync";
import { Stack } from "aws-cdk-lib";
import { StateMachine } from "aws-cdk-lib/aws-stepfunctions";
@jakubknejzlik
jakubknejzlik / terraform-aws-website.tf
Last active April 28, 2019 00:35
Static website deployment configuration example
module "myawesomewebsite" {
source = "github.com/jakubknejzlik/terraform-aws-website"
domain = "example.com"
subdomain = "www"
}
@jakubknejzlik
jakubknejzlik / index.handler.js
Last active July 26, 2018 08:31
CloudFront Lambda request/origin event handler
const path = require('path');
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
const userAgent = getHeader(request, 'User-Agent');
console.log('before',userAgent,'=>',JSON.stringify(request));
const domain = getDomain(request);
if (!domain) {
@jakubknejzlik
jakubknejzlik / kontena-gitlab-oauth
Created February 15, 2018 20:29
Kontena master configuration for gitlab oauth2 provider
{
"server.root_url": "http://master.example.com",
"oauth2.client_id": "...",
"oauth2.client_secret": "...",
"oauth2.authorize_endpoint": "https://git.example.com/oauth/authorize",
"oauth2.token_endpoint": "https://git.example.com/oauth/token",
"oauth2.userinfo_scope": "api",
"oauth2.userinfo_endpoint": "https://git.example.com/api/v4/user",
"oauth2.userinfo_user_id_jsonpath": "$..id"
}
@jakubknejzlik
jakubknejzlik / UIColor.swift
Last active July 9, 2017 23:56 — forked from nbasham/UIColor.swift
Swift 3: CSS color names and hex to UIColor. UIColor from hex 3, 4, 6, and 8 characters in length with or without # prefix. UIColor to hex. UIColor extension that creates immutable UIColor instances from hexadecimal and CSS color name strings (e.g. ff0, #f00, ff0000, ff0000ff, Pink, aZure, CLEAR, nil). Conversely, you can obtain a UIColor's hexa…
//
// UIColor.swift
// previously Color+HexAndCSSColorNames.swift
//
// Created by Norman Basham on 12/8/15.
// Copyright © 2017 Black Labs. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights