Skip to content

Instantly share code, notes, and snippets.

export const pay_apigateway_b = _b('pay_apigateway', (ctx: aws_run_ctx_type) => {
const { construct } = ctx
const pay_host = pay_host_b(ctx)
const local_az_certificate = local_az_certificate_b(ctx)
const pay_apigateway = new RestApi(construct, `${pay_host}-apigateway`, {
restApiName: `${pay_host}-apigateway`,
deploy: true,
defaultCorsPreflightOptions: {
allowOrigins: ['*'],
allowHeaders: [
curl -H 'host: dev.menu.com' -v https://d15j0txe0f6dbz.cloudfront.net
* Trying 52.84.129.64:443...
* Connected to d15j0txe0f6dbz.cloudfront.net (52.84.129.64) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
import { CfnOutput } from '@aws-cdk/core';
import { _b } from '@ctx-core/object';
import { ctx_type } from './ctx_type';
import { host_b } from './host_b';
import { lambdaVersion_b } from './lambdaVersion_b';
import { lambdaFunction_b } from './lambdaFunction_b';
import {
AwsIntegration,
LambdaIntegration, LambdaRestApi, MethodLoggingLevel,
} from '@aws-cdk/aws-apigateway';
@btakita
btakita / index.ts
Last active August 29, 2022 23:23
AWS CDK for a static https website
#!/usr/bin/env node
// See https://github.com/aws-samples/aws-cdk-examples/tree/master/typescript/static-site/
import { Stack, App, StackProps } from '@aws-cdk/core'
import { CONTEXT_ENV } from '@aws-cdk/cx-api'
import { StaticSite } from './static-site'
type Context = {
domain: string,
subdomain: string,
}
const ctx = JSON.parse(process.env[CONTEXT_ENV] as string) as Context
@btakita
btakita / resume.json
Last active August 19, 2019 03:05
resume.json
{
"meta": {"theme": "flat"},
"basics": {
"name": "Brian Takita",
"label": "Fullstack Web & Mobile App Developer",
"picture": "",
"email": "brian.takita@gmail.com",
"website": "https://briantakita.com",
"summary": "A summary of John Doe...",
"profiles": [
@btakita
btakita / input.txt
Last active March 25, 2019 23:06
MaxMyInterest knapsack interview problem
$15.05
mixed fruit,$2.15
french fries,$2.75
side salad,$3.35
hot wings,$3.55
mozzarella sticks,$4.20
sampler plate,$5.80
<script>
export default {
computed: {
config__issues: ({ store, $config__issues }) => (store ? store.get().config__issues : $config__issues) || {},
labels: ({ config__issues }) => config__issues.labels || {},
order: ({ config__issues }) => config__issues.order || [],
titles: ({ bar__issues }) => ( bar__issues && bar__issues.titles) || {},
values: ({ bar__issues }) => ( bar__issues && bar__issues.values) || {},
representations: ({ bar__issues }) => ( bar__issues && bar__issues.representations) || {},
weights: ({ bar__issues }) => ( bar__issues && bar__issues.weights) || {},
<p>This is a top-level element.</p>
<Nested on:event1=event1(event) on:event2:1=event21(event)/>
<script>
import Nested from './Nested.html';
export default {
methods: {
event1(event) {
console.debug('event1')
@btakita
btakita / resolve__rollup.js
Last active March 23, 2018 22:02
Resolve from current directory
/** Add this into the rollup plugins array
resolve__rollup({
paths: ['.', 'node_modules'],
extensions: ['.mjs', '.js', '.json', '.tag']
})
*/
function resolve__rollup(options) {
return {
name: 'resolve__rollup',
<div class="jumbotron">
<div class="row">
<div class="col-md-6">
<h1>Svelte (keyed)</h1>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="run" on:click="run()">Create 1,000 rows</button>
</div>