Skip to content

Instantly share code, notes, and snippets.

┌───┬────────────────────────────────────────────────────────────┬────────┬────────────────┬──────────────────────────────────┬───────────┐
│ │ 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';
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@btakita
btakita / jasmine-node-overrides.js
Last active September 7, 2019 11:11
Fix for it & Fast failure output for jasmine-node.
function fixIt() {
GLOBAL.it = function() {
return jasmine.getEnv().it.apply(jasmine.getEnv(), arguments);
}
}
function immediateErrorOutput() {
var theOriginalFail = jasmine.Spec.prototype.fail;
jasmine.Spec.prototype.fail = function (e) {
theOriginalFail.apply(this, arguments);
@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')