Skip to content

Instantly share code, notes, and snippets.

@btakita
btakita / mckenzie_starlite__replacement__bumper.svg.ts
Last active October 26, 2022 06:06
mckenzie_starlite__replacement__bumper.svg.ts
import { writeFile } from 'fs/promises'
import { dirname, join } from 'path'
import PDFDocument from 'pdfkit'
import SVGToPdf from 'svg-to-pdfkit'
// 96.75
// 8 x 7.5
const in__px = 96
const page__width__in = 11
const page__height__in = 8.5
const page__margin_x__in = .5
@btakita
btakita / out-of-order-data-hk.html
Created January 14, 2022 18:11
Compare the .Layout_company element with .Layout_nav_footer_header
<main data-hk="0.0.0.0.0.0.0.0.1.0" class="_layout "><div
data-hk="0.0.0.0.0.0.0.0.1.1.0.0.0.0.2.0.5" class="Company_Page companies_index_route"><!--#--><!--/--><!--#--><div
data-hk="0.0.0.0.0.0.0.0.1.1.0.0.0.0.2.0.7.0" class="Layout_companies " class=" "><a class="ctx-ribbon"
href="https://docs.google.com/forms/d/e/1FAIpQLScdm8Sf4yBGNpUCES2j6T-DDuqO2A5JDyiWj1PzS5aPd5VEfQ/viewform"
title="&amp;#946&amp;#949&amp;#932&amp;#913 &amp;#8594 Please send your feedback!"
target="_blank">BETA: Please send your feedback!</a>
<!--#--><div data-hk="0.0.0.0.0.0.0.0.1.1.0.0.0.0.2.0.7.1.0" class="Layout_app"><div
data-hk="0.0.0.0.0.0.0.0.1.1.0.0.0.0.2.0.7.1.2.0" class="Layout_company"><div
data-hk="0.0.0.0.0.0.0.0.1.1.0.0.0.0.2.0.7.1.2.1.0" class="companies_index_route_content"><!--#--><!--/--><div></div>
<!--#--><div data-hk="0.0.0.0.0.0.0.0.1.1.0.0.0.0.2.0.7.1.2.1.1.0" class="blank"
<Placemark>
<name>Property</name>
<LineString>
<tessellate>1</tessellate>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>
29.7479,-103.7888
29.7444,-103.7888
29.7480,-103.7846
29.74444,-103.7846

% Dhall: A programmable configuration language % Gabriel Gonzalez % December 15, 2020


Overview

<style lang="scss"> :not(.overview) > .slides {
┌───┬────────────────────────────────────────────────────────────┬────────┬────────────────┬──────────────────────────────────┬───────────┐
│ │ Resource │ Effect │ Action │ Principal │ Condition │
├───┼────────────────────────────────────────────────────────────┼────────┼────────────────┼──────────────────────────────────┼───────────┤
│ + │ ${menu-dev/dev.pay.menu.com-apigateway/CloudWatchRole.Arn} │ Allow │ sts:AssumeRole │ Service:apigateway.amazonaws.com │ │
├───┼────────────────────────────────────────────────────────────┼────────┼────────────────┼──────────────────────────────────┼───────────┤
│ + │ ${menu-dev/dev.pay.menu.com.images_assets.Arn}/* │ Allow │ s3:GetObject │ * │ │
└───┴────────────────────────────────────────────────────────────┴────────┴────────────────┴───────
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